aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Moore <paul@paul-moore.com>2016-04-04 16:44:02 -0400
committerPaul Moore <paul@paul-moore.com>2016-04-04 16:44:02 -0400
commit7ffb8e317bae03b8ee5bdcec93dc3723be945e9b (patch)
treeb71bd2765fbfde1e39e37e2cba6e6849692341e1
parent0bf676d1fd5144e66ac06939fa3c7c12086c3b18 (diff)
audit: we don't need to __set_current_state(TASK_RUNNING)
Remove the calls to __set_current_state() to mark the task as running and do some related cleanup in wait_for_auditd() to limit the amount of work we do when we aren't going to reschedule the current task. Signed-off-by: Paul Moore <paul@paul-moore.com>
-rw-r--r--kernel/audit.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/kernel/audit.c b/kernel/audit.c
index 3a3e5deeda8d..f52fbefede09 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -430,7 +430,6 @@ restart:
430 attempts, audit_pid); 430 attempts, audit_pid);
431 set_current_state(TASK_INTERRUPTIBLE); 431 set_current_state(TASK_INTERRUPTIBLE);
432 schedule(); 432 schedule();
433 __set_current_state(TASK_RUNNING);
434 goto restart; 433 goto restart;
435 } 434 }
436 } 435 }
@@ -1324,15 +1323,14 @@ static inline void audit_get_stamp(struct audit_context *ctx,
1324static long wait_for_auditd(long sleep_time) 1323static long wait_for_auditd(long sleep_time)
1325{ 1324{
1326 DECLARE_WAITQUEUE(wait, current); 1325 DECLARE_WAITQUEUE(wait, current);
1327 set_current_state(TASK_UNINTERRUPTIBLE);
1328 add_wait_queue_exclusive(&audit_backlog_wait, &wait);
1329 1326
1330 if (audit_backlog_limit && 1327 if (audit_backlog_limit &&
1331 skb_queue_len(&audit_skb_queue) > audit_backlog_limit) 1328 skb_queue_len(&audit_skb_queue) > audit_backlog_limit) {
1329 add_wait_queue_exclusive(&audit_backlog_wait, &wait);
1330 set_current_state(TASK_UNINTERRUPTIBLE);
1332 sleep_time = schedule_timeout(sleep_time); 1331 sleep_time = schedule_timeout(sleep_time);
1333 1332 remove_wait_queue(&audit_backlog_wait, &wait);
1334 __set_current_state(TASK_RUNNING); 1333 }
1335 remove_wait_queue(&audit_backlog_wait, &wait);
1336 1334
1337 return sleep_time; 1335 return sleep_time;
1338} 1336}