From: Suren Baghdasaryan <surenb@google.com>
To: Peter Xu <peterx@redhat.com>
Cc: akpm@linux-foundation.org, willy@infradead.org,
hannes@cmpxchg.org, mhocko@suse.com, josef@toxicpanda.com,
jack@suse.cz, ldufour@linux.ibm.com, laurent.dufour@fr.ibm.com,
michel@lespinasse.org, liam.howlett@oracle.com,
jglisse@google.com, vbabka@suse.cz, minchan@google.com,
dave@stgolabs.net, punit.agrawal@bytedance.com,
lstoakes@gmail.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, kernel-team@android.com
Subject: Re: [PATCH 1/1] mm: do not increment pgfault stats when page fault handler retries
Date: Fri, 14 Apr 2023 16:49:19 -0700 [thread overview]
Message-ID: <CAJuCfpH278ozvhz=z4W0d6TxY6HhrORbsBPFM5d4x1M=EM23WQ@mail.gmail.com> (raw)
In-Reply-To: <ZDnVETTFus3BFLxH@x1n>
On Fri, Apr 14, 2023 at 3:35 PM Peter Xu <peterx@redhat.com> wrote:
>
> Hi, Suren,
>
> On Fri, Apr 14, 2023 at 03:14:23PM -0700, Suren Baghdasaryan wrote:
> > > It also already ignores invalid faults:
> > >
> > > if (ret & (VM_FAULT_ERROR | VM_FAULT_RETRY))
> > > return;
> >
> > Can there be a case of (!VM_FAULT_ERROR && VM_FAULT_RETRY) - basically
> > we need to retry but no errors happened? If so then this condition
> > would double-count pagefaults in such cases.
>
> If ret==VM_FAULT_RETRY it should return here already, so I assume
> mm_account_fault() itself is fine regarding fault retries?
>
> Note that I think "ret & (VM_FAULT_ERROR | VM_FAULT_RETRY)" above means
> "either ERROR or RETRY we'll skip the accounting".
>
> IMHO we should have 3 cases here:
>
> - ERROR && !RETRY
> error triggered of any kind
>
> - RETRY && !ERROR
> we need to try one more time
>
> - !RETRY && !ERROR
> we finished the fault
After looking some more into mm_account_fault(), I think it would be
fine to count the faults which produced errors. IIUC these counters
represent the total number of faults, not the number of valid and
successful faults. If so then I think simply using VM_FAULT_RETRY
should be ok without considering all possible combinations. WDYT?
>
> I don't think ERROR & RETRY can even be set at the same time so I assume
> there's no option 4) - a RETRY should imply no ERROR already, even though
> it's still incomplete so need another attempt.
>
> Thanks,
>
> --
> Peter Xu
>
next prev parent reply other threads:[~2023-04-14 23:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-14 17:54 Suren Baghdasaryan
2023-04-14 18:11 ` Matthew Wilcox
2023-04-14 21:47 ` Peter Xu
2023-04-14 22:14 ` Suren Baghdasaryan
2023-04-14 22:26 ` Suren Baghdasaryan
2023-04-14 22:34 ` Peter Xu
2023-04-14 23:49 ` Suren Baghdasaryan [this message]
2023-04-15 0:11 ` Suren Baghdasaryan
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='CAJuCfpH278ozvhz=z4W0d6TxY6HhrORbsBPFM5d4x1M=EM23WQ@mail.gmail.com' \
--to=surenb@google.com \
--cc=akpm@linux-foundation.org \
--cc=dave@stgolabs.net \
--cc=hannes@cmpxchg.org \
--cc=jack@suse.cz \
--cc=jglisse@google.com \
--cc=josef@toxicpanda.com \
--cc=kernel-team@android.com \
--cc=laurent.dufour@fr.ibm.com \
--cc=ldufour@linux.ibm.com \
--cc=liam.howlett@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lstoakes@gmail.com \
--cc=mhocko@suse.com \
--cc=michel@lespinasse.org \
--cc=minchan@google.com \
--cc=peterx@redhat.com \
--cc=punit.agrawal@bytedance.com \
--cc=vbabka@suse.cz \
--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