[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMZfGtUaSsfjf4HSCsHMHFNxVaGrTXjVqE5iExM8JkMJPx169g@mail.gmail.com>
Date: Tue, 27 Jul 2021 15:06:28 +0800
From: Muchun Song <songmuchun@...edance.com>
To: Mike Kravetz <mike.kravetz@...cle.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Oscar Salvador <osalvador@...e.de>,
Michal Hocko <mhocko@...e.com>,
"Song Bao Hua (Barry Song)" <song.bao.hua@...ilicon.com>,
David Hildenbrand <david@...hat.com>,
Chen Huang <chenhuang5@...wei.com>,
"Bodeddula, Balasubramaniam" <bodeddub@...zon.com>,
Jonathan Corbet <corbet@....net>,
Xiongchun duan <duanxiongchun@...edance.com>,
fam.zheng@...edance.com, linux-doc@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>,
Linux Memory Management List <linux-mm@...ck.org>,
Qi Zheng <zhengqi.arch@...edance.com>
Subject: Re: [PATCH 2/5] mm: introduce save_page_flags to cooperate with show_page_flags
On Tue, Jul 27, 2021 at 7:18 AM Mike Kravetz <mike.kravetz@...cle.com> wrote:
>
> On 7/14/21 2:17 AM, Muchun Song wrote:
> > Introduce save_page_flags to return the page flags which can cooperate
> > with show_page_flags. If we want to hihe some page flags from users, it
> > will be useful to alter save_page_flags directly. This is a preparation
> > for the next patch to hide some page flags from users.
> >
> > Signed-off-by: Muchun Song <songmuchun@...edance.com>
> > ---
> > include/trace/events/mmflags.h | 3 +++
> > include/trace/events/page_ref.h | 8 ++++----
> > 2 files changed, 7 insertions(+), 4 deletions(-)
> >
> > diff --git a/include/trace/events/mmflags.h b/include/trace/events/mmflags.h
> > index 390270e00a1d..69cb84b1257e 100644
> > --- a/include/trace/events/mmflags.h
> > +++ b/include/trace/events/mmflags.h
> > @@ -121,6 +121,9 @@ IF_HAVE_PG_IDLE(PG_idle, "idle" ) \
> > IF_HAVE_PG_ARCH_2(PG_arch_2, "arch_2" ) \
> > IF_HAVE_PG_SKIP_KASAN_POISON(PG_skip_kasan_poison, "skip_kasan_poison")
> >
> > +#define save_page_flags(page) \
> > + (((page)->flags & ~PAGEFLAGS_MASK))
> > +
>
> Looking ahead to the next patch, this is changed to hide the PG_head
> flag for 'fake' head pages.
>
> IIRC, all vmemmap pages except the first will be mapped read only. So,
> all vmemmap pages with 'fake' head pages will be read only.
>
> It seems that all the modified trace events below are associated with
> updates to page structs. Therefore, it seems these events will never
> experience a 'fake' head page. Am I missing something?
Totally right. I didn't realize this point before. We cannot see a fake page
struct in page refcount tracing. So this patch is definitely pointless. I'll
drop it in the next version. Thanks Mike.
>
> --
> Mike Kravetz
Powered by blists - more mailing lists