Re: [patch] buffer locks more finegrined

David S. Miller (davem@redhat.com)
Wed, 1 Sep 1999 11:43:42 -0700


Date: Wed, 1 Sep 1999 18:19:06 +0200 (CEST)
From: Andrea Arcangeli <andrea@suse.de>

On Wed, 1 Sep 1999, David S. Miller wrote:

>I bet you'll see a small, if any, benefit from these changes.

Sure it's a minor optimziation but IMHO the old code was also more
confusing to read (you'll ask yourself "maybe there is some subtle issue
somewhere..." as I did ;).

Actually, there is a subtle issue there. I remembered it as I was out
shopping upon further pondering.

Read the commentary above the first function you changed. The callers
all set themselves up such that they have created an environment where
the count has gone to zero and they've closed up some of the entry
paths to referencing that buffer head.

The routines in question have to guarentee that neither hash lookups
not kflushd/bdflush find it and bump it's reference count. I am very
positive that I had good reason to hold both locks at once there, the
deal is that you cannot create a situation where BH visibility "half
changes", you must remove it from both of the two lists it is one, all
in one atomic sequence.

Later,
David S. Miller
davem@redhat.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/