From: Hugh Dickins <hugh@veritas.com>
To: Andrea Arcangeli <andrea@suse.de>
Cc: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>,
linux-kernel@vger.kernel.org, lhms-devel@lists.sourceforge.net
Subject: Re: [RFC] Changing COW detection to be memory hotplug friendly
Date: Fri, 11 Feb 2005 13:20:41 +0000 (GMT) [thread overview]
Message-ID: <Pine.LNX.4.61.0502111258310.7808@goblin.wat.veritas.com> (raw)
In-Reply-To: <20050211085239.GD18573@opteron.random>
On Fri, 11 Feb 2005, Andrea Arcangeli wrote:
>
> Ok, I'm quite convinced it's correct now. The only thing that can make
> mapcount go up without the lock on the page without userspace
> intervention (and userspace intervention would make it an undefined
> behaviour like in my example with fork), was the swapin, and you covered
> it by moving the unlock after page_add_anon_rmap (so mapcount changes
> atomically with the page_swapcount there too). Swapoff was already doing
> it under the page lock.
Thanks a lot for thinking it through, yes, that's how it is.
(For a while I felt nervous about moving that unlock_page below
the arch-defined flush_icache_page; but then realized that since it's
already done with page_table spinlock, PG_locked cannot be an issue.)
> Then we should use the mapcount/swapcount in remove_exclusive_swap_page
> too.
Originally I thought so, but later wasn't so sure. There might be
somewhere which stabilizes PageSwapCache by incrementing page_count,
rechecks it, waits to get lock_page, then assumes still PageSwapCache?
(Though it's hard to see why it would need to make such an assumption,
and in the equivalent file case would have to allow for truncation.)
It just needs a wider audit than the simpler can_share_swap_page case,
and can be done independently later on.
By the way, while we're talking of remove_exclusive_swap_page:
a more functional issue I sometimes wonder about, why don't we
remove_exclusive_swap_page on write fault? Keeping the swap slot
is valuable if read fault, but once the page is dirtied, wouldn't
it usually be better to free that slot and allocate another later?
But I'm always scared of making such changes to swapping, because
I cannot imagine a good enough range of swap performance tests.
Hugh
next prev parent reply other threads:[~2005-02-11 13:21 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-03 3:56 IWAMOTO Toshihiro
2005-02-07 21:24 ` Hugh Dickins
2005-02-08 16:26 ` Hugh Dickins
2005-02-10 7:59 ` IWAMOTO Toshihiro
2005-02-10 19:05 ` Andrea Arcangeli
2005-02-10 19:16 ` Dave Hansen
2005-02-10 19:41 ` Andrea Arcangeli
2005-02-10 20:19 ` Hugh Dickins
2005-02-10 20:40 ` Andrea Arcangeli
2005-02-11 7:23 ` Hugh Dickins
2005-02-11 8:52 ` Andrea Arcangeli
2005-02-11 13:20 ` Hugh Dickins [this message]
2005-02-14 17:41 ` Andrea Arcangeli
2005-02-14 18:36 ` Hugh Dickins
2005-02-14 21:41 ` Andrea Arcangeli
2005-02-15 3:17 ` Andrew Morton
2005-02-09 9:08 ` IWAMOTO Toshihiro
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=Pine.LNX.4.61.0502111258310.7808@goblin.wat.veritas.com \
--to=hugh@veritas.com \
--cc=andrea@suse.de \
--cc=iwamoto@valinux.co.jp \
--cc=lhms-devel@lists.sourceforge.net \
--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
all inboxes | Powered by JetHome®