From: Johannes Weiner <hannes@cmpxchg.org>
To: Vladimir Davydov <vdavydov@virtuozzo.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Michal Hocko <mhocko@kernel.org>,
Vlastimil Babka <vbabka@suse.cz>,
Mel Gorman <mgorman@techsingularity.net>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] vmscan: do not force-scan file lru if its absolute size is small
Date: Fri, 20 Nov 2015 13:37:07 -0500 [thread overview]
Message-ID: <20151120183707.GA5623@cmpxchg.org> (raw)
In-Reply-To: <1448038976-28796-1-git-send-email-vdavydov@virtuozzo.com>
On Fri, Nov 20, 2015 at 08:02:56PM +0300, Vladimir Davydov wrote:
> We assume there is enough inactive page cache if the size of inactive
> file lru is greater than the size of active file lru, in which case we
> force-scan file lru ignoring anonymous pages. While this logic works
> fine when there are plenty of page cache pages, it fails if the size of
> file lru is small (several MB): in this case (lru_size >> prio) will be
> 0 for normal scan priorities, as a result, if inactive file lru happens
> to be larger than active file lru, anonymous pages of a cgroup will
> never get evicted unless the system experiences severe memory pressure,
> even if there are gigabytes of unused anonymous memory there, which is
> unfair in respect to other cgroups, whose workloads might be page cache
> oriented.
>
> This patch attempts to fix this by elaborating the "enough inactive page
> cache" check: it makes it not only check that inactive lru size > active
> lru size, but also that we will scan something from the cgroup at the
> current scan priority. If these conditions do not hold, we proceed to
> SCAN_FRACT as usual.
>
> Signed-off-by: Vladimir Davydov <vdavydov@virtuozzo.com>
This makes sense, the inactive:active ratio of the file list alone
does not give the full picture to decide whether to skip anonymous.
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
> @@ -2046,7 +2046,8 @@ static void get_scan_count(struct lruvec *lruvec, int swappiness,
> * There is enough inactive page cache, do not reclaim
> * anything from the anonymous working set right now.
> */
> - if (!inactive_file_is_low(lruvec)) {
> + if (!inactive_file_is_low(lruvec) &&
> + get_lru_size(lruvec, LRU_INACTIVE_FILE) >> sc->priority > 0) {
The > 0 seems unnecessary, no? There are too many > in this line :-)
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2015-11-20 18:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-20 17:02 Vladimir Davydov
2015-11-20 18:37 ` Johannes Weiner [this message]
2015-11-20 21:43 ` Andrew Morton
2015-11-23 10:39 ` [PATCH v2] " Vladimir Davydov
2015-11-23 12:15 ` Michal Hocko
2015-11-23 16:30 ` Johannes Weiner
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=20151120183707.GA5623@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mhocko@kernel.org \
--cc=vbabka@suse.cz \
--cc=vdavydov@virtuozzo.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