Subject: Consolidate tasklet + tasklet-hi code

Ingo made a RT patch a few years back called "tasklet: Prevent tasklets
from going into infinite spin in RT" [0]. I ripped the non-RT pieces out
of it and here they are. I kept him as the original Author.

[0] https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git/tree/patches/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch?h=linux-4.14.y-rt-patches

Sebastian



Subject: [PATCH 1/2] kernel/sofirq: consolidate common code in __tasklet_schedule() + _hi_

From: Ingo Molnar <[email protected]>

__tasklet_schedule() and __tasklet_hi_schedule() are almost identical.
Move the common code from both function into __tasklet_schedule_common()
and let both functions invoke it with different arguments.

Signed-off-by: Ingo Molnar <[email protected]>
Signed-off-by: Steven Rostedt <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
[bigeasy: splitted out from RT's "tasklet: Prevent tasklets from going
into infinite spin in RT" and added commit message]
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
---
kernel/softirq.c | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/kernel/softirq.c b/kernel/softirq.c
index 24d243ef8e71..145cf6a2e7c9 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -460,29 +460,31 @@ struct tasklet_head {
static DEFINE_PER_CPU(struct tasklet_head, tasklet_vec);
static DEFINE_PER_CPU(struct tasklet_head, tasklet_hi_vec);

-void __tasklet_schedule(struct tasklet_struct *t)
+static void __tasklet_schedule_common(struct tasklet_struct *t,
+ struct tasklet_head *head,
+ unsigned int softirq_nr)
{
unsigned long flags;

local_irq_save(flags);
t->next = NULL;
- *__this_cpu_read(tasklet_vec.tail) = t;
- __this_cpu_write(tasklet_vec.tail, &(t->next));
- raise_softirq_irqoff(TASKLET_SOFTIRQ);
+ *head->tail = t;
+ head->tail = &(t->next);
+ raise_softirq_irqoff(softirq_nr);
local_irq_restore(flags);
}
+
+void __tasklet_schedule(struct tasklet_struct *t)
+{
+ __tasklet_schedule_common(t, this_cpu_ptr(&tasklet_vec),
+ TASKLET_SOFTIRQ);
+}
EXPORT_SYMBOL(__tasklet_schedule);

void __tasklet_hi_schedule(struct tasklet_struct *t)
{
- unsigned long flags;
-
- local_irq_save(flags);
- t->next = NULL;
- *__this_cpu_read(tasklet_hi_vec.tail) = t;
- __this_cpu_write(tasklet_hi_vec.tail, &(t->next));
- raise_softirq_irqoff(HI_SOFTIRQ);
- local_irq_restore(flags);
+ __tasklet_schedule_common(t, this_cpu_ptr(&tasklet_hi_vec),
+ HI_SOFTIRQ);
}
EXPORT_SYMBOL(__tasklet_hi_schedule);

--
2.16.1


Subject: [PATCH 2/2] kernel/sofirq: consolidate common code in tasklet_action() + tasklet_hi_action()

From: Ingo Molnar <[email protected]>

tasklet_action() + tasklet_hi_action() are almost identical.
Move the common code from both function into __tasklet_schedule_common()
and let both functions invoke it with different arguments.

Signed-off-by: Ingo Molnar <[email protected]>
Signed-off-by: Steven Rostedt <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
[bigeasy: splitted out from RT's "tasklet: Prevent tasklets from going
into infinite spin in RT" and added commit message]
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
---
kernel/softirq.c | 54 +++++++++++++++---------------------------------------
1 file changed, 15 insertions(+), 39 deletions(-)

diff --git a/kernel/softirq.c b/kernel/softirq.c
index 145cf6a2e7c9..fa7ed89a9fcf 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -488,14 +488,16 @@ void __tasklet_hi_schedule(struct tasklet_struct *t)
}
EXPORT_SYMBOL(__tasklet_hi_schedule);

-static __latent_entropy void tasklet_action(struct softirq_action *a)
+static void tasklet_action_common(struct softirq_action *a,
+ struct tasklet_head *tl_head,
+ unsigned int softirq_nr)
{
struct tasklet_struct *list;

local_irq_disable();
- list = __this_cpu_read(tasklet_vec.head);
- __this_cpu_write(tasklet_vec.head, NULL);
- __this_cpu_write(tasklet_vec.tail, this_cpu_ptr(&tasklet_vec.head));
+ list = tl_head->head;
+ tl_head->head = NULL;
+ tl_head->tail = &tl_head->head;
local_irq_enable();

while (list) {
@@ -517,47 +519,21 @@ static __latent_entropy void tasklet_action(struct softirq_action *a)

local_irq_disable();
t->next = NULL;
- *__this_cpu_read(tasklet_vec.tail) = t;
- __this_cpu_write(tasklet_vec.tail, &(t->next));
- __raise_softirq_irqoff(TASKLET_SOFTIRQ);
+ *tl_head->tail = t;
+ tl_head->tail = &t->next;
+ __raise_softirq_irqoff(softirq_nr);
local_irq_enable();
}
}

+static __latent_entropy void tasklet_action(struct softirq_action *a)
+{
+ tasklet_action_common(a, this_cpu_ptr(&tasklet_vec), TASKLET_SOFTIRQ);
+}
+
static __latent_entropy void tasklet_hi_action(struct softirq_action *a)
{
- struct tasklet_struct *list;
-
- local_irq_disable();
- list = __this_cpu_read(tasklet_hi_vec.head);
- __this_cpu_write(tasklet_hi_vec.head, NULL);
- __this_cpu_write(tasklet_hi_vec.tail, this_cpu_ptr(&tasklet_hi_vec.head));
- local_irq_enable();
-
- while (list) {
- struct tasklet_struct *t = list;
-
- list = list->next;
-
- if (tasklet_trylock(t)) {
- if (!atomic_read(&t->count)) {
- if (!test_and_clear_bit(TASKLET_STATE_SCHED,
- &t->state))
- BUG();
- t->func(t->data);
- tasklet_unlock(t);
- continue;
- }
- tasklet_unlock(t);
- }
-
- local_irq_disable();
- t->next = NULL;
- *__this_cpu_read(tasklet_hi_vec.tail) = t;
- __this_cpu_write(tasklet_hi_vec.tail, &(t->next));
- __raise_softirq_irqoff(HI_SOFTIRQ);
- local_irq_enable();
- }
+ tasklet_action_common(a, this_cpu_ptr(&tasklet_hi_vec), HI_SOFTIRQ);
}

void tasklet_init(struct tasklet_struct *t,
--
2.16.1


2018-02-16 14:56:03

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH 1/2] kernel/sofirq: consolidate common code in __tasklet_schedule() + _hi_

On Thu, 15 Feb 2018 18:20:41 +0100
Sebastian Andrzej Siewior <[email protected]> wrote:

> -void __tasklet_schedule(struct tasklet_struct *t)
> +static void __tasklet_schedule_common(struct tasklet_struct *t,
> + struct tasklet_head *head,
> + unsigned int softirq_nr)
> {
> unsigned long flags;
>
> local_irq_save(flags);

If you look at the original patch, it did not move local_irq_save()
into the common function.

> t->next = NULL;
> - *__this_cpu_read(tasklet_vec.tail) = t;
> - __this_cpu_write(tasklet_vec.tail, &(t->next));
> - raise_softirq_irqoff(TASKLET_SOFTIRQ);
> + *head->tail = t;
> + head->tail = &(t->next);
> + raise_softirq_irqoff(softirq_nr);
> local_irq_restore(flags);
> }
> +
> +void __tasklet_schedule(struct tasklet_struct *t)
> +{
> + __tasklet_schedule_common(t, this_cpu_ptr(&tasklet_vec),

What can happen is, we reference (tasklet_vec) on one CPU, get
preempted (running in ksoftirqd), scheduled on another CPU, then when
inside the common code, we are executing on a different CPU than the
tasklet is for. The rasise_softirq() is happening on the wrong CPU.

The local_irq_save() can't be moved to the common function. It must be
done by each individual function.

-- Steve


> + TASKLET_SOFTIRQ);
> +}
> EXPORT_SYMBOL(__tasklet_schedule);

2018-02-16 15:33:38

by Julia Cartwright

[permalink] [raw]
Subject: Re: [PATCH 1/2] kernel/sofirq: consolidate common code in __tasklet_schedule() + _hi_

On Thu, Feb 15, 2018 at 03:07:07PM -0500, Steven Rostedt wrote:
> On Thu, 15 Feb 2018 18:20:41 +0100
> Sebastian Andrzej Siewior <[email protected]> wrote:
>
> > -void __tasklet_schedule(struct tasklet_struct *t)
> > +static void __tasklet_schedule_common(struct tasklet_struct *t,
> > + struct tasklet_head *head,
> > + unsigned int softirq_nr)
> > {
> > unsigned long flags;
> >
> > local_irq_save(flags);
>
> If you look at the original patch, it did not move local_irq_save()
> into the common function.
>
> > t->next = NULL;
> > - *__this_cpu_read(tasklet_vec.tail) = t;
> > - __this_cpu_write(tasklet_vec.tail, &(t->next));
> > - raise_softirq_irqoff(TASKLET_SOFTIRQ);
> > + *head->tail = t;
> > + head->tail = &(t->next);
> > + raise_softirq_irqoff(softirq_nr);
> > local_irq_restore(flags);
> > }
> > +
> > +void __tasklet_schedule(struct tasklet_struct *t)
> > +{
> > + __tasklet_schedule_common(t, this_cpu_ptr(&tasklet_vec),
>
> What can happen is, we reference (tasklet_vec) on one CPU, get
> preempted (running in ksoftirqd), scheduled on another CPU, then when
> inside the common code, we are executing on a different CPU than the
> tasklet is for. The rasise_softirq() is happening on the wrong CPU.
>
> The local_irq_save() can't be moved to the common function. It must be
> done by each individual function.

Well, it can be, but the percpu access needs to go with it; so an
alternative solution would be the below.

I'm also wondering whether the t->next = NULL assignment could be lifted
out from irqs-disabled region.

Julia

diff --git a/kernel/softirq.c b/kernel/softirq.c
index fa7ed89a9fcf..177de3640c78 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -461,12 +461,14 @@ static DEFINE_PER_CPU(struct tasklet_head, tasklet_vec);
static DEFINE_PER_CPU(struct tasklet_head, tasklet_hi_vec);

static void __tasklet_schedule_common(struct tasklet_struct *t,
- struct tasklet_head *head,
+ struct tasklet_head __percpu *headp,
unsigned int softirq_nr)
{
+ struct tasklet_head *head;
unsigned long flags;

local_irq_save(flags);
+ head = this_cpu_ptr(headp);
t->next = NULL;
*head->tail = t;
head->tail = &(t->next);
@@ -476,14 +478,14 @@ static void __tasklet_schedule_common(struct tasklet_struct *t,

void __tasklet_schedule(struct tasklet_struct *t)
{
- __tasklet_schedule_common(t, this_cpu_ptr(&tasklet_vec),
+ __tasklet_schedule_common(t, &tasklet_vec,
TASKLET_SOFTIRQ);
}
EXPORT_SYMBOL(__tasklet_schedule);

void __tasklet_hi_schedule(struct tasklet_struct *t)
{
- __tasklet_schedule_common(t, this_cpu_ptr(&tasklet_hi_vec),
+ __tasklet_schedule_common(t, &tasklet_hi_vec,
HI_SOFTIRQ);
}
EXPORT_SYMBOL(__tasklet_hi_schedule);

2018-02-16 16:48:34

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH 2/2] kernel/sofirq: consolidate common code in tasklet_action() + tasklet_hi_action()

On Thu, 15 Feb 2018 18:20:42 +0100
Sebastian Andrzej Siewior <[email protected]> wrote:

> From: Ingo Molnar <[email protected]>
>
> tasklet_action() + tasklet_hi_action() are almost identical.
> Move the common code from both function into __tasklet_schedule_common()
> and let both functions invoke it with different arguments.
>
> Signed-off-by: Ingo Molnar <[email protected]>
> Signed-off-by: Steven Rostedt <[email protected]>
> Signed-off-by: Thomas Gleixner <[email protected]>
> [bigeasy: splitted out from RT's "tasklet: Prevent tasklets from going
> into infinite spin in RT" and added commit message]
> Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
> ---
> kernel/softirq.c | 54 +++++++++++++++---------------------------------------
> 1 file changed, 15 insertions(+), 39 deletions(-)
>
> diff --git a/kernel/softirq.c b/kernel/softirq.c
> index 145cf6a2e7c9..fa7ed89a9fcf 100644
> --- a/kernel/softirq.c
> +++ b/kernel/softirq.c
> @@ -488,14 +488,16 @@ void __tasklet_hi_schedule(struct tasklet_struct *t)
> }
> EXPORT_SYMBOL(__tasklet_hi_schedule);
>
> -static __latent_entropy void tasklet_action(struct softirq_action *a)
> +static void tasklet_action_common(struct softirq_action *a,
> + struct tasklet_head *tl_head,
> + unsigned int softirq_nr)
> {
> struct tasklet_struct *list;
>
> local_irq_disable();

Same issues with this code.

-- Steve

> - list = __this_cpu_read(tasklet_vec.head);
> - __this_cpu_write(tasklet_vec.head, NULL);
> - __this_cpu_write(tasklet_vec.tail, this_cpu_ptr(&tasklet_vec.head));
> + list = tl_head->head;
> + tl_head->head = NULL;
> + tl_head->tail = &tl_head->head;
> local_irq_enable();
>
>

Subject: Re: [PATCH 1/2] kernel/sofirq: consolidate common code in __tasklet_schedule() + _hi_

On 2018-02-15 15:07:07 [-0500], Steven Rostedt wrote:
> On Thu, 15 Feb 2018 18:20:41 +0100
> Sebastian Andrzej Siewior <[email protected]> wrote:
>
> > -void __tasklet_schedule(struct tasklet_struct *t)
> > +static void __tasklet_schedule_common(struct tasklet_struct *t,
> > + struct tasklet_head *head,
> > + unsigned int softirq_nr)
> > {
> > unsigned long flags;
> >
> > local_irq_save(flags);
>
> If you look at the original patch, it did not move local_irq_save()
> into the common function.
correct but…

> > t->next = NULL;
> > - *__this_cpu_read(tasklet_vec.tail) = t;
> > - __this_cpu_write(tasklet_vec.tail, &(t->next));
> > - raise_softirq_irqoff(TASKLET_SOFTIRQ);
> > + *head->tail = t;
> > + head->tail = &(t->next);
> > + raise_softirq_irqoff(softirq_nr);
> > local_irq_restore(flags);
> > }
> > +
> > +void __tasklet_schedule(struct tasklet_struct *t)
> > +{
> > + __tasklet_schedule_common(t, this_cpu_ptr(&tasklet_vec),
>
> What can happen is, we reference (tasklet_vec) on one CPU, get
> preempted (running in ksoftirqd), scheduled on another CPU, then when
> inside the common code, we are executing on a different CPU than the
> tasklet is for. The rasise_softirq() is happening on the wrong CPU.
>
> The local_irq_save() can't be moved to the common function. It must be
> done by each individual function.

That __tasklet_schedule_common() part is usually invoked from an
interrupt context which attempts to schedule the tasklet so it should
with invoked with interrupts off. However there was one warn_on()
because something early in the boot managed to invoke it without
interrupts disabled (which I missed). Okay, granted, fixed.

As for the second invocation (tasklet_action_common() part) is always
invoked in BH-disabled context (even if called from ksoftirqd) so you
are never preemptible() and can't switch CPUs.
So I am going to correct this patch as you suggested but I don't see the
reason to do the same in the second one.

> -- Steve
Sebastian

Subject: [PATCH 1/2 v2] kernel/sofirq: consolidate common code in __tasklet_schedule() + _hi_

From: Ingo Molnar <[email protected]>

__tasklet_schedule() and __tasklet_hi_schedule() are almost identical.
Move the common code from both function into __tasklet_schedule_common()
and let both functions invoke it with different arguments.

Signed-off-by: Ingo Molnar <[email protected]>
Signed-off-by: Steven Rostedt <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
[bigeasy: splitted out from RT's "tasklet: Prevent tasklets from going
into infinite spin in RT" and added commit message]
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
---
v1…v2: use local_irq_save() within the non-common.

kernel/softirq.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/kernel/softirq.c b/kernel/softirq.c
index 24d243ef8e71..860679e357e2 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -460,15 +460,24 @@ struct tasklet_head {
static DEFINE_PER_CPU(struct tasklet_head, tasklet_vec);
static DEFINE_PER_CPU(struct tasklet_head, tasklet_hi_vec);

+static void __tasklet_schedule_common(struct tasklet_struct *t,
+ struct tasklet_head *head,
+ unsigned int softirq_nr)
+{
+
+ t->next = NULL;
+ *head->tail = t;
+ head->tail = &(t->next);
+ raise_softirq_irqoff(softirq_nr);
+}
+
void __tasklet_schedule(struct tasklet_struct *t)
{
unsigned long flags;

local_irq_save(flags);
- t->next = NULL;
- *__this_cpu_read(tasklet_vec.tail) = t;
- __this_cpu_write(tasklet_vec.tail, &(t->next));
- raise_softirq_irqoff(TASKLET_SOFTIRQ);
+ __tasklet_schedule_common(t, this_cpu_ptr(&tasklet_vec),
+ TASKLET_SOFTIRQ);
local_irq_restore(flags);
}
EXPORT_SYMBOL(__tasklet_schedule);
@@ -478,10 +487,8 @@ void __tasklet_hi_schedule(struct tasklet_struct *t)
unsigned long flags;

local_irq_save(flags);
- t->next = NULL;
- *__this_cpu_read(tasklet_hi_vec.tail) = t;
- __this_cpu_write(tasklet_hi_vec.tail, &(t->next));
- raise_softirq_irqoff(HI_SOFTIRQ);
+ __tasklet_schedule_common(t, this_cpu_ptr(&tasklet_hi_vec),
+ HI_SOFTIRQ);
local_irq_restore(flags);
}
EXPORT_SYMBOL(__tasklet_hi_schedule);
--
2.16.1


2018-02-16 19:20:55

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH 1/2] kernel/sofirq: consolidate common code in __tasklet_schedule() + _hi_

On Fri, 16 Feb 2018 09:53:03 +0100
Sebastian Andrzej Siewior <[email protected]> wrote:

> As for the second invocation (tasklet_action_common() part) is always
> invoked in BH-disabled context (even if called from ksoftirqd) so you
> are never preemptible() and can't switch CPUs.
> So I am going to correct this patch as you suggested but I don't see the
> reason to do the same in the second one.

Should we add something like:

WARN_ON_ONCE(!in_atomic());

?

-- Steve

2018-02-16 19:22:12

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH 1/2] kernel/sofirq: consolidate common code in __tasklet_schedule() + _hi_

On Fri, 16 Feb 2018 18:55:09 +0100
Sebastian Andrzej Siewior <[email protected]> wrote:


> > Should we add something like:
> >
> > WARN_ON_ONCE(!in_atomic());
> >
> > ?
>
> Doubt it. this_cpu_ptr() screams already with CONFIG_DEBUG_PREEMPT.

If that's the case then, yeah I agree. I couldn't remember if
this_cpu_ptr() did that or not. I remember having an argument with
Christoph Lameter about whether or not this_cpu_* functions would
complain with preemption off, as some of the use cases were for being
used with preemption enabled. I remember there was some kind of
compromise but didn't remember exactly what that was.

-- Steve

Subject: Re: [PATCH 1/2] kernel/sofirq: consolidate common code in __tasklet_schedule() + _hi_

On 2018-02-16 12:31:09 [-0500], Steven Rostedt wrote:
> On Fri, 16 Feb 2018 09:53:03 +0100
> Sebastian Andrzej Siewior <[email protected]> wrote:
>
> > As for the second invocation (tasklet_action_common() part) is always
> > invoked in BH-disabled context (even if called from ksoftirqd) so you
> > are never preemptible() and can't switch CPUs.
> > So I am going to correct this patch as you suggested but I don't see the
> > reason to do the same in the second one.
>
> Should we add something like:
>
> WARN_ON_ONCE(!in_atomic());
>
> ?

Doubt it. this_cpu_ptr() screams already with CONFIG_DEBUG_PREEMPT.

> -- Steve

Sebastian

2018-02-20 17:49:19

by Fengguang Wu

[permalink] [raw]
Subject: [kernel/sofirq] ffce8e6f93: BUG:using_smp_processor_id()in_preemptible

FYI, we noticed the following commit (built with gcc-7):

commit: ffce8e6f936e3d879910a76cf8ce6293d78a51e6 ("kernel/sofirq: consolidate common code in __tasklet_schedule() + _hi_")
url: https://github.com/0day-ci/linux/commits/Sebastian-Andrzej-Siewior/kernel-sofirq-consolidate-common-code-in-__tasklet_schedule-_hi_/20180218-010957


in testcase: will-it-scale
with following parameters:

test: pthread_mutex1

test-description: Will It Scale takes a testcase and runs it from 1 through to n parallel copies to see if the testcase will scale. It builds both a process and threads based test in order to see any differences between the two.
test-url: https://github.com/antonblanchard/will-it-scale


on test machine: qemu-system-x86_64 -enable-kvm -cpu Haswell,+smep,+smap -smp 2 -m 2G

caused below changes (please refer to attached dmesg/kmsg for entire log/backtrace):


+------------------------------------------------------------------+------------+------------+
| | 1e3510b2b0 | ffce8e6f93 |
+------------------------------------------------------------------+------------+------------+
| boot_successes | 4 | 0 |
| boot_failures | 4 | 8 |
| invoked_oom-killer:gfp_mask=0x | 4 | 4 |
| Mem-Info | 4 | 4 |
| Kernel_panic-not_syncing:Out_of_memory_and_no_killable_processes | 4 | 4 |
| BUG:using_smp_processor_id()in_preemptible | 0 | 6 |
+------------------------------------------------------------------+------------+------------+



[ 0.958730] BUG: using smp_processor_id() in preemptible [00000000] code: swapper/0/1
[ 0.960556] caller is __tasklet_schedule+0x16/0x40
[ 0.961674] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.16.0-rc1-00189-gffce8e6 #1
[ 0.963411] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1 04/01/2014
[ 0.964537] Call Trace:
[ 0.964537] dump_stack+0xca/0x12b
[ 0.964537] check_preemption_disabled+0x168/0x170
[ 0.964537] ? do_early_param+0xbc/0xbc
[ 0.964537] __tasklet_schedule+0x16/0x40
[ 0.964537] kbd_init+0x10a/0x10f
[ 0.964537] vty_init+0x1f4/0x1fe
[ 0.964537] tty_init+0x171/0x176
[ 0.964537] ? digicolor_uart_init+0x49/0x49
[ 0.964537] do_one_initcall+0x67/0x220
[ 0.964537] kernel_init_freeable+0x139/0x1f8
[ 0.964537] ? rest_init+0xd0/0xd0
[ 0.964537] kernel_init+0xa/0x180
[ 0.964537] ret_from_fork+0x3a/0x50
[ 0.982762] clocksource: acpi_pm: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 2085701024 ns
[ 0.984811] pci_bus 0000:00: resource 4 [io 0x0000-0x0cf7 window]
[ 0.986203] pci_bus 0000:00: resource 5 [io 0x0d00-0xffff window]
[ 0.987582] pci_bus 0000:00: resource 6 [mem 0x000a0000-0x000bffff window]
[ 0.989104] pci_bus 0000:00: resource 7 [mem 0x80000000-0xfebfffff window]
[ 0.990818] NET: Registered protocol family 2
[ 1.002285] tcp_listen_portaddr_hash hash table entries: 1024 (order: 2, 16384 bytes)
[ 1.004080] TCP established hash table entries: 16384 (order: 5, 131072 bytes)
[ 1.005715] TCP bind hash table entries: 16384 (order: 6, 262144 bytes)
[ 1.007143] TCP: Hash tables configured (established 16384 bind 16384)
[ 1.008581] UDP hash table entries: 1024 (order: 3, 32768 bytes)
[ 1.009861] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes)
[ 1.011299] NET: Registered protocol family 1
[ 1.024866] RPC: Registered named UNIX socket transport module.
[ 1.026151] RPC: Registered udp transport module.
[ 1.027183] RPC: Registered tcp transport module.
[ 1.028233] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 1.029570] pci 0000:00:00.0: Limiting direct PCI/PCI transfers
[ 1.030820] pci 0000:00:01.0: PIIX3: Enabling Passive Release
[ 1.032077] pci 0000:00:01.0: Activating ISA DMA hang workarounds
[ 1.033464] pci 0000:00:02.0: Video device with shadowed ROM at [mem 0x000c0000-0x000dffff]
[ 1.035488] PCI: CLS 0 bytes, default 64
[ 1.036533] Unpacking initramfs...
[ 8.550084] Freeing initrd memory: 263216K
[ 8.578887] Initialise system trusted keyrings
[ 8.579949] Key type blacklist registered
[ 8.581070] workingset: timestamp_bits=56 max_order=19 bucket_order=0
[ 8.591389] NET: Registered protocol family 38
[ 8.592551] Key type asymmetric registered
[ 8.593480] Asymmetric key parser 'x509' registered
[ 8.594659] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
[ 8.606536] io scheduler noop registered (default)
[ 8.607722] glob: 64 self-tests passed, 0 failed
[ 8.610731] intel_idle: Please enable MWAIT in BIOS SETUP
[ 8.611929] ipmi message handler version 39.2
[ 8.612934] Copyright (C) 2004 MontaVista Software - IPMI Powerdown via sys_reboot.
[ 8.614779] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input0
[ 8.619804] ACPI: Power Button [PWRF]
[ 8.680296] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[ 8.744823] 00:05: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[ 8.799144] 00:06: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a 16550A
[ 8.801699] Non-volatile memory driver v1.3
[ 8.802900] smapi::smapi_init, ERROR invalid usSmapiID
[ 8.804068] mwave: tp3780i::tp3780I_InitializeBoardData: Error: SMAPI is not available on this machine
[ 8.806058] mwave: mwavedd::mwave_init: Error: Failed to initialize board data
[ 8.807690] mwave: mwavedd::mwave_init: Error: Failed to initialize
[ 8.809055] Hangcheck: starting hangcheck timer 0.9.1 (tick is 180 seconds, margin is 60 seconds).
[ 8.824628] dummy-irq: no IRQ given. Use irq=N
[ 8.826151] e1000: Intel(R) PRO/1000 Network Driver - version 7.3.21-k8-NAPI
[ 8.827670] e1000: Copyright (c) 1999-2006 Intel Corporation.
[ 8.938329] PCI Interrupt Link [LNKC] enabled at IRQ 11
[ 9.370449] e1000 0000:00:03.0 eth0: (PCI:33MHz:32-bit) 52:54:00:12:34:56
[ 9.371951] e1000 0000:00:03.0 eth0: Intel(R) PRO/1000 Network Connection
[ 9.386701] aoe: AoE v85 initialised.
[ 9.387722] i8042: PNP: PS/2 Controller [PNP0303:KBD,PNP0f13:MOU] at 0x60,0x64 irq 1,12
[ 9.390615] serio: i8042 KBD port at 0x60,0x64 irq 1
[ 9.391797] serio: i8042 AUX port at 0x60,0x64 irq 12
[ 9.484813] mousedev: PS/2 mouse device common for all mice
[ 9.486693] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input1
[ 9.489033] mk712: device not present
[ 9.489316] i2c-parport-light: adapter type unspecified
[ 9.504874] pps pps0: new PPS source ktimer
[ 9.505859] pps pps0: ktimer PPS source registered
[ 9.506942] Driver for 1-wire Dallas network protocol.
[ 9.508146] DS1WM w1 busmaster driver - (c) 2004 Szabolcs Gyurko
[ 9.509499] w1_f0d_init()
[ 9.511643] sdhci: Secure Digital Host Controller Interface driver
[ 9.513062] sdhci: Copyright(c) Pierre Ossman
[ 9.516526] No PC Engines board detected
[ 9.526507] NET: Registered protocol family 26
[ 9.527615] gre: GRE over IPv4 demultiplexor driver
[ 9.528717] IPv4 over IPsec tunneling driver
[ 9.529937] NET: Registered protocol family 15
[ 9.530965] NET: Registered protocol family 5
[ 9.531994] can: controller area network core (rev 20170425 abi 9)
[ 9.533377] NET: Registered protocol family 29
[ 9.542509] NET: Registered protocol family 41
[ 9.549111] NET4: DECnet for Linux: V.2.5.68s (C) 1995-2003 Linux DECnet Project Team
[ 9.551148] DECnet: Routing cache hash table of 1024 buckets, 16Kbytes
[ 9.559178] NET: Registered protocol family 12
[ 9.560243] NET: Registered protocol family 37
[ 9.562067] ... APIC ID: 00000000 (0)
[ 9.563033] ... APIC VERSION: 01050014


To reproduce:

git clone https://github.com/intel/lkp-tests.git
cd lkp-tests
bin/lkp qemu -k <bzImage> job-script # job-script is attached in this email



Thanks,
lkp


Attachments:
(No filename) (8.14 kB)
config-4.16.0-rc1-00189-gffce8e6 (136.07 kB)
job-script (6.71 kB)
dmesg.xz (10.03 kB)
Download all attachments
Subject: Re: [kernel/sofirq] ffce8e6f93: BUG:using_smp_processor_id()in_preemptible

On 2018-02-21 01:48:01 [+0800], kernel test robot wrote:
> FYI, we noticed the following commit (built with gcc-7):
>
> commit: ffce8e6f936e3d879910a76cf8ce6293d78a51e6 ("kernel/sofirq: consolidate common code in __tasklet_schedule() + _hi_")
> url: https://github.com/0day-ci/linux/commits/Sebastian-Andrzej-Siewior/kernel-sofirq-consolidate-common-code-in-__tasklet_schedule-_hi_/20180218-010957

yes, and this patch was superseded by

https://lkml.kernel.org/r/[email protected]

Sebastian