From: "lixinhai.lxh@gmail.com" <lixinhai.lxh@gmail.com>
To: "Michal Hocko" <mhocko@kernel.org>,
"Ralph Campbell" <rcampbell@nvidia.com>
Cc: akpm <akpm@linux-foundation.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm/debug: PageAnon() is true for PageKsm() pages
Date: Fri, 15 Nov 2019 10:32:07 +0800 [thread overview]
Message-ID: <2019111510320597353014@gmail.com> (raw)
In-Reply-To: <20191114135948.GB1356@dhcp22.suse.cz>
On 2019-11-14 at 21:59 Michal Hocko wrote:
>On Tue 12-11-19 16:06:51, Ralph Campbell wrote:
>> PageAnon() and PageKsm() use the low two bits of the page->mapping pointer
>> to indicate the page type. PageAnon() only checks the LSB while PageKsm()
>> checks the least significant 2 bits are equal to 3. Therefore, PageAnon()
>> is true for KSM pages.
>> __dump_page() incorrectly will never print "ksm" because it checks
>> PageAnon() first. Fix this by checking PageKsm() first.
>
>Thanks for spotting this
>
>Fixes: 1c6fb1d89e73 ("mm: print more information about mapping in __dump_page")
>
>> Signed-off-by: Ralph Campbell <rcampbell@nvidia.com>
>
>Acked-by: Michal Hocko <mhocko@suse.com>
>
The four values from those two lowest bits have different meaning, so PageKsm is
true does not mean we can consider PageAnon is also true or PageMovable is also
true.
Improve PageAnon() would be better, so users of those APIs do not need to
remember this implict checking sequence at other places.
- Xinhai
next prev parent reply other threads:[~2019-11-15 2:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-13 0:06 Ralph Campbell
2019-11-14 13:59 ` Michal Hocko
2019-11-15 2:32 ` lixinhai.lxh [this message]
2019-11-15 5:47 ` lixinhai.lxh
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=2019111510320597353014@gmail.com \
--to=lixinhai.lxh@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=rcampbell@nvidia.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