public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jaxboe@fusionio.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Jens Axboe <axboe@kernel.dk>, Michal Hocko <mhocko@suse.cz>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: 2.6.39-rc4 BUG: unable to handle kernel NULL pointer dereference at 0000000c IP: cfq_insert_request+0x1d/0x3f5
Date: Thu, 21 Apr 2011 17:29:14 +0200	[thread overview]
Message-ID: <4DB04D4A.1000803@fusionio.com> (raw)
In-Reply-To: <BANLkTinYv+YW6HVCodsWcCKwMmdZFsXPRA@mail.gmail.com>

On 2011-04-21 16:38, Linus Torvalds wrote:
> On Thu, Apr 21, 2011 at 12:25 AM, Jens Axboe <axboe@kernel.dk> wrote:
>>>
>>> I am going to bisect, let's see if I can find anything.
>>
>> Thanks, that would be great!
> 
> I'd expect it to be very timing-dependent, and thus could easily be
> triggered (or hidden) by unrelated changes.
> 
> Just happening to have a request added to the elevator at _just_ the
> same moment that another CPU is changing it and getting rid of the
> data structures for the old one.

This particular bug does seem to trigger very reliably. The switching
works by ensuring that we have no requests with elevator data associated
with it before shutting down the old scheduler and attaching the new
one. I smells more like a bug on doing an insert sort on a non-priv
request. I bet this is it, Michal can you give it a spin?

diff --git a/block/elevator.c b/block/elevator.c
index 6f6abc0..45ca1e3 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -671,7 +671,8 @@ void __elv_add_request(struct request_queue *q, struct request *rq, int where)
 			q->boundary_rq = rq;
 		}
 	} else if (!(rq->cmd_flags & REQ_ELVPRIV) &&
-		    where == ELEVATOR_INSERT_SORT)
+		    (where == ELEVATOR_INSERT_SORT ||
+		     where == ELEVATOR_INSERT_SORT_MERGE))
 		where = ELEVATOR_INSERT_BACK;
 
 	switch (where) {

-- 
Jens Axboe


  reply	other threads:[~2011-04-21 15:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-20 12:58 2.6.39-rc4 BUG: unable to handle kernel NULL pointer dereference at 0000000c IP: cfq_insert_request+0x1d/0x3f5 Michal Hocko
2011-04-20 13:03 ` Jens Axboe
2011-04-20 13:13 ` Jens Axboe
2011-04-20 13:29   ` Michal Hocko
2011-04-20 13:31     ` Jens Axboe
2011-04-20 17:33     ` Jens Axboe
2011-04-21  7:16       ` Michal Hocko
2011-04-21  7:25         ` Jens Axboe
2011-04-21 14:38           ` Linus Torvalds
2011-04-21 15:29             ` Jens Axboe [this message]
2011-04-21 18:52               ` Michal Hocko
2011-04-21 18:51             ` Michal Hocko
2011-04-21 19:00               ` Jens Axboe
2011-04-22  7:00                 ` Michal Hocko
2011-04-22 11:35                   ` Jens Axboe
2011-04-22 20:30                     ` Hugh Dickins
2011-04-21 15:04           ` Jeff Moyer
2011-04-21 15:27             ` Vivek Goyal
2011-04-21 15:51               ` Jeff Moyer
2011-04-21 15:30             ` Jens Axboe

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=4DB04D4A.1000803@fusionio.com \
    --to=jaxboe@fusionio.com \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhocko@suse.cz \
    --cc=torvalds@linux-foundation.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