[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111019173053.GG25124@google.com>
Date: Wed, 19 Oct 2011 10:30:53 -0700
From: Tejun Heo <tj@...nel.org>
To: Vivek Goyal <vgoyal@...hat.com>
Cc: axboe@...nel.dk, linux-kernel@...r.kernel.org, ctalbott@...gle.com
Subject: Re: [PATCH 07/10] block: reorganize throtl_get_tg() and
blk_throtl_bio()
Hello,
On Wed, Oct 19, 2011 at 01:19:17PM -0400, Vivek Goyal wrote:
> > Currently, the code has different opportunistic checks which can catch
> > most of those cases but unfortunatly I think it just makes the bugs
> > more obscure.
> >
> > That said, we probably should be switching to internal lock once
> > clenaup is complete.
>
> So even switching to internal lock is racy. Christoph suggeted to break down
> this sharing of queue lock and driver lock and suggested always use
> internal queue lock and modify drivers to use their own lock and manage it.
> It makes sense though it might be lot of work to fix drivers.
Hmmmm, yeah, right, switching itself would be racy. Maybe not sharing
is the solution, I don't know. There's a way to make the switching
safe tho. Sth like the following.
lock_queue(q, flags)
{
spinlock_t *lock;
local_irq_save(flags);
lock = rcu_dereference_sched(q->queue_lock);
spin_lock(lock);
}
and on cleanup, do synchronize_sched() after lock switching. But yeah
it still stinks.
Thanks.
--
tejun
--
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