[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.1.00.0804021645560.14670@woody.linux-foundation.org>
Date: Wed, 2 Apr 2008 16:52:14 -0700 (PDT)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Andrew Morton <akpm@...ux-foundation.org>
cc: mikulas@...ax.karlin.mff.cuni.cz, viro@...iv.linux.org.uk,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH]: Fix SMP-reordering race in mark_buffer_dirty
On Wed, 2 Apr 2008, Andrew Morton wrote:
>
> But then the test-and-set of an already-set flag would newly cause the
> cacheline to be dirtied, requiring additional bus usage to write it back?
Looking around a bit, I don't see any realistic case where this could
possibly be the case and that is performance-sensitive.
The VFS-level uses of mark_buffer_dirty() seem to all be coupled with
other uses that clear or set other bits in the buffer status word, so the
cacheline will always apparently be dirty.
The low-level filesystems sometimes do it for things like block bitmap
changes, and I could imagine that there it actually (a) is no longer in
the cache and (b) the buffer really was dirty to start with, but in ext3
for example, you'd end up in journal_dirty_metadata which spinlocks on the
BH_State bit first etc etc.
So the cacheline *will* be dirty, and this function doesn't seem like it
could possibly ever show up in a real profile for any real load anyway, so
it seems odd to try to optimize it this way.
Linus
--
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