[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2019111513472001709128@gmail.com>
Date: Fri, 15 Nov 2019 13:47:21 +0800
From: "lixinhai.lxh@...il.com" <lixinhai.lxh@...il.com>
To: "Michal Hocko" <mhocko@...nel.org>,
"Ralph Campbell" <rcampbell@...dia.com>
Cc: akpm <akpm@...ux-foundation.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm/debug: PageAnon() is true for PageKsm() pages
On 2019-11-15 at 10:32 lixinhai.lxh wrote:
>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@...dia.com>
>>
>>Acked-by: Michal Hocko <mhocko@...e.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
Looked the reference to PageAnon() again, there are many use of PageAnon() to
cover cases for both Anon without KSM and Anon with KSM. Change PageAnon()
implementation require change those places, so keep this patch for current issue is
enough.
- Xinhai
Powered by blists - more mailing lists