The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: linux-kernel@vger.kernel.org
Subject: [BUG] events process running on wrong cpu
Date: Mon, 21 Sep 2009 10:51:55 +0200	[thread overview]
Message-ID: <20090921085155.GB4649@osiris.boeblingen.de.ibm.com> (raw)

Hi,

with todays git from time to time I get this (s390 defconfig):


BUG: using smp_processor_id() in preemptible [00000000] code: events/1/16
caller is vmstat_update+0x28/0x74
CPU: 0 Not tainted 2.6.31-06618-gebc79c4-dirty #3
Process events/1 (pid: 16, task: 000000003fcbea00, ksp: 000000003fcd7cd8)
000000003fcd7da8 000000003fcd7d28 0000000000000002 0000000000000000 
       000000003fcd7dc8 000000003fcd7d40 000000003fcd7d40 00000000003fe46a 
       000000000001ffff 000000003fcd7e70 000000000192b128 ffffffffffffc000 
       000000000000000d 000000000000000c 000000003fcd7d90 0000000000000000 
       0000000000000000 0000000000016bda 000000003fcd7d28 000000003fcd7d68 
Call Trace:
([<0000000000016aea>] show_trace+0xe6/0x134)
 [<0000000000202a5e>] debug_smp_processor_id+0x112/0x12c
 [<00000000000b302c>] vmstat_update+0x28/0x74
 [<000000000005fb9a>] worker_thread+0x19a/0x27c
 [<0000000000065f80>] kthread+0xa0/0xa8
 [<000000000001b786>] kernel_thread_starter+0x6/0xc
 [<000000000001b780>] kernel_thread_starter+0x0/0xc

Please note that events/1 is running in cpu 0 (!).

But (with a patched procfs output):

[root@h4245004 ~]# cat /proc/16/status 
Name:   events/1
State:  S (sleeping)
Tgid:   16
Pid:    16
PPid:   2
TracerPid:      0
Uid:    0       0       0       0
Gid:    0       0       0       0
FDSize: 64
Groups:
Threads:        1
SigQ:   0/4096
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000000000
SigIgn: ffffffffffffffff
SigCgt: 0000000000000000
CapInh: 0000000000000000
CapPrm: ffffffffffffffff
CapEff: fffffffffffffeff
CapBnd: fffffffffffffeff
Cpus_allowed:   00000002  <----------
Cpus_allowed_list:      1 <----------
task: 000000003fcbea00, ksp: 000000003fcd7cd8
User PSW : 0704000180000000 000000000001b780
User GPRS: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
           0000000000000000 0000000000000000 0000000000000000 0000000000000000
           0000000000000000 0000000000065ee0 000000003fe73cf8 000000000004d414
           0000000000000000 0000000000000000 0000000000000000 000000003fcd7eb8
User ACRS: 00000000 00000000 00000000 00000000
           00000000 00000000 00000000 00000000
           00000000 00000000 00000000 00000000
           00000000 00000000 00000000 00000000
voluntary_ctxt_switches:        55
nonvoluntary_ctxt_switches:     1

So the cpus_allowed mask is correct (later on at least). Looks like the
created kthread ran before its cpus_allowed mask was set.
Looking at the code this shouldn't happen. But still...

             reply	other threads:[~2009-09-21  8:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-21  8:51 Heiko Carstens [this message]
2009-09-21  9:02 ` [BUG] events process running on wrong cpu Peter Zijlstra
2009-09-21  9:03   ` Ingo Molnar
2009-09-21  9:08     ` Heiko Carstens
2009-09-21  9:06 ` [PATCH] Always show Cpus_allowed field in /proc/<pid>/status Heiko Carstens
2009-09-21  9:17   ` Heiko Carstens
2009-09-21 22:33     ` Paul Menage
2009-09-21 12:52   ` [tip:sched/core] sched: " tip-bot for Heiko Carstens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090921085155.GB4649@osiris.boeblingen.de.ibm.com \
    --to=heiko.carstens@de.ibm.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=oleg@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox