From: David Rientjes <rientjes@google.com>
To: David Hildenbrand <david@redhat.com>
Cc: "Huang, Ying" <ying.huang@intel.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Dave Hansen <dave.hansen@linux.intel.com>,
Mel Gorman <mgorman@suse.de>, Vlastimil Babka <vbabka@suse.cz>,
Zi Yan <ziy@nvidia.com>, Michal Hocko <mhocko@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Minchan Kim <minchan@kernel.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Hugh Dickins <hughd@google.com>
Subject: Re: [PATCH -V3] mm: Add PageLayzyFree() helper functions for MADV_FREE
Date: Mon, 9 Mar 2020 17:45:53 -0700 (PDT) [thread overview]
Message-ID: <alpine.DEB.2.21.2003091745340.156701@chino.kir.corp.google.com> (raw)
In-Reply-To: <23076072-7875-cabf-768f-ce27cba3480d@redhat.com>
On Mon, 9 Mar 2020, David Hildenbrand wrote:
> >> I still prefer something like
> >>
> >> diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
> >> index fd6d4670ccc3..7538501230bd 100644
> >> --- a/include/linux/page-flags.h
> >> +++ b/include/linux/page-flags.h
> >> @@ -63,6 +63,10 @@
> >> * page_waitqueue(page) is a wait queue of all tasks waiting for the page
> >> * to become unlocked.
> >> *
> >> + * PG_swapbacked used with anonymous pages (PageAnon()) indicates that a
> >> + * page is backed by swap. Anonymous pages without PG_swapbacked are
> >> + * pages that can be lazily freed (e.g., MADV_FREE) on demand.
> >> + *
> >> * PG_uptodate tells whether the page's contents is valid. When a read
> >> * completes, the page becomes uptodate, unless a disk I/O error happened.
> >> *
> >
> > Why not just send a formal patch? So Andrew can just pick anything he
> > likes. I am totally OK with that.
>
> Because you're working on cleaning this up.
>
> >
> >> and really don't like the use of !__PageLazyFree() instead of PageSwapBacked().
> >
> > If adopted, !__PageLazyFree() should only be used in the context where
> > we really want to check whether pages are freed lazily. Otherwise,
> > PageSwapBacked() should be used.
> >
>
> Yeah, and once again, personally, I don't like this approach. E.g.,
> ClearPageLazyFree() sets PG_swapbacked. You already have to be aware
> that this is a single flag being used in the background and what the
> implications are. IMHO, in no way better than the current approach. I
> prefer better documentation instead.
>
Fully agreed.
next prev parent reply other threads:[~2020-03-10 0:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-09 2:17 [PATCH -V3] mm: Add PageLayzyFree() helper functions for MADV_FREE Huang, Ying
2020-03-09 8:55 ` David Hildenbrand
2020-03-09 9:15 ` Huang, Ying
2020-03-09 9:21 ` David Hildenbrand
2020-03-10 0:45 ` David Rientjes [this message]
2020-03-09 12:13 ` Michal Hocko
2020-03-10 2:28 ` Huang, Ying
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=alpine.DEB.2.21.2003091745340.156701@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=akpm@linux-foundation.org \
--cc=dave.hansen@linux.intel.com \
--cc=david@redhat.com \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mhocko@kernel.org \
--cc=minchan@kernel.org \
--cc=peterz@infradead.org \
--cc=vbabka@suse.cz \
--cc=ying.huang@intel.com \
--cc=ziy@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;
as well as URLs for NNTP newsgroup(s).