lkml.org 
[lkml]   [2023]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/1] mm: do not increment pgfault stats when page fault handler retries
On Mon, Apr 17, 2023 at 03:40:33PM -0400, Peter Xu wrote:
> > /*
> > - * We don't do accounting for some specific faults:
> > - *
> > - * - Unsuccessful faults (e.g. when the address wasn't valid). That
> > - * includes arch_vma_access_permitted() failing before reaching here.
> > - * So this is not a "this many hardware page faults" counter. We
> > - * should use the hw profiling for that.
> > - *
> > - * - Incomplete faults (VM_FAULT_RETRY). They will only be counted
> > - * once they're completed.
> > + * Do not account for incomplete faults (VM_FAULT_RETRY). They will be
> > + * counted upon completion.
> > */
> > - if (ret & (VM_FAULT_ERROR | VM_FAULT_RETRY))
> > + if (ret & VM_FAULT_RETRY)
> > + return;
> > +
> > + /* Register both successful and failed faults in PGFAULT counters. */
> > + count_vm_event(PGFAULT);
> > + count_memcg_event_mm(mm, PGFAULT);
>
> Is there reason on why vm events accountings need to be explicitly
> different from perf events right below on handling ERROR?

I think so. ERROR is quite different from RETRY. If we are, for
example, handling a SIGSEGV (perhaps a GC language?) that should be
accounted. If we can't handle a page fault right now, and need to
retry within the kernel, that should not be accounted.

\
 
 \ /
  Last update: 2023-04-18 00:53    [W:0.080 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site