[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080304112945.GB32242@skl-net.de>
Date: Tue, 4 Mar 2008 12:29:45 +0100
From: Andre Noll <maan@...temlinux.org>
To: Neil Brown <neilb@...e.de>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-raid@...r.kernel.org, linux-kernel@...r.kernel.org,
"K.Tanaka" <k-tanaka@...jp.nec.com>
Subject: Re: [PATCH 001 of 9] md: Fix deadlock in md/raid1 and md/raid10 when handling a read error.
On 17:08, Neil Brown wrote:
> > Do we really need to take the spin lock in the common case where
> > conf->pending_bio_list.head is NULL? If not, the above could be
> > optimized to the slightly faster and better readable
> >
> > struct bio *bio;
> >
> > if (!conf->pending_bio_list.head)
> > return 0;
> > spin_lock_irq(&conf->device_lock);
> > bio = bio_list_get(&conf->pending_bio_list);
> > ...
> > spin_unlock_irq(&conf->device_lock);
> > return 1;
>
> Maybe... If I write a memory location inside a spinlock, then after
> the spinlock is dropped, I read that location on a different CPU,
> am I always guaranteed to see the new value? or do I need some sort of
> memory barrier?
Are you worried about another CPU setting conf->pending_bio_list.head
to != NULL after the if statement? If that's an issue I think also
the original patch is problematic because the same might happen after
the final spin_unlock_irq() but but before flush_pending_writes()
returns zero.
Andre
--
The only person who always got his work done by Friday was Robinson Crusoe
Download attachment "signature.asc" of type "application/pgp-signature" (190 bytes)
Powered by blists - more mailing lists