From: Pavan Kondeti <quic_pkondeti@quicinc.com>
To: David Hildenbrand <david@redhat.com>
Cc: Pavankumar Kondeti <quic_pkondeti@quicinc.com>,
Andrew Morton <akpm@linux-foundation.org>, <linux-mm@kvack.org>,
<linux-kernel@vger.kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
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 19:06:37 +0530 [thread overview]
Message-ID: <20221201133637.GC3980@hu-pkondeti-hyd.qualcomm.com> (raw)
In-Reply-To: <906b0150-ef7c-d2b9-783f-4e94c48fa367@redhat.com>
Hi David,
Thanks for your review.
On Thu, Dec 01, 2022 at 02:01:22PM +0100, David Hildenbrand wrote:
> >+ * If the VMA belongs to a private file mapping, there can be private
> >+ * dirty pages which can be paged out if even this process is neither
> >+ * owner nor write capable of the file. Cache the file access check
> >+ * here and use it later during page walk.
> >+ */
> >+ can_pageout_file = can_do_file_pageout(vma);
>
> Why not move that into madvise_pageout_page_range() ? Avoids passing this
> variable to that function.
>
Silly me. I should have done that in the first place.
> In fact, why not even call that function directly instead of storing that in
> madvise_walk_private(). The function is extremely lightweight.
Agreed. I will incorporate your suggestion and send the patch after testing.
>
> > lru_add_drain();
> > tlb_gather_mmu(&tlb, mm);
> >- madvise_pageout_page_range(&tlb, vma, start_addr, end_addr);
> >+ madvise_pageout_page_range(&tlb, vma, start_addr, end_addr, can_pageout_file);
> > tlb_finish_mmu(&tlb);
> > return 0;
>
Thanks,
Pavan
next prev parent reply other threads:[~2022-12-01 13:36 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
2022-12-01 13:01 ` David Hildenbrand
2022-12-01 13:36 ` Pavan Kondeti [this message]
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=20221201133637.GC3980@hu-pkondeti-hyd.qualcomm.com \
--to=quic_pkondeti@quicinc.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--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=surenb@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