diff mbox series

[2/2] mm: make it clear that gfp reclaim modifiers are valid only for sleepable allocations

Message ID 20200403083543.11552-3-mhocko@kernel.org (mailing list archive)
State New, archived
Headers show
Series mm: few refinements to gfp flags documentation | expand

Commit Message

Michal Hocko April 3, 2020, 8:35 a.m. UTC
From: Michal Hocko <mhocko@suse.com>

While it might be really clear to MM developers that gfp reclaim
modifiers are applicable only to sleepable allocations (those with
__GFP_DIRECT_RECLAIM) it seems that actual users of the API are not
always sure. Make it explicit that they are not applicable for
GFP_NOWAIT or GFP_ATOMIC allocations which are the most commonly used
non-sleepable allocation masks.

Acked-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Michal Hocko <mhocko@suse.com>
---
 include/linux/gfp.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

David Rientjes April 3, 2020, 7:41 p.m. UTC | #1
On Fri, 3 Apr 2020, Michal Hocko wrote:

> From: Michal Hocko <mhocko@suse.com>
> 
> While it might be really clear to MM developers that gfp reclaim
> modifiers are applicable only to sleepable allocations (those with
> __GFP_DIRECT_RECLAIM) it seems that actual users of the API are not
> always sure. Make it explicit that they are not applicable for
> GFP_NOWAIT or GFP_ATOMIC allocations which are the most commonly used
> non-sleepable allocation masks.
> 
> Acked-by: Paul E. McKenney <paulmck@kernel.org>
> Signed-off-by: Michal Hocko <mhocko@suse.com>

Acked-by: David Rientjes <rientjes@google.com>
Joel Fernandes April 7, 2020, 1:38 a.m. UTC | #2
On Fri, Apr 03, 2020 at 12:41:51PM -0700, David Rientjes wrote:
> On Fri, 3 Apr 2020, Michal Hocko wrote:
> 
> > From: Michal Hocko <mhocko@suse.com>
> > 
> > While it might be really clear to MM developers that gfp reclaim
> > modifiers are applicable only to sleepable allocations (those with
> > __GFP_DIRECT_RECLAIM) it seems that actual users of the API are not
> > always sure. Make it explicit that they are not applicable for
> > GFP_NOWAIT or GFP_ATOMIC allocations which are the most commonly used
> > non-sleepable allocation masks.
> > 
> > Acked-by: Paul E. McKenney <paulmck@kernel.org>
> > Signed-off-by: Michal Hocko <mhocko@suse.com>
> 
> Acked-by: David Rientjes <rientjes@google.com>

Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>

thanks,

 - Joel
diff mbox series

Patch

diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index e3ab1c0d9140..8040fa944cd8 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -127,6 +127,8 @@  struct vm_area_struct;
  *
  * Reclaim modifiers
  * ~~~~~~~~~~~~~~~~~
+ * Please note that all the following flags are only applicable to sleepable
+ * allocations (e.g. %GFP_NOWAIT and %GFP_ATOMIC will ignore them).
  *
  * %__GFP_IO can start physical IO.
  *