From: Roman Gushchin <guro@fb.com>
To: Sasha Levin <sashal@kernel.org>
Cc: Greg KH <greg@kroah.com>, Michal Hocko <mhocko@kernel.org>,
Dexuan Cui <decui@microsoft.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Kernel Team <Kernel-team@fb.com>,
Shakeel Butt <shakeelb@google.com>,
Johannes Weiner <hannes@cmpxchg.org>, Tejun Heo <tj@kernel.org>,
Rik van Riel <riel@surriel.com>,
Konstantin Khlebnikov <koct9i@gmail.com>,
Matthew Wilcox <willy@infradead.org>,
"Stable@vger.kernel.org" <Stable@vger.kernel.org>
Subject: Re: Will the recent memory leak fixes be backported to longterm kernels?
Date: Wed, 30 Jan 2019 05:58:42 +0000 [thread overview]
Message-ID: <20190130055834.GC2107@castle.DHCP.thefacebook.com> (raw)
In-Reply-To: <20190130002356.GQ3973@sasha-vm>
On Tue, Jan 29, 2019 at 07:23:56PM -0500, Sasha Levin wrote:
> On Fri, Dec 28, 2018 at 11:50:08AM +0100, Greg KH wrote:
> > On Mon, Nov 05, 2018 at 10:21:23AM +0100, Michal Hocko wrote:
> > > On Fri 02-11-18 19:38:35, Roman Gushchin wrote:
> > > > On Fri, Nov 02, 2018 at 06:48:23PM +0100, Michal Hocko wrote:
> > > > > On Fri 02-11-18 17:25:58, Roman Gushchin wrote:
> > > > > > On Fri, Nov 02, 2018 at 05:51:47PM +0100, Michal Hocko wrote:
> > > > > > > On Fri 02-11-18 16:22:41, Roman Gushchin wrote:
> > > > > [...]
> > > > > > > > 2) We do forget to scan the last page in the LRU list. So if we ended up with
> > > > > > > > 1-page long LRU, it can stay there basically forever.
> > > > > > >
> > > > > > > Why
> > > > > > > /*
> > > > > > > * If the cgroup's already been deleted, make sure to
> > > > > > > * scrape out the remaining cache.
> > > > > > > */
> > > > > > > if (!scan && !mem_cgroup_online(memcg))
> > > > > > > scan = min(size, SWAP_CLUSTER_MAX);
> > > > > > >
> > > > > > > in get_scan_count doesn't work for that case?
> > > > > >
> > > > > > No, it doesn't. Let's look at the whole picture:
> > > > > >
> > > > > > size = lruvec_lru_size(lruvec, lru, sc->reclaim_idx);
> > > > > > scan = size >> sc->priority;
> > > > > > /*
> > > > > > * If the cgroup's already been deleted, make sure to
> > > > > > * scrape out the remaining cache.
> > > > > > */
> > > > > > if (!scan && !mem_cgroup_online(memcg))
> > > > > > scan = min(size, SWAP_CLUSTER_MAX);
> > > > > >
> > > > > > If size == 1, scan == 0 => scan = min(1, 32) == 1.
> > > > > > And after proportional adjustment we'll have 0.
> > > > >
> > > > > My friday brain hurst when looking at this but if it doesn't work as
> > > > > advertized then it should be fixed. I do not see any of your patches to
> > > > > touch this logic so how come it would work after them applied?
> > > >
> > > > This part works as expected. But the following
> > > > scan = div64_u64(scan * fraction[file], denominator);
> > > > reliable turns 1 page to scan to 0 pages to scan.
> > >
> > > OK, 68600f623d69 ("mm: don't miss the last page because of round-off
> > > error") sounds like a good and safe stable backport material.
> >
> > Thanks for this, now queued up.
> >
> > greg k-h
>
> It seems that 172b06c32b949 ("mm: slowly shrink slabs with a relatively
> small number of objects") and a76cf1a474d ("mm: don't reclaim inodes
> with many attached pages") cause a regression reported against the 4.19
> stable tree: https://bugzilla.kernel.org/show_bug.cgi?id=202441 .
>
> Given the history and complexity of these (and other patches from that
> series) it would be nice to understand if this is something that will be
> fixed soon or should we look into reverting the series for now?
In that thread I've just suggested to give a chance to Rik's patch, which
hopefully will mitigate or easy the regression (
https://lkml.org/lkml/2019/1/28/1865 ).
Of course, we can simple revert those changes, but this will re-introduce
the memory leak, so I'd leave it as a last option.
Thanks!
next prev parent reply other threads:[~2019-01-30 5:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-02 0:16 Will the recent memory leak fixes be backported to longterm kernels? Dexuan Cui
2018-11-02 0:45 ` Sasha Levin
2018-11-02 0:58 ` Roman Gushchin
2018-11-02 2:45 ` Dexuan Cui
2018-11-02 3:16 ` Roman Gushchin
2018-11-02 8:03 ` Michal Hocko
2018-11-02 15:48 ` Roman Gushchin
2018-11-02 16:13 ` Michal Hocko
2018-11-02 16:22 ` Roman Gushchin
2018-11-02 16:51 ` Michal Hocko
2018-11-02 17:25 ` Roman Gushchin
2018-11-02 17:48 ` Michal Hocko
2018-11-02 19:38 ` Roman Gushchin
2018-11-05 9:21 ` Michal Hocko
2018-12-28 10:50 ` Greg KH
2019-01-30 0:23 ` Sasha Levin
2019-01-30 5:58 ` Roman Gushchin [this message]
2018-11-02 16:01 ` Sasha Levin
2018-11-04 9:16 ` Mike Rapoport
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=20190130055834.GC2107@castle.DHCP.thefacebook.com \
--to=guro@fb.com \
--cc=Kernel-team@fb.com \
--cc=Stable@vger.kernel.org \
--cc=decui@microsoft.com \
--cc=greg@kroah.com \
--cc=hannes@cmpxchg.org \
--cc=koct9i@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=riel@surriel.com \
--cc=sashal@kernel.org \
--cc=shakeelb@google.com \
--cc=tj@kernel.org \
--cc=willy@infradead.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 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).