From: Andrea Arcangeli <andrea@suse.de>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: J Sloan <jjs@toyota.com>, Linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: [lkml]Re: VM problems still in 2.2.18
Date: Fri, 15 Dec 2000 15:29:08 +0100 [thread overview]
Message-ID: <20001215152908.M11505@inspiron.random> (raw)
In-Reply-To: <3A394C2F.C2895995@toyota.com> <E146hcf-0000DG-00@the-village.bc.nu>
In-Reply-To: <E146hcf-0000DG-00@the-village.bc.nu>; from alan@lxorguk.ukuu.org.uk on Thu, Dec 14, 2000 at 11:17:11PM +0000
On Thu, Dec 14, 2000 at 11:17:11PM +0000, Alan Cox wrote:
> Andrea - can we have the core VM changes you did without adopting the
> change in semaphore semantics for file system locking which will give third
> party fs maintainers headaches and doesnt match 2.4 behaviour either ?
The changes in semaphore semantics are necessary to fix the spurious out of
memory with MAP_SHARED mappings and they came together with the removal of the
always-asynchronous kpiod. While it's certainly possible to remove it I don't
think removing the fix for MAP_SHARED stuff is a good idea.
Basically it's always safe to replace:
down(&inode->i_sem);
/* critical section */
up(&inode->isem);
with the new fs-semaphore:
fs_down(&inode->i_sem);
/* critical section */
fs_up(&inode->i_sem);
While it's always safe to use fs_down() in place of down(), it should be done
only with inodes that can be memory mapped using MAP_SHARED if in the
/* critical section */ there is any kind of not-GFP_ATOMIC or not-GFP_BUFFER
allocation like any kind of user-copy (as in every f_ops->write callback).
Most of those down are handled in the VFS and 99% of the time no changes are
necessary in the lowlevel fs so it should not even generate headaches to third
party fs maintainers (I think infact reiserfs patch didn't need any change).
Note: directory i_sem doesn't need the fs_down since a directory can't be
mapped in memory.
2.4.x doesn't need this per-process fs_locks information to avoid recursing on
the i_sem while flushing MAP_SHARED mappings to disk because the lowlevel fs
is required to implement a_ops->writepage to support MAP_SHARED, and the
page-flush gets synchronized only via the per-page lock (while in 2.2.x we need
the i_sem on the inode to call the non-zero-copy f_ops->write to flush the
MAP_SHARED dirty pages).
Andrea
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2000-12-15 15:00 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-12-14 2:36 VM problems still in 2.2.18 Mark Symonds
2000-12-14 9:57 ` Alan Cox
2000-12-14 20:09 ` [lkml]Re: " thunder7
2000-12-14 22:38 ` Alan Cox
2000-12-14 22:39 ` J Sloan
2000-12-14 23:17 ` Alan Cox
2000-12-15 14:29 ` Andrea Arcangeli [this message]
2000-12-15 17:57 ` Alan Cox
2000-12-15 18:22 ` Andrea Arcangeli
2000-12-15 18:46 ` Alan Cox
2000-12-15 19:09 ` Andrea Arcangeli
2000-12-15 19:17 ` Alan Cox
2000-12-16 10:49 ` Chris Mason
2000-12-16 13:39 ` Andrea Arcangeli
2000-12-14 23:12 ` J . A . Magallon
2000-12-18 1:03 ` Mark Symonds
2000-12-15 18:30 ` Mark Symonds
-- strict thread matches above, loose matches on Subject: below --
2000-12-15 13:00 [lkml]Re: " Ed Tomlinson
2000-12-15 17:52 ` Alan Cox
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=20001215152908.M11505@inspiron.random \
--to=andrea@suse.de \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=jjs@toyota.com \
--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