From: Andrea Arcangeli <andrea@suse.de>
To: Kanoj Sarcar <kanojsarcar@yahoo.com>
Cc: Hugh Dickins <hugh@veritas.com>,
Anton Blanchard <anton@samba.org>, Andi Kleen <ak@suse.de>,
William Lee Irwin III <wli@holomorphy.com>,
linux-mm@kvack.org, davem@redhat.com,
Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>
Subject: Re: smp_rmb in mm/memory.c in 2.6.10
Date: Fri, 14 Jan 2005 22:38:16 +0100 [thread overview]
Message-ID: <20050114213816.GL8709@dualathlon.random> (raw)
In-Reply-To: <20050114211441.59635.qmail@web14305.mail.yahoo.com>
On Fri, Jan 14, 2005 at 01:14:40PM -0800, Kanoj Sarcar wrote:
>
> unmap_mapping_range()
> 8. spin_lock(&mapping->i_mmap_lock); /* irrelevant */
> 9. atomic_inc(&mapping->truncate_count);
The above trace doesn't start there, it's the i_size_write/read we're
serializing against. You should start the above with i_size_write, then
it would make sense.
We probably thought the above spinlock was relevant (and that's why
there's no smp_wmb there yet) but it isn't, because it has inclusive
semantics, and in turn the i_size_write can pass it and it can even pass
atomic_inc (in common code terms of course, on x86 not). So we need a
smp_wmb() before atomic_inc too to be correct (not an issue for x86).
While the reader part (i.e. the smp_rmb erroneously removed), is an
issue at the very least for x86-64 and probably for x86 too despite the
increased 64bit locking for the long long i_size. since those x86* archs
can reorder reads (but not writes). (and atomic_read isn't implying any
cpu barrier, it's only a compiler barrier) So the bug you opened up is
real, while the missing smp_wmb I just noticed is not real for x86* and
it's theoretical only for ia64.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>
next prev parent reply other threads:[~2005-01-14 21:38 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-13 20:26 Kanoj Sarcar
2005-01-13 20:39 ` William Lee Irwin III
2005-01-13 21:02 ` Kanoj Sarcar
2005-01-13 21:06 ` Andi Kleen
2005-01-13 21:29 ` Kanoj Sarcar
2005-01-13 21:59 ` Anton Blanchard
2005-01-13 23:22 ` Kanoj Sarcar
2005-01-14 20:37 ` Hugh Dickins
2005-01-14 21:14 ` Kanoj Sarcar
2005-01-14 21:38 ` Andrea Arcangeli [this message]
2005-01-14 22:09 ` Hugh Dickins
2005-01-14 22:34 ` Andrea Arcangeli
2005-01-14 21:25 ` Andrea Arcangeli
2005-01-14 21:32 ` Andrea Arcangeli
2005-01-14 22:22 ` Kanoj Sarcar
2005-01-14 22:47 ` Hugh Dickins
2005-01-14 22:51 ` Andrea Arcangeli
2005-01-14 23:14 ` Kanoj Sarcar
2005-01-14 23:26 ` Andrea Arcangeli
2005-01-14 22:36 ` Hugh Dickins
2005-01-14 23:01 ` Andrea Arcangeli
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=20050114213816.GL8709@dualathlon.random \
--to=andrea@suse.de \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=anton@samba.org \
--cc=davem@redhat.com \
--cc=hugh@veritas.com \
--cc=kanojsarcar@yahoo.com \
--cc=linux-mm@kvack.org \
--cc=torvalds@osdl.org \
--cc=wli@holomorphy.com \
/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