lkml.org 
[lkml]   [2011]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 07/10] block: reorganize throtl_get_tg() and blk_throtl_bio()
Hello,

On Wed, Oct 19, 2011 at 01:45:56PM -0400, Vivek Goyal wrote:
> > 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.
>
> rcu protected spinlocks. Interesting. :-)

:)

> IIUC, it still leaves the window open that two callers think they have
> the spinlock. One is holding the driver provided lock and other is holding
> the queue private lock.

On blk_cleanup_queue() completion, the two are disjoint, so that
shouldn't be a problem. Block layer won't call into low level drivers
and low level drivers aren't supposed to call into block layer either.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2011-10-19 19:53    [W:0.701 / U:0.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site