linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Galbraith <efault@gmx.de>
To: Jens Axboe <axboe@fb.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: get/put_cpu() usage in block/blk-mq.c
Date: Tue, 09 May 2017 17:04:16 +0200	[thread overview]
Message-ID: <1494342256.4440.3.camel@gmx.de> (raw)
In-Reply-To: <d6a3bc24-0a86-08ab-80d8-0d249b0f74b1@fb.com>

On Tue, 2017-05-09 at 08:53 -0600, Jens Axboe wrote:
> On 05/09/2017 12:07 AM, Mike Galbraith wrote:
> > Hi Jens,
> > 
> > I was about to fix up this splat..
> > 
> > [  445.022141] loop: module loaded
> > [  445.078116] BUG: using smp_processor_id() in preemptible [00000000] code: loop0/3801
> > [  445.085873] caller is debug_smp_processor_id+0x17/0x20
> > [  445.091016] CPU: 7 PID: 3801 Comm: loop0 Tainted: G            E   4.12.0-default #40
> > [  445.098838] Hardware name: IBM System x3550 M3 -[7944K3G]-/69Y5698     , BIOS -[D6E150AUS-1.10]- 12/15/2010
> > [  445.108564] Call Trace:
> > [  445.111016]  dump_stack+0x65/0x89
> > [  445.114330]  check_preemption_disabled+0xde/0xf0
> > [  445.118945]  debug_smp_processor_id+0x17/0x20
> > [  445.123300]  blk_stat_add+0xb0/0x130
> > [  445.126876]  __blk_mq_complete_request+0xb5/0x150
> > [  445.131575]  blk_mq_complete_request+0x16/0x20
> > [  445.136020]  loop_queue_work+0x5f/0xaa0 [loop]
> > [  445.140461]  ? _raw_spin_unlock_irq+0x21/0x40
> > [  445.144816]  ? finish_task_switch+0x85/0x270
> > [  445.149085]  ? __schedule+0x291/0x8c0
> > [  445.152747]  kthread_worker_fn+0xc2/0x1d0
> > [  445.156754]  kthread+0x114/0x150
> > [  445.159983]  ? __kthread_init_worker+0xb0/0xb0
> > [  445.164424]  ? kthread_park+0x60/0x60
> > [  445.168085]  ret_from_fork+0x2c/0x40
> 
> Is it from this_cpu_ptr() in blk_stat_add()?

Yeah.

> > ..but then noticed that __blk_mq_run_hw_queue() is also called under
> > get_cpu(), but recently grew a might_sleep(), so maybe wants some block
> > layer eyeballs.
> 
> That part is fine. The might sleep depends on BLOCKING being set in
> the hardware queue flags. And if that is set, then we don't call
> it under get_cpu().

Ah, right.

	-Mike

  reply	other threads:[~2017-05-09 15:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-09  6:07 get/put_cpu() usage in block/blk-mq.c Mike Galbraith
2017-05-09 14:53 ` Jens Axboe
2017-05-09 15:04   ` Mike Galbraith [this message]
2017-05-09 15:13     ` Jens Axboe
2017-05-09 15:15       ` Jens Axboe
2017-05-09 15:40         ` Mike Galbraith
2017-05-09 15:45           ` Jens Axboe
2017-05-09 16:26             ` Mike Galbraith
2017-05-09 16:32               ` Jens Axboe
2017-05-09 16:52                 ` Mike Galbraith

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=1494342256.4440.3.camel@gmx.de \
    --to=efault@gmx.de \
    --cc=axboe@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).