linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Shakeel Butt <shakeelb@google.com>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Adam Jackson <ajax@redhat.com>, Linux MM <linux-mm@kvack.org>,
	 Johannes Weiner <hannes@cmpxchg.org>,
	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 12:41:14 -0800	[thread overview]
Message-ID: <CALvZod4zjKkktMvqNr_=eZ27jofkhQidHvyoRzo89fGirCdCvg@mail.gmail.com> (raw)
In-Reply-To: <8b8420f9-12bc-b247-7727-f82038ffa6e7@suse.cz>

On Thu, Mar 5, 2020 at 4:47 AM Vlastimil Babka <vbabka@suse.cz> wrote:
>
> + 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.

Have you actually seen this issue (i.e. JIT code reclaimed and
thrashing) happening for real workloads?

> >
> > 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)) {

Originally this heuristic was added to protect executable file pages
from the streaming workloads. Now we have workingset detection for
file pages and there is ongoing work for adding that support for anon
pages, I am wondering if this specific heuristic is still helpful.

> > +                     if ((vm_flags & VM_EXEC)) {
> >                               list_add(&page->lru, &l_active);
> >                               continue;
> >                       }
> >
>


  reply	other threads:[~2020-03-05 20:41 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
2020-03-05 20:41   ` Shakeel Butt [this message]
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='CALvZod4zjKkktMvqNr_=eZ27jofkhQidHvyoRzo89fGirCdCvg@mail.gmail.com' \
    --to=shakeelb@google.com \
    --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=vbabka@suse.cz \
    /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