From: Hugh Dickins <hugh@veritas.com>
To: Li Xiaodong <lixd@cn.fujitsu.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH]swap-zero-page-bug
Date: Sat, 1 Nov 2008 10:33:55 +0000 (GMT) [thread overview]
Message-ID: <Pine.LNX.4.64.0811011012020.21848@blonde.site> (raw)
In-Reply-To: <2C69C7D31680437FB174C65D043E2455@fujitsulixd>
On Wed, 29 Oct 2008, Li Xiaodong wrote:
> According to Documentation/filesystems/proc.txt, kernel should swap one page
> as vm.page-cluster is 0, while it seems not like so in mm/swapfile.c:
> ...
> int our_page_cluster = page_cluster;
> ...
> if (!our_page_cluster) /* no readahead */
> return 0;
> ...
>
> It is better to remove that checkpoint.
No, page_cluster 0 allows swapin one page at a time, but disallows
swapin readahead (better named readaround) i.e. disallows reading
more than the one page actually requested.
Compare with how valid_swaphandles() is used from swapin_readahead():
there's actually one extra call to read_swap_cache_async() - because
we must ignore failure on the readaround but not on the page requested.
That "return 0" avoids the overhead of a pointlessly doubled
read_swap_cache_async() when there's only one page to be read.
Your patch might be needed if you'd found that swapin of one page
was not working at all - but you'd be making a stronger case if
you'd found that, I think!
Hugh
prev parent reply other threads:[~2008-11-01 10:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-29 6:31 [PATCH]swap-zero-page-bug Li Xiaodong
2008-11-01 10:33 ` Hugh Dickins [this message]
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.64.0811011012020.21848@blonde.site \
--to=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lixd@cn.fujitsu.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
all inboxes | Powered by JetHome®