diff mbox series

[v2,3/8] mm/gup: make __gup_longterm_locked common

Message ID 20201210004335.64634-4-pasha.tatashin@soleen.com (mailing list archive)
State New, archived
Headers show
Series prohibit pinning pages in ZONE_MOVABLE | expand

Commit Message

Pasha Tatashin Dec. 10, 2020, 12:43 a.m. UTC
__gup_longterm_locked() has CMA || FS_DAX version and a common stub
version. In the preparation of prohibiting longterm pinning of pages from
movable zone make the CMA || FS_DAX version common, and delete the stub
version.

Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
---
 mm/gup.c | 13 -------------
 1 file changed, 13 deletions(-)

Comments

Ira Weiny Dec. 10, 2020, 4:06 a.m. UTC | #1
On Wed, Dec 09, 2020 at 07:43:30PM -0500, Pavel Tatashin wrote:
> __gup_longterm_locked() has CMA || FS_DAX version and a common stub
> version. In the preparation of prohibiting longterm pinning of pages from
> movable zone make the CMA || FS_DAX version common, and delete the stub
> version.

I thought Jason sent a patch which got rid of this as well?

Ira

> 
> Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com>
> Reviewed-by: John Hubbard <jhubbard@nvidia.com>
> ---
>  mm/gup.c | 13 -------------
>  1 file changed, 13 deletions(-)
> 
> diff --git a/mm/gup.c b/mm/gup.c
> index 3a76c005a3e2..0e2de888a8b0 100644
> --- a/mm/gup.c
> +++ b/mm/gup.c
> @@ -1567,7 +1567,6 @@ struct page *get_dump_page(unsigned long addr)
>  }
>  #endif /* CONFIG_ELF_CORE */
>  
> -#if defined(CONFIG_FS_DAX) || defined (CONFIG_CMA)
>  #ifdef CONFIG_FS_DAX
>  static bool check_dax_vmas(struct vm_area_struct **vmas, long nr_pages)
>  {
> @@ -1757,18 +1756,6 @@ static long __gup_longterm_locked(struct mm_struct *mm,
>  		kfree(vmas_tmp);
>  	return rc;
>  }
> -#else /* !CONFIG_FS_DAX && !CONFIG_CMA */
> -static __always_inline long __gup_longterm_locked(struct mm_struct *mm,
> -						  unsigned long start,
> -						  unsigned long nr_pages,
> -						  struct page **pages,
> -						  struct vm_area_struct **vmas,
> -						  unsigned int flags)
> -{
> -	return __get_user_pages_locked(mm, start, nr_pages, pages, vmas,
> -				       NULL, flags);
> -}
> -#endif /* CONFIG_FS_DAX || CONFIG_CMA */
>  
>  static bool is_valid_gup_flags(unsigned int gup_flags)
>  {
> -- 
> 2.25.1
> 
>
Pasha Tatashin Dec. 10, 2020, 1:30 p.m. UTC | #2
On Wed, Dec 9, 2020 at 11:06 PM Ira Weiny <ira.weiny@intel.com> wrote:
>
> On Wed, Dec 09, 2020 at 07:43:30PM -0500, Pavel Tatashin wrote:
> > __gup_longterm_locked() has CMA || FS_DAX version and a common stub
> > version. In the preparation of prohibiting longterm pinning of pages from
> > movable zone make the CMA || FS_DAX version common, and delete the stub
> > version.
>
> I thought Jason sent a patch which got rid of this as well?

Yes, this series applies on the mainline so it can be easily tested.
The next version, I will sync with linux-next.

Thank you,
Pasha

>
> Ira
>
> >
> > Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com>
> > Reviewed-by: John Hubbard <jhubbard@nvidia.com>
> > ---
> >  mm/gup.c | 13 -------------
> >  1 file changed, 13 deletions(-)
> >
> > diff --git a/mm/gup.c b/mm/gup.c
> > index 3a76c005a3e2..0e2de888a8b0 100644
> > --- a/mm/gup.c
> > +++ b/mm/gup.c
> > @@ -1567,7 +1567,6 @@ struct page *get_dump_page(unsigned long addr)
> >  }
> >  #endif /* CONFIG_ELF_CORE */
> >
> > -#if defined(CONFIG_FS_DAX) || defined (CONFIG_CMA)
> >  #ifdef CONFIG_FS_DAX
> >  static bool check_dax_vmas(struct vm_area_struct **vmas, long nr_pages)
> >  {
> > @@ -1757,18 +1756,6 @@ static long __gup_longterm_locked(struct mm_struct *mm,
> >               kfree(vmas_tmp);
> >       return rc;
> >  }
> > -#else /* !CONFIG_FS_DAX && !CONFIG_CMA */
> > -static __always_inline long __gup_longterm_locked(struct mm_struct *mm,
> > -                                               unsigned long start,
> > -                                               unsigned long nr_pages,
> > -                                               struct page **pages,
> > -                                               struct vm_area_struct **vmas,
> > -                                               unsigned int flags)
> > -{
> > -     return __get_user_pages_locked(mm, start, nr_pages, pages, vmas,
> > -                                    NULL, flags);
> > -}
> > -#endif /* CONFIG_FS_DAX || CONFIG_CMA */
> >
> >  static bool is_valid_gup_flags(unsigned int gup_flags)
> >  {
> > --
> > 2.25.1
> >
> >
Ira Weiny Dec. 10, 2020, 5:44 p.m. UTC | #3
On Thu, Dec 10, 2020 at 08:30:03AM -0500, Pavel Tatashin wrote:
> On Wed, Dec 9, 2020 at 11:06 PM Ira Weiny <ira.weiny@intel.com> wrote:
> >
> > On Wed, Dec 09, 2020 at 07:43:30PM -0500, Pavel Tatashin wrote:
> > > __gup_longterm_locked() has CMA || FS_DAX version and a common stub
> > > version. In the preparation of prohibiting longterm pinning of pages from
> > > movable zone make the CMA || FS_DAX version common, and delete the stub
> > > version.
> >
> > I thought Jason sent a patch which got rid of this as well?
> 
> Yes, this series applies on the mainline so it can be easily tested.
> The next version, I will sync with linux-next.

Oh yea we wanted this to be back-portable correct?

If so, LGTM

Reviewed-by: Ira Weiny <ira.weiny@intel.com>

Sorry for not keeping up,
Ira
Pasha Tatashin Dec. 10, 2020, 6:57 p.m. UTC | #4
On Thu, Dec 10, 2020 at 12:44 PM Ira Weiny <ira.weiny@intel.com> wrote:
>
> On Thu, Dec 10, 2020 at 08:30:03AM -0500, Pavel Tatashin wrote:
> > On Wed, Dec 9, 2020 at 11:06 PM Ira Weiny <ira.weiny@intel.com> wrote:
> > >
> > > On Wed, Dec 09, 2020 at 07:43:30PM -0500, Pavel Tatashin wrote:
> > > > __gup_longterm_locked() has CMA || FS_DAX version and a common stub
> > > > version. In the preparation of prohibiting longterm pinning of pages from
> > > > movable zone make the CMA || FS_DAX version common, and delete the stub
> > > > version.
> > >
> > > I thought Jason sent a patch which got rid of this as well?
> >
> > Yes, this series applies on the mainline so it can be easily tested.
> > The next version, I will sync with linux-next.
>
> Oh yea we wanted this to be back-portable correct?
>
> If so, LGTM
>
> Reviewed-by: Ira Weiny <ira.weiny@intel.com>

Thank you. Yes, this series should be backported, but I am not sure
what to do about Jason's patch. Perhaps, in the next version I will
send out this series together with his patch.

Pasha

>
> Sorry for not keeping up,
> Ira
Jason Gunthorpe Dec. 10, 2020, 7:53 p.m. UTC | #5
On Thu, Dec 10, 2020 at 01:57:20PM -0500, Pavel Tatashin wrote:

> Thank you. Yes, this series should be backported, but I am not sure
> what to do about Jason's patch. Perhaps, in the next version I will
> send out this series together with his patch.

You need to send out patches that can be applied on top of linux-next,
at this point the window to go to rc kernels is done.

When you eventually want this back ported to stables then suggest they
take my patch as a pre-requisite.

Jason
Pasha Tatashin Dec. 10, 2020, 7:54 p.m. UTC | #6
On Thu, Dec 10, 2020 at 2:53 PM Jason Gunthorpe <jgg@ziepe.ca> wrote:
>
> On Thu, Dec 10, 2020 at 01:57:20PM -0500, Pavel Tatashin wrote:
>
> > Thank you. Yes, this series should be backported, but I am not sure
> > what to do about Jason's patch. Perhaps, in the next version I will
> > send out this series together with his patch.
>
> You need to send out patches that can be applied on top of linux-next,
> at this point the window to go to rc kernels is done.
>
> When you eventually want this back ported to stables then suggest they
> take my patch as a pre-requisite.

Sounds good.

Thanks,
Pasha

>
> Jason
diff mbox series

Patch

diff --git a/mm/gup.c b/mm/gup.c
index 3a76c005a3e2..0e2de888a8b0 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -1567,7 +1567,6 @@  struct page *get_dump_page(unsigned long addr)
 }
 #endif /* CONFIG_ELF_CORE */
 
-#if defined(CONFIG_FS_DAX) || defined (CONFIG_CMA)
 #ifdef CONFIG_FS_DAX
 static bool check_dax_vmas(struct vm_area_struct **vmas, long nr_pages)
 {
@@ -1757,18 +1756,6 @@  static long __gup_longterm_locked(struct mm_struct *mm,
 		kfree(vmas_tmp);
 	return rc;
 }
-#else /* !CONFIG_FS_DAX && !CONFIG_CMA */
-static __always_inline long __gup_longterm_locked(struct mm_struct *mm,
-						  unsigned long start,
-						  unsigned long nr_pages,
-						  struct page **pages,
-						  struct vm_area_struct **vmas,
-						  unsigned int flags)
-{
-	return __get_user_pages_locked(mm, start, nr_pages, pages, vmas,
-				       NULL, flags);
-}
-#endif /* CONFIG_FS_DAX || CONFIG_CMA */
 
 static bool is_valid_gup_flags(unsigned int gup_flags)
 {