From: Dave Chinner <david@fromorbit.com>
To: Josef Bacik <josef@toxicpanda.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
kernel-team@fb.com, linux-btrfs@vger.kernel.org, riel@redhat.com,
hannes@cmpxchg.org, tj@kernel.org, linux-mm@kvack.org,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/8] mm: push vm_fault into the page fault handlers
Date: Wed, 26 Sep 2018 10:22:18 +1000 [thread overview]
Message-ID: <20180926002217.GA18567@dastard> (raw)
In-Reply-To: <20180925153011.15311-2-josef@toxicpanda.com>
On Tue, Sep 25, 2018 at 11:30:04AM -0400, Josef Bacik wrote:
> In preparation for caching pages during filemap faults we need to push
> the struct vm_fault up a level into the arch page fault handlers, since
> they are the ones responsible for retrying if we unlock the mmap_sem.
>
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
> ---
> arch/alpha/mm/fault.c | 4 ++-
> arch/arc/mm/fault.c | 2 ++
> arch/arm/mm/fault.c | 18 ++++++++-----
> arch/arm64/mm/fault.c | 18 +++++++------
> arch/hexagon/mm/vm_fault.c | 4 ++-
> arch/ia64/mm/fault.c | 4 ++-
> arch/m68k/mm/fault.c | 5 ++--
> arch/microblaze/mm/fault.c | 4 ++-
> arch/mips/mm/fault.c | 4 ++-
> arch/nds32/mm/fault.c | 5 ++--
> arch/nios2/mm/fault.c | 4 ++-
> arch/openrisc/mm/fault.c | 5 ++--
> arch/parisc/mm/fault.c | 5 ++--
> arch/powerpc/mm/copro_fault.c | 4 ++-
> arch/powerpc/mm/fault.c | 4 ++-
> arch/riscv/mm/fault.c | 2 ++
> arch/s390/mm/fault.c | 4 ++-
> arch/sh/mm/fault.c | 4 ++-
> arch/sparc/mm/fault_32.c | 6 ++++-
> arch/sparc/mm/fault_64.c | 2 ++
> arch/um/kernel/trap.c | 4 ++-
> arch/unicore32/mm/fault.c | 17 +++++++-----
> arch/x86/mm/fault.c | 4 ++-
> arch/xtensa/mm/fault.c | 4 ++-
> drivers/iommu/amd_iommu_v2.c | 4 ++-
> drivers/iommu/intel-svm.c | 6 +++--
> include/linux/mm.h | 16 +++++++++---
> mm/gup.c | 8 ++++--
> mm/hmm.c | 4 ++-
> mm/ksm.c | 10 ++++---
> mm/memory.c | 61 +++++++++++++++++++++----------------------
> 31 files changed, 157 insertions(+), 89 deletions(-)
>
> diff --git a/arch/alpha/mm/fault.c b/arch/alpha/mm/fault.c
> index d73dc473fbb9..3c98dfef03a9 100644
> --- a/arch/alpha/mm/fault.c
> +++ b/arch/alpha/mm/fault.c
> @@ -84,6 +84,7 @@ asmlinkage void
> do_page_fault(unsigned long address, unsigned long mmcsr,
> long cause, struct pt_regs *regs)
> {
> + struct vm_fault vmf = {};
> struct vm_area_struct * vma;
> struct mm_struct *mm = current->mm;
> const struct exception_table_entry *fixup;
> @@ -148,7 +149,8 @@ do_page_fault(unsigned long address, unsigned long mmcsr,
> /* If for any reason at all we couldn't handle the fault,
> make sure we exit gracefully rather than endlessly redo
> the fault. */
> - fault = handle_mm_fault(vma, address, flags);
> + vm_fault_init(&vmfs, vma, flags, address);
> + fault = handle_mm_fault(&vmf);
Doesn't compile.
> --- a/arch/arm/mm/fault.c
> +++ b/arch/arm/mm/fault.c
> @@ -225,17 +225,17 @@ static inline bool access_error(unsigned int fsr, struct vm_area_struct *vma)
> }
>
> static vm_fault_t __kprobes
> -__do_page_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
> - unsigned int flags, struct task_struct *tsk)
> +__do_page_fault(struct mm_struct *mm, struct vm_fault *vm, unsigned int fsr,
vm_fault is *vm....
> + struct task_struct *tsk)
> {
> struct vm_area_struct *vma;
> vm_fault_t fault;
>
> - vma = find_vma(mm, addr);
> + vma = find_vma(mm, vmf->address);
So this doesn't compile.
>
> check_stack:
> - if (vma->vm_flags & VM_GROWSDOWN && !expand_stack(vma, addr))
> + if (vma->vm_flags & VM_GROWSDOWN && !expand_stack(vma, vmf->address))
> goto good_area;
> out:
> return fault;
> @@ -424,6 +424,7 @@ static bool is_el0_instruction_abort(unsigned int esr)
> static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
> struct pt_regs *regs)
> {
> + struct vm_fault vmf = {};
> struct task_struct *tsk;
> struct mm_struct *mm;
> struct siginfo si;
> @@ -493,7 +494,8 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
> #endif
> }
>
> - fault = __do_page_fault(mm, addr, mm_flags, vm_flags, tsk);
> + vm_fault_init(&vmf, NULL, addr, mm_flags);
> + fault = __do_page_fault(mm, vmf, vm_flags, tsk);
I'm betting this doesn't compile, either.
/me stops looking.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2018-09-26 0:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-25 15:30 [RFC][PATCH 0/8] drop the mmap_sem when doing IO in the fault path Josef Bacik
2018-09-25 15:30 ` [PATCH 1/8] mm: push vm_fault into the page fault handlers Josef Bacik
2018-09-26 0:22 ` Dave Chinner [this message]
2018-09-26 1:33 ` Josef Bacik
2018-09-25 15:30 ` [PATCH 2/8] mm: drop mmap_sem for page cache read IO submission Josef Bacik
2018-09-25 15:30 ` [PATCH 3/8] mm: clean up swapcache lookup and creation function names Josef Bacik
2018-09-25 15:30 ` [PATCH 4/8] mm: drop mmap_sem for swap read IO submission Josef Bacik
2018-09-25 15:30 ` [PATCH 5/8] mm: drop the mmap_sem in all read fault cases Josef Bacik
2018-09-25 15:30 ` [PATCH 6/8] mm: keep the page we read for the next loop Josef Bacik
2018-09-25 15:30 ` [PATCH 7/8] mm: add a flag to indicate we used a cached page Josef Bacik
2018-09-25 15:30 ` [PATCH 8/8] btrfs: drop mmap_sem in mkwrite for btrfs Josef Bacik
2018-09-26 0:24 ` Dave Chinner
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=20180926002217.GA18567@dastard \
--to=david@fromorbit.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=josef@toxicpanda.com \
--cc=kernel-team@fb.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=riel@redhat.com \
--cc=tj@kernel.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).