From: Vlastimil Babka <vbabka@suse.cz>
To: Adam Jackson <ajax@redhat.com>, linux-mm@kvack.org
Cc: Johannes Weiner <hannes@cmpxchg.org>,
Shakeel Butt <shakeelb@google.com>, Roman Gushchin <guro@fb.com>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
Michal Hocko <mhocko@kernel.org>,
Mel Gorman <mgorman@techsingularity.net>
Subject: Re: [PATCH] mm/vmscan: Prioritize anonymous executable pages like we do file-backed
Date: Thu, 5 Mar 2020 13:47:54 +0100 [thread overview]
Message-ID: <8b8420f9-12bc-b247-7727-f82038ffa6e7@suse.cz> (raw)
In-Reply-To: <20200304203235.3623103-1-ajax@redhat.com>
+ CC folks who focus on reclaim
On 3/4/20 9:32 PM, Adam Jackson wrote:
> The page reclamation scanner tries to keep executable pages resident,
> since taking a hard page fault to satisfy an icache miss is really not
> great for interactivity. Anonymous executable pages tend to contain
> code that has been just-in-time compiled for performance reasons. By
> requiring that executable pages be file-backed, we're putting possibly
> the most performance-sensitive code at higher risk of eviction, which
> seems backwards.
>
> On an amd64 machine running Fedora 31, the firefox I happen to have
> running requires about 89M of file-backed text and 12M of anonymous text
> for 30 open tabs. The next largest process in terms of anonymous text is
> gnome-shell, with 1M anonymous and 57M file-backed. No other process had
> significant anonymous text, most had none. Penalizing those 13M
> specifically when under memory pressure seems like an easy hazard to
> avoid.
>
> Signed-off-by: Adam Jackson <ajax@redhat.com>
> ---
> mm/vmscan.c | 11 ++++-------
> 1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index ee4eecc7e1c2..9bfbc30d61d8 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -2095,15 +2095,12 @@ static void shrink_active_list(unsigned long nr_to_scan,
> &vm_flags)) {
> nr_rotated += hpage_nr_pages(page);
> /*
> - * Identify referenced, file-backed active pages and
> - * give them one more trip around the active list. So
> + * Identify referenced, executable active pages and
> + * give them one more trip around the active list, so
> * that executable code get better chances to stay in
> - * memory under moderate memory pressure. Anon pages
> - * are not likely to be evicted by use-once streaming
> - * IO, plus JVM can create lots of anon VM_EXEC pages,
> - * so we ignore them here.
> + * memory under moderate memory pressure.
> */
> - if ((vm_flags & VM_EXEC) && page_is_file_cache(page)) {
> + if ((vm_flags & VM_EXEC)) {
> list_add(&page->lru, &l_active);
> continue;
> }
>
next prev parent reply other threads:[~2020-03-05 12:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-04 20:32 Adam Jackson
2020-03-04 20:38 ` Matthew Wilcox
2020-03-05 12:47 ` Vlastimil Babka [this message]
2020-03-05 20:41 ` Shakeel Butt
2020-03-05 22:58 ` Adam Jackson
2020-03-06 9:22 ` Mel Gorman
2020-03-05 15:17 ` Michal Hocko
2020-03-05 18:05 ` Adam Jackson
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=8b8420f9-12bc-b247-7727-f82038ffa6e7@suse.cz \
--to=vbabka@suse.cz \
--cc=ajax@redhat.com \
--cc=guro@fb.com \
--cc=hannes@cmpxchg.org \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mhocko@kernel.org \
--cc=shakeelb@google.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