From: Vito Caputo <vcaputo@pengaru.com>
To: Hussam Al-Tayeb <hussam.altayeb@gmx.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Excessive swapping under Linux 4.14.91 (no issues in 4.14.90).
Date: Thu, 3 Jan 2019 12:59:24 -0800 [thread overview]
Message-ID: <20190103205924.6vuwkckwcyl3ftzu@shells.gnugeneration.com> (raw)
In-Reply-To: <trinity-b73f6e19-14f4-412b-91c2-49cf09b13afd-1546547589300@3c-app-mailcom-bs02>
On Thu, Jan 03, 2019 at 09:33:09PM +0100, Hussam Al-Tayeb wrote:
> > Sent: Thursday, January 03, 2019 at 10:12 PM
> > From: "Vito Caputo" <vcaputo@pengaru.com>
> > To: "Hussam Al-Tayeb" <hussam.altayeb@gmx.com>
> > Subject: Re: Excessive swapping under Linux 4.14.91 (no issues in 4.14.90).
> >
> >
> > The diff between 4.14.90 and 4.14.91 is rather small, appended below is
> > the entire shortlog.
> >
> > There's only mm one commit:
> >
> > > commit 36f93a2e7dce0a4f58b96a7ecb3af4e5897a60d4
> > > Author: Roman Gushchin <guro@fb.com>
> > > Date: Fri Oct 26 15:03:27 2018 -0700
> > >
> > > mm: don't miss the last page because of round-off error
> > >
> > > commit 68600f623d69da428c6163275f97ca126e1a8ec5 upstream.
> > >
> > > I've noticed, that dying memory cgroups are often pinned in memory by a
> > > single pagecache page. Even under moderate memory pressure they sometimes
> > > stayed in such state for a long time. That looked strange.
> > >
> > > My investigation showed that the problem is caused by applying the LRU
> > > pressure balancing math:
> > >
> > > scan = div64_u64(scan * fraction[lru], denominator),
> > >
> > > where
> > >
> > > denominator = fraction[anon] + fraction[file] + 1.
> > >
> > > Because fraction[lru] is always less than denominator, if the initial scan
> > > size is 1, the result is always 0.
> > >
> > > This means the last page is not scanned and has
> > > no chances to be reclaimed.
> > >
> > > Fix this by rounding up the result of the division.
> > >
> > > In practice this change significantly improves the speed of dying cgroups
> > > reclaim.
> > >
> > > [guro@fb.com: prevent double calculation of DIV64_U64_ROUND_UP() arguments]
> > > Link: http://lkml.kernel.org/r/20180829213311.GA13501@castle
> > > Link: http://lkml.kernel.org/r/20180827162621.30187-3-guro@fb.com
> > > Signed-off-by: Roman Gushchin <guro@fb.com>
> > > Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
> > > Cc: Johannes Weiner <hannes@cmpxchg.org>
> > > Cc: Michal Hocko <mhocko@kernel.org>
> > > Cc: Tejun Heo <tj@kernel.org>
> > > Cc: Rik van Riel <riel@surriel.com>
> > > Cc: Konstantin Khlebnikov <koct9i@gmail.com>
> > > Cc: Matthew Wilcox <willy@infradead.org>
> > > Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> > > Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
> > > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >
> > If you're up for compiling a kernel, you could try reverting just
> > 36f93a2e from 4.14.91 and seeing if your problem goes away.
> >
> > Regards,
> > Vito Caputo
>
> I will do that. Thank you.
I just realized I didn't include lkml in replying to you, so I'm adding
them now for posterity. Please include the list in any further
discussion.
Regards,
Vito Caputo
prev parent reply other threads:[~2019-01-03 21:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-03 19:49 Hussam Al-Tayeb
[not found] ` <20190103201214.fuwn55e6o4kwraw3@shells.gnugeneration.com>
[not found] ` <trinity-b73f6e19-14f4-412b-91c2-49cf09b13afd-1546547589300@3c-app-mailcom-bs02>
2019-01-03 20:59 ` Vito Caputo [this message]
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=20190103205924.6vuwkckwcyl3ftzu@shells.gnugeneration.com \
--to=vcaputo@pengaru.com \
--cc=hussam.altayeb@gmx.com \
--cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®