From: Ric Mason <ric.masonn@gmail.com>
To: Hugh Dickins <hughd@google.com>
Cc: Li Haifeng <omycle@gmail.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: Should a swapped out page be deleted from swap cache?
Date: Wed, 20 Feb 2013 08:40:06 +0800 [thread overview]
Message-ID: <51241B66.7080004@gmail.com> (raw)
In-Reply-To: <alpine.LNX.2.00.1302191050330.2248@eggly.anvils>
Hi Hugh,
On 02/20/2013 02:56 AM, Hugh Dickins wrote:
> On Tue, 19 Feb 2013, Ric Mason wrote:
>> There is a call of try_to_free_swap in function swap_writepage, if
>> swap_writepage is call from shrink_page_list path, PageSwapCache(page) ==
>> trure, PageWriteback(page) maybe false, page_swapcount(page) == 0, then will
>> delete the page from swap cache and free swap slot, where I miss?
> That's correct. PageWriteback is sure to be false there. page_swapcount
> usually won't be 0 there, but sometimes it will be, and in that case we
> do want to delete from swap cache and free the swap slot.
1) If PageSwapCache(page) == true, PageWriteback(page) == false,
page_swapcount(page) == 0 in swap_writepage(shrink_page_list path),
then will delete the page from swap cache and free swap slot, in
function swap_writepage:
if (try_to_free_swap(page)) {
unlock_page(page);
goto out;
}
writeback will not execute, that's wrong. Where I miss?
2) In the function pageout, page will be set PG_Reclaim flag, since this
flag is set, end_swap_bio_write->end_page_writeback:
if (TestClearPageReclaim(page))
rotate_reclaimable_page(page);
it means that page will be add to the tail of lru list, page is clean
anonymous page this time and will be reclaim to buddy system soon, correct?
If is correct, what is the meaning of rotate here?
>
> Hugh
--
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:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2013-02-20 0:40 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-18 10:48 Should a swapped out page be deleted from swap cache? Li Haifeng
2013-02-18 18:06 ` Hugh Dickins
2013-02-19 0:39 ` Will Huck
2013-02-19 19:06 ` Hugh Dickins
2013-02-20 0:43 ` Will Huck
2013-02-19 2:04 ` Li Haifeng
2013-02-19 2:38 ` Will Huck
2013-02-19 6:53 ` Li Haifeng
2013-02-19 9:38 ` Sha Zhengju
2013-02-19 18:49 ` Hugh Dickins
2013-02-19 8:32 ` Ric Mason
2013-02-19 18:56 ` Hugh Dickins
2013-02-20 0:40 ` Ric Mason [this message]
2013-03-06 5:34 ` Li Haifeng
2013-03-06 11:04 ` Ric Mason
2013-03-06 11:10 ` Ric Mason
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=51241B66.7080004@gmail.com \
--to=ric.masonn@gmail.com \
--cc=hughd@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=omycle@gmail.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;
as well as URLs for NNTP newsgroup(s).