mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: mikulas@artax.karlin.mff.cuni.cz, viro@zeniv.linux.org.uk,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH]: Fix SMP-reordering race in mark_buffer_dirty
Date: Wed, 2 Apr 2008 16:52:14 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.1.00.0804021645560.14670@woody.linux-foundation.org> (raw)
In-Reply-To: <20080402150158.f366370f.akpm@linux-foundation.org>



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

  parent reply	other threads:[~2008-04-02 23:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-02 19:20 Mikulas Patocka
2008-04-02 19:44 ` Linus Torvalds
2008-04-02 21:03   ` Mikulas Patocka
2008-04-02 21:31     ` Linus Torvalds
2008-04-02 21:35       ` Linus Torvalds
2008-04-02 22:39         ` Mikulas Patocka
2008-04-02 22:51           ` Linus Torvalds
2008-04-02 22:35       ` Mikulas Patocka
2008-04-02 22:01   ` Andrew Morton
2008-04-02 22:07     ` Linus Torvalds
2008-04-02 22:53       ` Mikulas Patocka
2008-04-02 23:52     ` Linus Torvalds [this message]
2008-04-03  2:12       ` Andrew Morton
2008-04-03 14:34         ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.1.00.0804021645560.14670@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikulas@artax.karlin.mff.cuni.cz \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®