[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200624204903.097a5a58@thinkpad>
Date: Wed, 24 Jun 2020 20:49:03 +0200
From: Gerald Schaefer <gerald.schaefer@...ibm.com>
To: Peter Xu <peterx@...hat.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Andrew Morton <akpm@...ux-foundation.org>,
Andrea Arcangeli <aarcange@...hat.com>,
Will Deacon <will@...nel.org>,
Michael Ellerman <mpe@...erman.id.au>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH 01/26] mm: Do page fault accounting in handle_mm_fault
On Fri, 19 Jun 2020 12:05:13 -0400
Peter Xu <peterx@...hat.com> wrote:
[...]
> @@ -4393,6 +4425,38 @@ vm_fault_t handle_mm_fault(struct vm_area_struct *vma, unsigned long address,
> mem_cgroup_oom_synchronize(false);
> }
>
> + if (ret & VM_FAULT_RETRY)
> + return ret;
I'm wondering if this also needs a check and exit for VM_FAULT_ERROR.
In arch code (s390 and all others I briefly checked), the accounting
was skipped for VM_FAULT_ERROR case.
> +
> + /*
> + * Do accounting in the common code, to avoid unnecessary
> + * architecture differences or duplicated code.
> + *
> + * We arbitrarily make the rules be:
> + *
> + * - faults that never even got here (because the address
> + * wasn't valid). That includes arch_vma_access_permitted()
Missing "do not count" at the end of the first sentence?
> + * failing above.
> + *
> + * So this is expressly not a "this many hardware page
> + * faults" counter. Use the hw profiling for that.
> + *
> + * - incomplete faults (ie RETRY) do not count (see above).
> + * They will only count once completed.
> + *
> + * - the fault counts as a "major" fault when the final
> + * successful fault is VM_FAULT_MAJOR, or if it was a
> + * retry (which implies that we couldn't handle it
> + * immediately previously).
> + *
> + * - if the fault is done for GUP, regs wil be NULL and
wil -> will
Regards,
Gerald
Powered by blists - more mailing lists