From: Hugh Dickins <hughd@google.com>
To: Charan Teja Kalla <quic_charante@quicinc.com>
Cc: Hugh Dickins <hughd@google.com>,
akpm@linux-foundation.org, willy@infradead.org,
markhemm@googlemail.com, rientjes@google.com, surenb@google.com,
shakeelb@google.com, fvdl@google.com, quic_pkondeti@quicinc.com,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V7 2/2] mm: shmem: implement POSIX_FADV_[WILL|DONT]NEED for shmem
Date: Wed, 17 May 2023 04:32:50 -0700 (PDT) [thread overview]
Message-ID: <aa4352d8-a549-32e5-874f-1cfee2a5b3e@google.com> (raw)
In-Reply-To: <eeeba374-9247-96fd-c9f5-8cba8761f1b9@quicinc.com>
On Mon, 24 Apr 2023, Charan Teja Kalla wrote:
> On 4/21/2023 5:37 AM, Hugh Dickins wrote:
> > This is where I ran out of time. I'm afraid all the focus on
> > fadvise_calc_endbyte() has distracted you from looking at the DONTNEED
> > in mm/fadvise.c: where there are detailed comments on why and how it
> > then narrows the DONTNEED range. And aside from needing to duplicate
> > that here for shmem (or put it into another or combined helper), it
> > implies to me that shmem_isolate_pages_range() needs to do a similar
> > narrowing, when it finds that the range overlaps part of a large folio.
> >
> Sure, will include those range calculations for shmem pages too.
Oh, I forgot this issue, you would have liked me to look at V8 by now,
to see whether I agree with your resolution there. Sorry, no, I've
not been able to divert my concentration to it yet.
And it's quite likely that I shall disagree, because I've a history of
disagreeing even with myself on such range widening/narrowing issues -
reconciling conflicting precedents is difficult :(
>
> > Something that has crossed my mind as a worry, but I've not had time
> > to look further into (maybe it's no concern at all) is the question
> > of this syscall temporarily isolating a very large number of folios,
> > whether they need to be (or perhaps already are) counted in
> > NR_ISOLATED_ANON, whether too many isolated needs to be limited.
>
> They are _not_ counted as ISOLATED_ANON now as this operation is for a
> small duration. I do see there exists too_many_isolated() checks in
> direct reclaim/compaction logic where it is necessary to stop the
> multiple processes in the direct reclaim from isolating too many pages.
>
> I am not able to envisage such problem here, where usually single
> process doing the fadvise operation on a file. Even If the file is
> opened by multiple processes and do fadvise, the operation is limited
> only to the pages of this file and doesn't impact the system.
>
> Please let me know if I'm missing something where I should be counting
> these as NR_ISOLATED.
Please grep for NR_ISOLATED, to see where and how they get manipulated
already, and follow the existing examples. The case that sticks in my
mind is in mm/mempolicy.c, where the migrate_pages() syscall can build
up a gigantic quantity of transiently isolated pages: your syscall can
do the same, so should account for itself in the same way.
I'm not claiming that mm/vmscan.c's too_many_isolated(), and the way it
gets used by shrink_inactive_list(), is perfect: not at all. But please
follow existing convention.
Sorry, that's all for now.
Hugh
next prev parent reply other threads:[~2023-05-17 11:33 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-14 12:51 [PATCH V7 0/2] mm: shmem: support POSIX_FADV_[WILL|DONT]NEED for shmem files Charan Teja Kalla
2023-02-14 12:51 ` [PATCH V7 1/2] mm: fadvise: move 'endbyte' calculations to helper function Charan Teja Kalla
2023-02-14 12:51 ` [PATCH V7 2/2] mm: shmem: implement POSIX_FADV_[WILL|DONT]NEED for shmem Charan Teja Kalla
2023-04-06 23:44 ` Minchan Kim
2023-04-10 13:52 ` Charan Teja Kalla
2023-04-11 3:42 ` Andrew Morton
2023-04-21 0:07 ` Hugh Dickins
2023-04-24 15:04 ` Charan Teja Kalla
2023-05-17 11:32 ` Hugh Dickins [this message]
2023-05-18 12:46 ` Charan Teja Kalla
2024-02-14 9:13 ` Charan Teja Kalla
2024-02-20 5:10 ` Hugh Dickins
2023-03-28 22:50 ` [PATCH V7 0/2] mm: shmem: support POSIX_FADV_[WILL|DONT]NEED for shmem files Andrew Morton
2023-03-29 21:36 ` Suren Baghdasaryan
2023-04-13 19:45 ` Frank van der Linden
2023-04-14 17:44 ` Frank van der Linden
2023-04-14 19:10 ` Charan Teja Kalla
2023-04-14 22:02 ` Frank van der Linden
2023-04-17 6:11 ` Charan Teja Kalla
2023-04-18 17:29 ` Frank van der Linden
2023-04-19 4:19 ` Pavan Kondeti
2023-04-19 17:27 ` Frank van der Linden
2023-04-19 14:39 ` Charan Teja Kalla
2023-04-19 17:29 ` Frank van der Linden
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=aa4352d8-a549-32e5-874f-1cfee2a5b3e@google.com \
--to=hughd@google.com \
--cc=akpm@linux-foundation.org \
--cc=fvdl@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=markhemm@googlemail.com \
--cc=quic_charante@quicinc.com \
--cc=quic_pkondeti@quicinc.com \
--cc=rientjes@google.com \
--cc=shakeelb@google.com \
--cc=surenb@google.com \
--cc=willy@infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).