Re: [PATCH v2] mm: add account_locked_vm utility function

2019-05-29 Thread Alex Williamson
On Tue, 28 May 2019 11:04:24 -0400 Daniel Jordan wrote: > On Sat, May 25, 2019 at 02:51:18PM -0700, Andrew Morton wrote: > > On Fri, 24 May 2019 13:50:45 -0400 Daniel Jordan > > wrote: > > > > > locked_vm accounting is done roughly the same way in five places, so > > > unify them in a

Re: [PATCH v2] mm: add account_locked_vm utility function

2019-05-29 Thread Daniel Jordan
On Wed, May 29, 2019 at 11:05:48AM -0700, Ira Weiny wrote: > On Fri, May 24, 2019 at 01:50:45PM -0400, Daniel Jordan wrote: > > +static inline int account_locked_vm(struct mm_struct *mm, unsigned long > > pages, > > + bool inc) > > +{ > > + int ret; > > + > > +

Re: [PATCH v2] mm: add account_locked_vm utility function

2019-05-29 Thread Ira Weiny
On Fri, May 24, 2019 at 01:50:45PM -0400, Daniel Jordan wrote: [snip] > diff --git a/include/linux/mm.h b/include/linux/mm.h > index 0e8834ac32b7..72c1034d2ec7 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -1564,6 +1564,25 @@ long get_user_pages_unlocked(unsigned long start,

Re: [PATCH v2] mm: add account_locked_vm utility function

2019-05-28 Thread Daniel Jordan
On Sat, May 25, 2019 at 02:51:18PM -0700, Andrew Morton wrote: > On Fri, 24 May 2019 13:50:45 -0400 Daniel Jordan > wrote: > > > locked_vm accounting is done roughly the same way in five places, so > > unify them in a helper. Standardize the debug prints, which vary > > slightly, but include

Re: [PATCH v2] mm: add account_locked_vm utility function

2019-05-25 Thread Andrew Morton
On Fri, 24 May 2019 13:50:45 -0400 Daniel Jordan wrote: > locked_vm accounting is done roughly the same way in five places, so > unify them in a helper. Standardize the debug prints, which vary > slightly, but include the helper's caller to disambiguate between > callsites. > > Error codes

[PATCH v2] mm: add account_locked_vm utility function

2019-05-24 Thread Daniel Jordan
locked_vm accounting is done roughly the same way in five places, so unify them in a helper. Standardize the debug prints, which vary slightly, but include the helper's caller to disambiguate between callsites. Error codes stay the same, so user-visible behavior does too. The one exception is