lkml.org 
[lkml]   [2012]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7 9/9] block: Avoid deadlocks with bio allocation by stacking drivers
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.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2012-09-05 14:43    [W:0.308 / U:0.580 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site