linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: gaoxu <gaoxu2@honor.com>
To: Barry Song <21cnbao@gmail.com>, David Hildenbrand <david@redhat.com>
Cc: "akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"mhocko@suse.com" <mhocko@suse.com>,
	"hailong.liu@oppo.com" <hailong.liu@oppo.com>,
	"kaleshsingh@google.com" <kaleshsingh@google.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"lokeshgidra@google.com" <lokeshgidra@google.com>,
	"ngeoffray@google.com" <ngeoffray@google.com>,
	"shli@fb.com" <shli@fb.com>,
	"surenb@google.com" <surenb@google.com>,
	"yuzhao@google.com" <yuzhao@google.com>,
	"minchan@kernel.org" <minchan@kernel.org>,
	Barry Song <v-songbaohua@oppo.com>
Subject: 回复: [PATCH RFC] mm: mglru: provide a separate list for lazyfree anon folios
Date: Tue, 15 Oct 2024 10:03:11 +0000	[thread overview]
Message-ID: <7dcd3446cd8c4da69242e5d6680c1429@honor.com> (raw)
In-Reply-To: <CAGsJ_4zdqXtvUS8fHzUhM=iGrPpC8X7uw8wt4sSfCvsrh7um3w@mail.gmail.com>

> 
> On Wed, Sep 18, 2024 at 12:02 AM David Hildenbrand <david@redhat.com>
> wrote:
> >
> > On 14.09.24 08:37, Barry Song wrote:
> > > From: Barry Song <v-songbaohua@oppo.com>
> > >
> > > This follows up on the discussion regarding Gaoxu's work[1]. It's
> > > unclear if there's still interest in implementing a separate LRU
> > > list for lazyfree folios, but I decided to explore it out of
> > > curiosity.
> > >
> > > According to Lokesh, MADV_FREE'd anon folios are expected to be
> > > released earlier than file folios. One option, as implemented by Gao
> > > Xu, is to place lazyfree anon folios at the tail of the file's
> > > `min_seq` generation. However, this approach results in lazyfree
> > > folios being released in a LIFO manner, which conflicts with LRU
> > > behavior, as noted by Michal.
> > >
> > > To address this, this patch proposes maintaining a separate list for
> > > lazyfree anon folios while keeping them classified under the "file"
> > > LRU type to minimize code changes. These lazyfree anon folios will
> > > still be counted as file folios and share the same generation with
> > > regular files. In the eviction path, the lazyfree list will be
> > > prioritized for scanning before the actual file LRU list.
> > >
> >
> > What's the downside of another LRU list? Do we have any experience on that?
> 
> Essentially, the goal is to address the downsides of using a single LRU list for files
> and lazyfree anonymous pages - seriously more files re-faults.
> 
> I'm not entirely clear on the downsides of having an additional LRU list. While it
> does increase complexity, it doesn't seem to be significant.
> 
> Let's wait for Gaoxu's test results before deciding on the next steps.
> I was just
> curious about how difficult it would be to add a separate list, so I took two hours
> to explore it :-)
Hi song,
I'm very sorry, various reasons combined have caused the delay in the results.

Basic version:android V (enable Android ART use MADV_FREE)
Test cases: 60 apps repeatedly restarted, tested for 8 hours;
The test results are as follows:
        workingset_refault_anon   workingset_refault_file
base        42016805                92010542
patch       19834873                49383572
% diff       -52.79%                  -46.33%

Additionally, a comparative test was conducted on
add-lazyfree-folio-to-lru-tail.patch[1], and the results are as follows:
               workingset_refault_anon   workingset_refault_file
lazyfree-tail        20313395                 52203061
patch             19834873                 49383572
% diff              -2.36%                    -5.40%

From the results, it can be seen that this patch is very beneficial and
better than the results in [1]; it can solve the performance issue of high
IO caused by extensive use of MADV_FREE on the Android platform.

Test case notes: There is a discrepancy between the test results mentioned in
[1] and the current test results because the test cases are different. The test
case used in [1] involves actions such as clicking and swiping within the app
after it starts; For the sake of convenience and result stability, the current
test case only involves app startup without clicking and swiping, and the number
of apps has been increased (30->60).

1. https://lore.kernel.org/all/f29f64e29c08427b95e3df30a5770056@honor.com/T/#u
> 
> >
> > --
> > Cheers,
> >
> > David / dhildenb
> >
> 
> Thanks
> Barry

  parent reply	other threads:[~2024-10-15 10:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-14  6:37 Barry Song
2024-09-15  0:58 ` wang wei
2024-10-16  2:54   ` Barry Song
2024-09-17 12:02 ` David Hildenbrand
2024-09-20  1:23   ` Barry Song
2024-09-23 22:19     ` Minchan Kim
2024-09-23 22:38       ` Barry Song
2024-09-24 20:12         ` Minchan Kim
2024-10-15 10:03     ` gaoxu [this message]
2024-10-15 20:10       ` Barry Song
2024-10-16  1:25         ` 回复: " gaoxu
2024-09-18  6:19 ` gaoxu
2024-09-20  1:17   ` Barry Song

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=7dcd3446cd8c4da69242e5d6680c1429@honor.com \
    --to=gaoxu2@honor.com \
    --cc=21cnbao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=hailong.liu@oppo.com \
    --cc=kaleshsingh@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lokeshgidra@google.com \
    --cc=mhocko@suse.com \
    --cc=minchan@kernel.org \
    --cc=ngeoffray@google.com \
    --cc=shli@fb.com \
    --cc=surenb@google.com \
    --cc=v-songbaohua@oppo.com \
    --cc=yuzhao@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