Re: [RFC v7 PATCH 1/4] mm: refactor do_munmap() to extract the common part

2018-08-10 Thread Yang Shi
On 8/10/18 10:41 AM, Matthew Wilcox wrote: On Fri, Aug 10, 2018 at 07:36:00AM +0800, Yang Shi wrote: +static inline bool addr_ok(unsigned long start, size_t len) Maybe munmap_range_ok()? Otherwise some of the conditions here don't make sense for such a generic sounding function. I don't

Re: [RFC v7 PATCH 1/4] mm: refactor do_munmap() to extract the common part

2018-08-10 Thread Yang Shi
On 8/10/18 10:41 AM, Matthew Wilcox wrote: On Fri, Aug 10, 2018 at 07:36:00AM +0800, Yang Shi wrote: +static inline bool addr_ok(unsigned long start, size_t len) Maybe munmap_range_ok()? Otherwise some of the conditions here don't make sense for such a generic sounding function. I don't

Re: [RFC v7 PATCH 1/4] mm: refactor do_munmap() to extract the common part

2018-08-10 Thread Matthew Wilcox
On Fri, Aug 10, 2018 at 07:36:00AM +0800, Yang Shi wrote: > +static inline bool addr_ok(unsigned long start, size_t len) Maybe munmap_range_ok()? Otherwise some of the conditions here don't make sense for such a generic sounding function. > { > - unsigned long end; > - struct

Re: [RFC v7 PATCH 1/4] mm: refactor do_munmap() to extract the common part

2018-08-10 Thread Matthew Wilcox
On Fri, Aug 10, 2018 at 07:36:00AM +0800, Yang Shi wrote: > +static inline bool addr_ok(unsigned long start, size_t len) Maybe munmap_range_ok()? Otherwise some of the conditions here don't make sense for such a generic sounding function. > { > - unsigned long end; > - struct

Re: [RFC v7 PATCH 1/4] mm: refactor do_munmap() to extract the common part

2018-08-10 Thread Vlastimil Babka
On 08/10/2018 01:36 AM, Yang Shi wrote: > Introduces three new helper functions: > * addr_ok() > * munmap_lookup_vma() > * munlock_vmas() > > They will be used by do_munmap() and the new do_munmap with zapping > large mapping early in the later patch. > > There is no functional change,

Re: [RFC v7 PATCH 1/4] mm: refactor do_munmap() to extract the common part

2018-08-10 Thread Vlastimil Babka
On 08/10/2018 01:36 AM, Yang Shi wrote: > Introduces three new helper functions: > * addr_ok() > * munmap_lookup_vma() > * munlock_vmas() > > They will be used by do_munmap() and the new do_munmap with zapping > large mapping early in the later patch. > > There is no functional change,

[RFC v7 PATCH 1/4] mm: refactor do_munmap() to extract the common part

2018-08-09 Thread Yang Shi
Introduces three new helper functions: * addr_ok() * munmap_lookup_vma() * munlock_vmas() They will be used by do_munmap() and the new do_munmap with zapping large mapping early in the later patch. There is no functional change, just code refactor. Reviewed-by: Laurent Dufour

[RFC v7 PATCH 1/4] mm: refactor do_munmap() to extract the common part

2018-08-09 Thread Yang Shi
Introduces three new helper functions: * addr_ok() * munmap_lookup_vma() * munlock_vmas() They will be used by do_munmap() and the new do_munmap with zapping large mapping early in the later patch. There is no functional change, just code refactor. Reviewed-by: Laurent Dufour