From: Jaewon Kim <jaewon31.kim@samsung.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: minchan@kernel.org, mgorman@suse.de, m.szyprowski@samsung.com,
mina86@mina86.com, shli@fb.com, akpm@linux-foundation.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
jaewon31.kim@gmail.com, ytk.lee@samsung.com
Subject: Re: [PATCH v2] mm/vmscan: count layzfree pages and fix nr_isolated_* mismatch
Date: Thu, 23 Apr 2020 12:16:02 +0900 [thread overview]
Message-ID: <5EA10872.3010500@samsung.com> (raw)
In-Reply-To: <20200422130751.GD358439@cmpxchg.org>
On 2020년 04월 22일 22:07, Johannes Weiner wrote:
> On Wed, Apr 22, 2020 at 05:48:15PM +0900, Jaewon Kim wrote:
>> @@ -1295,11 +1295,15 @@ static unsigned long shrink_page_list(struct list_head *page_list,
>> */
>> if (page_mapped(page)) {
>> enum ttu_flags flags = ttu_flags | TTU_BATCH_FLUSH;
>> + bool lazyfree = PageAnon(page) && !PageSwapBacked(page);
>>
>> if (unlikely(PageTransHuge(page)))
>> flags |= TTU_SPLIT_HUGE_PMD;
>> +
>> if (!try_to_unmap(page, flags)) {
>> stat->nr_unmap_fail += nr_pages;
>> + if (lazyfree && PageSwapBacked(page))
> This looks pretty strange, until you remember that try_to_unmap()
> could SetPageSwapbacked again.
>
> This might be more obvious?
>
> was_swapbacked = PageSwapBacked(page);
> if (!try_to_unmap(page, flags)) {
> stat->nr_unmap_fail += nr_pages;
> if (!was_swapbacked && PageSwapBacked(page))
Hello Johannes, thank you for your comment.
The name can changed from layzyfree to was_swapbacked.
By the way, did you mean removing PageAnon(page), too? It seems to be OK, though.
>> + stat->nr_lazyfree_fail += nr_pages;
>> goto activate_locked;
> Or at least was_lazyfree.
Sorry but I'm confused.
I think you meant additional comment to previous your comment
rather than you wanted to rename stat->nr_lazyfree_fail to stat->was_lazyfree.
>
>> @@ -1491,8 +1495,8 @@ unsigned long reclaim_clean_pages_from_list(struct zone *zone,
>> .priority = DEF_PRIORITY,
>> .may_unmap = 1,
>> };
>> - struct reclaim_stat dummy_stat;
>> - unsigned long ret;
>> + struct reclaim_stat stat;
>> + unsigned long reclaimed;
> nr_reclaimed would be better.
I will add nr_ prefix on next patch.
>
> I also prefer keeping dummy_stat, since that's still what it is.
This patch uses stat.nr_lazyfree_fail, I do not understand why it is still dummy_stat.
If you want, I will keep dummy_stat, though.
Thank you
Jaewon Kim
>
>
next prev parent reply other threads:[~2020-04-23 3:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20200422084832epcas1p333225f9b6a00c9ce36f5f5d63fe6e3bf@epcas1p3.samsung.com>
2020-04-22 8:48 ` [PATCH v2] mm/vmscan: count layzfree pages and fix nr_isolated_* mismatch Jaewon Kim
2020-04-22 13:07 ` Johannes Weiner
2020-04-23 3:16 ` Jaewon Kim [this message]
2020-04-23 16:05 ` Johannes Weiner
2020-04-23 20:00 ` Minchan Kim
2020-04-24 4:16 ` Jaewon Kim
2020-04-24 13:17 ` Johannes Weiner
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=5EA10872.3010500@samsung.com \
--to=jaewon31.kim@samsung.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=jaewon31.kim@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=m.szyprowski@samsung.com \
--cc=mgorman@suse.de \
--cc=mina86@mina86.com \
--cc=minchan@kernel.org \
--cc=shli@fb.com \
--cc=ytk.lee@samsung.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).