From: Eric Dumazet <eric.dumazet@gmail.com>
To: Jens Axboe <jaxboe@fusionio.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Tejun Heo <tj@kernel.org>, Alan Cox <alan@linux.intel.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH] block: avoid infinite loop in get_task_io_context()
Date: Thu, 31 May 2012 12:38:26 +0200 [thread overview]
Message-ID: <1338460706.2760.1330.camel@edumazet-glaptop> (raw)
In-Reply-To: <1338410107.2760.544.camel@edumazet-glaptop>
From: Eric Dumazet <edumazet@google.com>
On Wed, 2012-05-30 at 22:35 +0200, Eric Dumazet wrote:
> On Wed, 2012-05-30 at 21:08 +0200, Eric Dumazet wrote:
> > On Wed, 2012-05-30 at 20:55 +0200, Jens Axboe wrote:
> > > On 05/30/2012 08:33 PM, Eric Dumazet wrote:
> > > > On Wed, 2012-05-30 at 14:54 +0200, Jens Axboe wrote:
> > > >> Hi Linus,
> > > >>
> > > >> On top of the for-3.5/core pull request, here are the driver related
> > > >> changes for 3.5. It contains:
> > > >
> > > > Hi Jens
> > > >
> > > > Not sure if this is related, but latest Linus tree cannot boot anymore
> > > > here...
> > > >
> > > > BUG: soft lockup - CPU#3 stuck for 22s ! [mountall.1603]
> > >
> > > Hrmpf, can you attach your .config?
> > >
> >
> > I can do a bisection pretty fast I think
>
> Not sure if bisection was good, but result is :
Bisection gave nothing, because its an old bug ?
Following patch cures it.
[PATCH] block: avoid infinite loop in get_task_io_context()
Calling get_task_io_context() on a exiting task which isn't %current can
loop forever. This triggers at boot time on my dev machine.
BUG: soft lockup - CPU#3 stuck for 22s ! [mountall.1603]
Fix this by making create_task_io_context() returns -EBUSY in this case
to break the loop.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Alan Cox <alan@linux.intel.com>
---
block/blk-ioc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/block/blk-ioc.c b/block/blk-ioc.c
index 1e2d53b..893b800 100644
--- a/block/blk-ioc.c
+++ b/block/blk-ioc.c
@@ -235,6 +235,7 @@ void ioc_clear_queue(struct request_queue *q)
int create_task_io_context(struct task_struct *task, gfp_t gfp_flags, int node)
{
struct io_context *ioc;
+ int ret;
ioc = kmem_cache_alloc_node(iocontext_cachep, gfp_flags | __GFP_ZERO,
node);
@@ -262,9 +263,12 @@ int create_task_io_context(struct task_struct *task, gfp_t gfp_flags, int node)
task->io_context = ioc;
else
kmem_cache_free(iocontext_cachep, ioc);
+
+ ret = task->io_context ? 0 : -EBUSY;
+
task_unlock(task);
- return 0;
+ return ret;
}
/**
next prev parent reply other threads:[~2012-05-31 10:38 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-30 12:54 [GIT PULL] Block driver bits for 3.5 Jens Axboe
2012-05-30 18:33 ` Eric Dumazet
2012-05-30 18:55 ` Jens Axboe
2012-05-30 19:08 ` Eric Dumazet
2012-05-30 19:17 ` Jens Axboe
2012-05-30 20:35 ` Eric Dumazet
2012-05-30 20:58 ` Linus Torvalds
2012-05-31 9:35 ` [PATCH] tty: add lockdep annotations Eric Dumazet
2012-05-31 11:45 ` Jiri Kosina
2012-05-31 11:59 ` Eric Dumazet
2012-06-01 18:17 ` Eric Dumazet
2012-06-01 18:51 ` Linus Torvalds
2012-06-01 20:38 ` Alan Cox
2012-06-01 20:46 ` Eric Dumazet
2012-06-01 20:44 ` Eric Dumazet
2012-06-01 20:56 ` Alan Cox
2012-06-01 20:59 ` Eric Dumazet
2012-06-02 7:17 ` Eric Dumazet
2012-06-02 7:55 ` Eric Dumazet
2012-06-02 8:01 ` Eric Dumazet
2012-06-02 11:57 ` Alan Cox
2012-06-02 12:30 ` Eric Dumazet
2012-06-02 18:38 ` Linus Torvalds
2012-06-02 19:59 ` Linus Torvalds
2012-06-02 20:01 ` Linus Torvalds
2012-06-02 20:19 ` Alan Cox
2012-06-02 22:25 ` Linus Torvalds
2012-06-02 23:02 ` Alan Cox
2012-06-02 23:14 ` Linus Torvalds
2012-06-03 1:37 ` Linus Torvalds
2012-06-03 13:06 ` Alan Cox
2012-06-03 13:24 ` Alan Cox
2012-06-03 19:44 ` Eric Dumazet
2012-06-02 20:00 ` Alan Cox
2012-05-31 10:38 ` Eric Dumazet [this message]
2012-05-31 10:47 ` [PATCH] block: avoid infinite loop in get_task_io_context() Jens Axboe
2012-05-31 10:51 ` Eric Dumazet
2012-05-31 10:56 ` Jens Axboe
2012-06-01 5:06 ` Tejun Heo
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=1338460706.2760.1330.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=alan@linux.intel.com \
--cc=jaxboe@fusionio.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
--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
all inboxes | Powered by JetHome®