linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Suren Baghdasaryan <surenb@google.com>
To: Pavan Kondeti <quic_pkondeti@quicinc.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org,  linux-kernel@vger.kernel.org,
	Minchan Kim <minchan@kernel.org>,
	 Charan Teja Kalla <quic_charante@quicinc.com>,
	Prakash Gupta <quic_guptap@quicinc.com>,
	 Divyanand Rangu <quic_drangu@quicinc.com>
Subject: Re: [PATCH] mm/madvise: fix madvise_pageout for private file mappings
Date: Thu, 1 Dec 2022 11:51:12 -0800	[thread overview]
Message-ID: <CAJuCfpGvKN8kY-+DPf5W4Lc1vXEgmmQ=JgbYqz6Cnvkv5QFSLA@mail.gmail.com> (raw)
In-Reply-To: <20221201030045.GB3980@hu-pkondeti-hyd.qualcomm.com>

On Wed, Nov 30, 2022 at 7:00 PM Pavan Kondeti <quic_pkondeti@quicinc.com> wrote:
>
> On Wed, Nov 30, 2022 at 03:17:39PM -0800, Andrew Morton wrote:
> >
> > On Wed, 9 Nov 2022 10:48:36 +0530 Pavankumar Kondeti <quic_pkondeti@quicinc.com> wrote:
> >
> > > When MADV_PAGEOUT is called on a private file mapping VMA region,
> > > we bail out early if the process is neither owner nor write capable
> > > of the file. However, this VMA may have both private/shared clean
> > > pages and private dirty pages. The opportunity of paging out the
> > > private dirty pages (Anon pages) is missed. Fix this by caching
> > > the file access check and use it later along with PageAnon() during
> > > page walk.
> > >
> > > We observe ~10% improvement in zram usage, thus leaving more available
> > > memory on a 4GB RAM system running Android.
> > >
> >
> > Could we please have some reviewer input on this?
> >
> > Thanks.
> >
>
> Thanks Andrew for the reminder. Fyi, this patch has been included in Android
> Generic Kernel Image (5.10 and 5.15 kernels) as we have seen good savings on
> Android. It would make a difference on a low memory android devices.
>
> Suren/Minchan,
>
> Can you please do the needful?

Yeah, I saw this patch before and it makes sense to me.
When discussing it with Minchan one concern was that if the vma has no
private dirty pages then we will be wasting cpu cycles scanning it.
However I guess it's the choice of the userspace process to call
madvise() on such mappings and risk wasting some cycles...

>
> Thanks,
> Pavan


  reply	other threads:[~2022-12-01 19:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09  5:18 Pavankumar Kondeti
2022-11-30 23:17 ` Andrew Morton
2022-12-01  3:00   ` Pavan Kondeti
2022-12-01 19:51     ` Suren Baghdasaryan [this message]
2022-12-01 13:01 ` David Hildenbrand
2022-12-01 13:36   ` Pavan Kondeti
2022-12-01 13:46 ` Mark Hemment
2022-12-01 14:17   ` Pavan Kondeti

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='CAJuCfpGvKN8kY-+DPf5W4Lc1vXEgmmQ=JgbYqz6Cnvkv5QFSLA@mail.gmail.com' \
    --to=surenb@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=quic_charante@quicinc.com \
    --cc=quic_drangu@quicinc.com \
    --cc=quic_guptap@quicinc.com \
    --cc=quic_pkondeti@quicinc.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