All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
To: Dave Hansen <dave.hansen@intel.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	ben.widawsky@intel.com, alex.shi@linux.alibaba.com,
	dwagner@suse.de, tobin@kernel.org, cl@linux.com,
	akpm@linux-foundation.org, stable@kernel.org
Subject: Re: [PATCH] mm/vmscan: restore zone_reclaim_mode ABI
Date: Tue, 30 Jun 2020 07:30:43 +0800	[thread overview]
Message-ID: <20200629233043.GK3346@MiWiFi-R3L-srv> (raw)
In-Reply-To: <3ba94f19-3b18-9d52-a070-f652620c88e6@intel.com>

On 06/29/20 at 07:27am, Dave Hansen wrote:
> On 6/28/20 11:52 PM, Baoquan He wrote:
> > On 06/25/20 at 05:34pm, Dave Hansen wrote:
> >>
> >> From: Dave Hansen <dave.hansen@linux.intel.com>
> >>
> >> I went to go add a new RECLAIM_* mode for the zone_reclaim_mode
> >> sysctl.  Like a good kernel developer, I also went to go update the
> >> documentation.  I noticed that the bits in the documentation didn't
> >> match the bits in the #defines.
> >>
> >> The VM evidently stopped caring about RECLAIM_ZONE at some point (or
> >> never cared) and the #define itself was later removed as a cleanup.
> > 
> >>From git history, it seems to never care about the RECLAIM_ZONE bit.
> > 
> > I think this patch is justified. I have one question about adding back
> > the RECLAIM_ZONE bit. Since we introduced RECLAIM_ZONE in the first
> > place, but never use it, removing it truly may fail some existing
> > script, does it mean we will never have chance to fix/clean up this kind
> > of mess?
> 
> Our #1 rule is "don't break userspace".  We only break userspace when we
> have no other choice.
> 
> This case a bit fuzzier because we don't know if anyone is depending on
> the ignored bit to do anything.  But, it *was* documented.  To me, that
> means it might have been used, even though it would have been a
> "placebo" bit.
> 
> > Do we have possibility to remove it in mainline tree, let distos or
> > stable kernel maintainer take care of the back porting? Like this, any
> > stable kernel after 5.8, or any distrols which chooses post v5.8 kenrel
> > as base won't have this confusion. I am not objecting this patch, just
> > be curious if we have a way to fix/clean up for this type of issue.
> 
> The only way I can plausibly think of "cleaning up" the RECLAIM_ZONE bit
> would be to raise our confidence that it is truly unused.  That takes
> time, and probably a warning if we see it being set.  If we don't run
> into anybody setting it or depending on it being set in a few years, we
> can remove it.

So adding the old bit back for compatibility looks good, thanks.

Then we have to be very careful when adding and reviewing new
interface introducing, should not leave one which might be used
in the future.

In fact, RECLAIM_ZONE is not completely useless. At least, when the old
bit 0 is set, it may enter into node_reclaim() in get_page_from_freelist(),
that makes it like a switch.

get_page_from_freelist {

	...
                        if (node_reclaim_mode == 0 ||                                                                                             
                            !zone_allows_reclaim(ac->preferred_zoneref->zone, zone))
                                continue;
	...
}


> 
> Backporting a _warning_ into the -stable trees might be an interesting
> way to find users of older kernels mucking with it.
> 


  reply	other threads:[~2020-06-29 23:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-26  0:34 [PATCH] mm/vmscan: restore zone_reclaim_mode ABI Dave Hansen
2020-06-26  0:34 ` Dave Hansen
2020-06-26  7:59 ` Daniel Wagner
2020-06-26 13:53   ` Dave Hansen
2020-06-29  7:13     ` Daniel Wagner
2020-06-29 14:36       ` Dave Hansen
2020-06-29 15:53         ` Daniel Wagner
2020-06-29 16:05           ` Dave Hansen
2020-06-26 19:24 ` Qian Cai
2020-06-26 21:24   ` Dave Hansen
2020-06-29  6:52 ` Baoquan He
2020-06-29 14:27   ` Dave Hansen
2020-06-29 23:30     ` Baoquan He [this message]
2020-06-29 23:37       ` Dave Hansen
2020-07-01  2:47         ` Andrew Morton
2020-07-01 15:27           ` Dave Hansen

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=20200629233043.GK3346@MiWiFi-R3L-srv \
    --to=bhe@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=alex.shi@linux.alibaba.com \
    --cc=ben.widawsky@intel.com \
    --cc=cl@linux.com \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=dwagner@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=stable@kernel.org \
    --cc=tobin@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.