From: Klaus Ripke <paul@malete.org>
To: linux-kernel@vger.kernel.org
Subject: mm/filemap.c: atomic file read(2)/write(2) ?
Date: Fri, 9 Jan 2004 13:08:44 +0100 [thread overview]
Message-ID: <200401091308.45802.paul@malete.org> (raw)
hi all
judging from mm/filemap.c it seems like
ordinary reads/writes should be atomic to each other
(read sees write completely or not at all,
not only where it "can be proven to be after the write"),
if
- the fs uses the generic code from filemap.c,
like ext2 and most do
- the file region affected fits within one cache page,
like nice little B-Tree blocks do,
so there is only one copy_from/to_user per call
- the respective userspace memory regions fit within
one page, so the copy will not be interrupted
- we're not interfering with another processor
(but depending on mm hardware it could even work on SMP ?)
correct?
Would be a nice property to avoid read locks on a L-B-Tree
thx + cheers
Paul
next reply other threads:[~2004-01-09 12:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-09 12:08 Klaus Ripke [this message]
2004-01-10 16:35 ` mm/filemap.c: atomic file read(2)/write(2) ? 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=200401091308.45802.paul@malete.org \
--to=paul@malete.org \
--cc=linux-kernel@vger.kernel.org \
/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