linux-m68k.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH -next 0/3] Add support for fast mremap
       [not found]     ` <20181103183208.GA56850@google.com>
@ 2018-11-04  6:56       ` William Kucharski
  2018-11-06  4:36         ` Joel Fernandes
  0 siblings, 1 reply; 2+ messages in thread
From: William Kucharski @ 2018-11-04  6:56 UTC (permalink / raw)
  To: Joel Fernandes
  Cc: linux-mips, linux-m68k, Rich Felker, linux-sh, Peter Zijlstra,
	Catalin Marinas, Dave Hansen, Will Deacon,
	maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT),
	Michal Hocko, linux-mm, lokeshgidra, sparclinux, linux-hexagon,
	linux-riscv, elfring, Jonas Bonn, kvmarm, dancol, linux-ia64,
	Yoshinori Sato, linux-xtensa, Richard Weinberger, Helge Deller,
	r.kernel.org, hughd, James E.J. Bottomley



> On Nov 3, 2018, at 12:32 PM, Joel Fernandes <joel@joelfernandes.org> wrote:
> 
> Looks like more architectures don't define set_pmd_at. I am thinking the
> easiest way forward is to just do the following, instead of defining
> set_pmd_at for every architecture that doesn't care about it. Thoughts?
> 
> diff --git a/mm/mremap.c b/mm/mremap.c
> index 7cf6b0943090..31ad64dcdae6 100644
> --- a/mm/mremap.c
> +++ b/mm/mremap.c
> @@ -281,7 +281,8 @@ unsigned long move_page_tables(struct vm_area_struct *vma,
> 			split_huge_pmd(vma, old_pmd, old_addr);
> 			if (pmd_trans_unstable(old_pmd))
> 				continue;
> -		} else if (extent == PMD_SIZE && IS_ENABLED(CONFIG_HAVE_MOVE_PMD)) {
> +		} else if (extent == PMD_SIZE) {
> +#ifdef CONFIG_HAVE_MOVE_PMD
> 			/*
> 			 * If the extent is PMD-sized, try to speed the move by
> 			 * moving at the PMD level if possible.
> @@ -296,6 +297,7 @@ unsigned long move_page_tables(struct vm_area_struct *vma,
> 				drop_rmap_locks(vma);
> 			if (moved)
> 				continue;
> +#endif
> 		}
> 
> 		if (pte_alloc(new_vma->vm_mm, new_pmd))
> 

That seems reasonable as there are going to be a lot of architectures that never have
mappings at the PMD level.

Have you thought about what might be needed to extend this paradigm to be able to
perform remaps at the PUD level, given many architectures already support PUD-mapped
pages?

    William Kucharski

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH -next 0/3] Add support for fast mremap
  2018-11-04  6:56       ` [PATCH -next 0/3] Add support for fast mremap William Kucharski
@ 2018-11-06  4:36         ` Joel Fernandes
  0 siblings, 0 replies; 2+ messages in thread
From: Joel Fernandes @ 2018-11-06  4:36 UTC (permalink / raw)
  To: William Kucharski
  Cc: linux-mips, linux-m68k, Rich Felker, linux-sh, Peter Zijlstra,
	Catalin Marinas, Dave Hansen, Will Deacon,
	maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT),
	Michal Hocko, linux-mm, lokeshgidra, sparclinux, linux-hexagon,
	linux-riscv, elfring, Jonas Bonn, kvmarm, dancol, linux-ia64,
	Yoshinori Sato, linux-xtensa, Richard Weinberger, Helge Deller,
	r.kernel.org, hughd, James E.J. Bottomley

On Sun, Nov 04, 2018 at 12:56:48AM -0600, William Kucharski wrote:
> 
> 
> > On Nov 3, 2018, at 12:32 PM, Joel Fernandes <joel@joelfernandes.org> wrote:
> > 
> > Looks like more architectures don't define set_pmd_at. I am thinking the
> > easiest way forward is to just do the following, instead of defining
> > set_pmd_at for every architecture that doesn't care about it. Thoughts?
> > 
> > diff --git a/mm/mremap.c b/mm/mremap.c
> > index 7cf6b0943090..31ad64dcdae6 100644
> > --- a/mm/mremap.c
> > +++ b/mm/mremap.c
> > @@ -281,7 +281,8 @@ unsigned long move_page_tables(struct vm_area_struct *vma,
> > 			split_huge_pmd(vma, old_pmd, old_addr);
> > 			if (pmd_trans_unstable(old_pmd))
> > 				continue;
> > -		} else if (extent == PMD_SIZE && IS_ENABLED(CONFIG_HAVE_MOVE_PMD)) {
> > +		} else if (extent == PMD_SIZE) {
> > +#ifdef CONFIG_HAVE_MOVE_PMD
> > 			/*
> > 			 * If the extent is PMD-sized, try to speed the move by
> > 			 * moving at the PMD level if possible.
> > @@ -296,6 +297,7 @@ unsigned long move_page_tables(struct vm_area_struct *vma,
> > 				drop_rmap_locks(vma);
> > 			if (moved)
> > 				continue;
> > +#endif
> > 		}
> > 
> > 		if (pte_alloc(new_vma->vm_mm, new_pmd))
> > 
> 
> That seems reasonable as there are going to be a lot of architectures that never have
> mappings at the PMD level.

Ok, I will do it like this and resend.

> Have you thought about what might be needed to extend this paradigm to be able to
> perform remaps at the PUD level, given many architectures already support PUD-mapped
> pages?
> 

I have thought about this. I believe it is doable in the future. Off the top
I don't see an issue doing it, and it will also reduce the number of flushes.

thanks,

- Joel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-06  4:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20181103040041.7085-1-joelaf@google.com>
     [not found] ` <6886607.O3ZT5bM3Cy@blindfold>
     [not found]   ` <e1d039a5-9c83-b9b9-98b5-d39bc48f04e0@kot-begemot.co.uk>
     [not found]     ` <20181103183208.GA56850@google.com>
2018-11-04  6:56       ` [PATCH -next 0/3] Add support for fast mremap William Kucharski
2018-11-06  4:36         ` Joel Fernandes

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).