aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/interrupt.h7
-rw-r--r--include/linux/sched.h1
-rw-r--r--kernel/sched.c2
-rw-r--r--kernel/softirq.c3
4 files changed, 9 insertions, 4 deletions
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 55e0d4253e49..a1382b9b5813 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -426,6 +426,13 @@ extern void raise_softirq(unsigned int nr);
426 */ 426 */
427DECLARE_PER_CPU(struct list_head [NR_SOFTIRQS], softirq_work_list); 427DECLARE_PER_CPU(struct list_head [NR_SOFTIRQS], softirq_work_list);
428 428
429DECLARE_PER_CPU(struct task_struct *, ksoftirqd);
430
431static inline struct task_struct *this_cpu_ksoftirqd(void)
432{
433 return this_cpu_read(ksoftirqd);
434}
435
429/* Try to send a softirq to a remote cpu. If this cannot be done, the 436/* Try to send a softirq to a remote cpu. If this cannot be done, the
430 * work will be queued to the local cpu. 437 * work will be queued to the local cpu.
431 */ 438 */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index d747f948b34e..af6e15fbfb78 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1715,7 +1715,6 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *
1715/* 1715/*
1716 * Per process flags 1716 * Per process flags
1717 */ 1717 */
1718#define PF_KSOFTIRQD 0x00000001 /* I am ksoftirqd */
1719#define PF_STARTING 0x00000002 /* being created */ 1718#define PF_STARTING 0x00000002 /* being created */
1720#define PF_EXITING 0x00000004 /* getting shut down */ 1719#define PF_EXITING 0x00000004 /* getting shut down */
1721#define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */ 1720#define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */
diff --git a/kernel/sched.c b/kernel/sched.c
index 6820b5b3a969..8b89b3bba565 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1880,7 +1880,7 @@ void account_system_vtime(struct task_struct *curr)
1880 */ 1880 */
1881 if (hardirq_count()) 1881 if (hardirq_count())
1882 __this_cpu_add(cpu_hardirq_time, delta); 1882 __this_cpu_add(cpu_hardirq_time, delta);
1883 else if (in_serving_softirq() && !(curr->flags & PF_KSOFTIRQD)) 1883 else if (in_serving_softirq() && curr != this_cpu_ksoftirqd())
1884 __this_cpu_add(cpu_softirq_time, delta); 1884 __this_cpu_add(cpu_softirq_time, delta);
1885 1885
1886 irq_time_write_end(); 1886 irq_time_write_end();
diff --git a/kernel/softirq.c b/kernel/softirq.c
index 68eb5efec388..0cee50487629 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -54,7 +54,7 @@ EXPORT_SYMBOL(irq_stat);
54 54
55static struct softirq_action softirq_vec[NR_SOFTIRQS] __cacheline_aligned_in_smp; 55static struct softirq_action softirq_vec[NR_SOFTIRQS] __cacheline_aligned_in_smp;
56 56
57static DEFINE_PER_CPU(struct task_struct *, ksoftirqd); 57DEFINE_PER_CPU(struct task_struct *, ksoftirqd);
58 58
59char *softirq_to_name[NR_SOFTIRQS] = { 59char *softirq_to_name[NR_SOFTIRQS] = {
60 "HI", "TIMER", "NET_TX", "NET_RX", "BLOCK", "BLOCK_IOPOLL", 60 "HI", "TIMER", "NET_TX", "NET_RX", "BLOCK", "BLOCK_IOPOLL",
@@ -721,7 +721,6 @@ static int run_ksoftirqd(void * __bind_cpu)
721{ 721{
722 set_current_state(TASK_INTERRUPTIBLE); 722 set_current_state(TASK_INTERRUPTIBLE);
723 723
724 current->flags |= PF_KSOFTIRQD;
725 while (!kthread_should_stop()) { 724 while (!kthread_should_stop()) {
726 preempt_disable(); 725 preempt_disable();
727 if (!local_softirq_pending()) { 726 if (!local_softirq_pending()) {