[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120904194237.GC25236@google.com>
Date: Tue, 4 Sep 2012 12:42:37 -0700
From: Kent Overstreet <koverstreet@...gle.com>
To: Tejun Heo <tj@...nel.org>
Cc: Mikulas Patocka <mpatocka@...hat.com>,
Vivek Goyal <vgoyal@...hat.com>, linux-bcache@...r.kernel.org,
linux-kernel@...r.kernel.org, dm-devel@...hat.com,
bharrosh@...asas.com, Jens Axboe <axboe@...nel.dk>
Subject: Re: [PATCH v7 9/9] block: Avoid deadlocks with bio allocation by
stacking drivers
On Tue, Sep 04, 2012 at 11:55:40AM -0700, Tejun Heo wrote:
> Hello, Mikulas, Kent.
>
> On Mon, Sep 03, 2012 at 08:41:00PM -0700, Kent Overstreet wrote:
> > On Mon, Sep 03, 2012 at 04:41:37PM -0400, Mikulas Patocka wrote:
> > > ... or another possibility - start a timer when something is put to
> > > current->bio_list and use that timer to pop entries off current->bio_list
> > > and submit them to a workqueue. The timer can be cpu-local so only
> > > interrupt masking is required to synchronize against the timer.
> > >
> > > This would normally run just like the current kernel and in case of
> > > deadlock, the timer would kick in and resolve the deadlock.
> >
> > Ugh. That's a _terrible_ idea.
>
> That's exactly how workqueue rescuers work - rescuers kick in if new
> worker creation doesn't succeed in given amount of time. The
> suggested mechanism already makes use of workqueue, so it's already
> doing it. If you can think of a better way to detect the generic
> stall condition, please be my guest.
>
> > Remember the old plugging code? You ever have to debug performance
> > issues caused by it?
>
> That is not equivalent. Plugging was kicking in all the time and it
> wasn't entirely well-defined what the plugging / unplugging conditions
> were. This type of rescuing for forward-progress guarantee only kicks
> in under severe memory pressure and people expect finite latency and
> throughput hits under such conditions. The usual bio / request /
> scsi_cmd allocations could be failing under these circumstances and
> things could be progressing only thanks to the finite preallocated
> pools. I don't think involving rescue timer would be noticeably
> deterimental.
>
> Actually, if the timer approach can reduce the frequency of rescuer
> involvement, I think it could actually be better.
Ok, that was an overly harsh, emotional response. But I still hate the
idea.
You want to point me at the relevant workqueue code? I'd really like to
see what you did there, it's entirely possible you're aware of some
issue I'm not but if not I'd like to take a stab at it.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists