linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm, gfp: escalatedly define GFP_HIGHUSER and GFP_HIGHUSER_MOVABLE
@ 2014-11-24 16:43 Jianyu Zhan
  2014-11-24 18:21 ` Johannes Weiner
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jianyu Zhan @ 2014-11-24 16:43 UTC (permalink / raw)
  To: akpm, mgorman, riel, sasha.levin, n-horiguchi, andriy.shevchenko,
	rientjes, hannes, nasa4836, vdavydov, fabf
  Cc: linux-mm, linux-kernel, Jianyu Zhan

GFP_USER, GFP_HIGHUSER and GFP_HIGHUSER_MOVABLE are escalatedly
confined defined, also implied by their names:

GFP_USER                                  = GFP_USER
GFP_USER + __GFP_HIGHMEM                  = GFP_HIGHUSER
GFP_USER + __GFP_HIGHMEM + __GFP_MOVABLE  = GFP_HIGHUSER_MOVABLE

So just make GFP_HIGHUSER and GFP_HIGHUSER_MOVABLE escalatedly defined
to reflect this fact. It also makes the definition clear and texturally
warn on any furture break-up of this escalated relastionship.

Signed-off-by: Jianyu Zhan <jianyu.zhan@emc.com>
---
 include/linux/gfp.h | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 41b30fd..f7c74c8 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -110,11 +110,8 @@ struct vm_area_struct;
 #define GFP_TEMPORARY	(__GFP_WAIT | __GFP_IO | __GFP_FS | \
 			 __GFP_RECLAIMABLE)
 #define GFP_USER	(__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL)
-#define GFP_HIGHUSER	(__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \
-			 __GFP_HIGHMEM)
-#define GFP_HIGHUSER_MOVABLE	(__GFP_WAIT | __GFP_IO | __GFP_FS | \
-				 __GFP_HARDWALL | __GFP_HIGHMEM | \
-				 __GFP_MOVABLE)
+#define GFP_HIGHUSER	(GFP_USER | __GFP_HIGHMEM)
+#define GFP_HIGHUSER_MOVABLE	(GFP_HIGHUSER | __GFP_MOVABLE)
 #define GFP_IOFS	(__GFP_IO | __GFP_FS)
 #define GFP_TRANSHUGE	(GFP_HIGHUSER_MOVABLE | __GFP_COMP | \
 			 __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN | \
-- 
2.0.0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] mm, gfp: escalatedly define GFP_HIGHUSER and GFP_HIGHUSER_MOVABLE
  2014-11-24 16:43 [PATCH] mm, gfp: escalatedly define GFP_HIGHUSER and GFP_HIGHUSER_MOVABLE Jianyu Zhan
@ 2014-11-24 18:21 ` Johannes Weiner
  2014-11-24 19:01 ` Kirill A. Shutemov
  2014-11-24 21:34 ` David Rientjes
  2 siblings, 0 replies; 6+ messages in thread
From: Johannes Weiner @ 2014-11-24 18:21 UTC (permalink / raw)
  To: Jianyu Zhan
  Cc: akpm, mgorman, riel, sasha.levin, n-horiguchi, andriy.shevchenko,
	rientjes, vdavydov, fabf, linux-mm, linux-kernel, Jianyu Zhan

On Tue, Nov 25, 2014 at 12:43:47AM +0800, Jianyu Zhan wrote:
> GFP_USER, GFP_HIGHUSER and GFP_HIGHUSER_MOVABLE are escalatedly
> confined defined, also implied by their names:
> 
> GFP_USER                                  = GFP_USER
> GFP_USER + __GFP_HIGHMEM                  = GFP_HIGHUSER
> GFP_USER + __GFP_HIGHMEM + __GFP_MOVABLE  = GFP_HIGHUSER_MOVABLE
> 
> So just make GFP_HIGHUSER and GFP_HIGHUSER_MOVABLE escalatedly defined
> to reflect this fact. It also makes the definition clear and texturally
> warn on any furture break-up of this escalated relastionship.
> 
> Signed-off-by: Jianyu Zhan <jianyu.zhan@emc.com>

Acked-by: Johannes Weiner <hannes@cmpxchg.org>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] mm, gfp: escalatedly define GFP_HIGHUSER and GFP_HIGHUSER_MOVABLE
  2014-11-24 16:43 [PATCH] mm, gfp: escalatedly define GFP_HIGHUSER and GFP_HIGHUSER_MOVABLE Jianyu Zhan
  2014-11-24 18:21 ` Johannes Weiner
@ 2014-11-24 19:01 ` Kirill A. Shutemov
  2014-11-24 21:35   ` David Rientjes
  2014-11-24 21:34 ` David Rientjes
  2 siblings, 1 reply; 6+ messages in thread
From: Kirill A. Shutemov @ 2014-11-24 19:01 UTC (permalink / raw)
  To: Jianyu Zhan
  Cc: akpm, mgorman, riel, sasha.levin, n-horiguchi, andriy.shevchenko,
	rientjes, hannes, vdavydov, fabf, linux-mm, linux-kernel,
	Jianyu Zhan

On Tue, Nov 25, 2014 at 12:43:47AM +0800, Jianyu Zhan wrote:
> GFP_USER, GFP_HIGHUSER and GFP_HIGHUSER_MOVABLE are escalatedly
> confined defined, also implied by their names:
> 
> GFP_USER                                  = GFP_USER
> GFP_USER + __GFP_HIGHMEM                  = GFP_HIGHUSER
> GFP_USER + __GFP_HIGHMEM + __GFP_MOVABLE  = GFP_HIGHUSER_MOVABLE

Looks reasonable.

Acked-by: Kirill A. Shutemov <kirill@linux.intel.com>

But I would prefer to have GPF_HIGHUSER movable by default and
GFP_HIGHUSER_UNMOVABLE to opt out.

-- 
 Kirill A. Shutemov

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] mm, gfp: escalatedly define GFP_HIGHUSER and GFP_HIGHUSER_MOVABLE
  2014-11-24 16:43 [PATCH] mm, gfp: escalatedly define GFP_HIGHUSER and GFP_HIGHUSER_MOVABLE Jianyu Zhan
  2014-11-24 18:21 ` Johannes Weiner
  2014-11-24 19:01 ` Kirill A. Shutemov
@ 2014-11-24 21:34 ` David Rientjes
  2 siblings, 0 replies; 6+ messages in thread
From: David Rientjes @ 2014-11-24 21:34 UTC (permalink / raw)
  To: Jianyu Zhan
  Cc: akpm, mgorman, riel, sasha.levin, n-horiguchi, andriy.shevchenko,
	hannes, vdavydov, fabf, linux-mm, linux-kernel, Jianyu Zhan

On Tue, 25 Nov 2014, Jianyu Zhan wrote:

> GFP_USER, GFP_HIGHUSER and GFP_HIGHUSER_MOVABLE are escalatedly
> confined defined, also implied by their names:
> 
> GFP_USER                                  = GFP_USER
> GFP_USER + __GFP_HIGHMEM                  = GFP_HIGHUSER
> GFP_USER + __GFP_HIGHMEM + __GFP_MOVABLE  = GFP_HIGHUSER_MOVABLE
> 
> So just make GFP_HIGHUSER and GFP_HIGHUSER_MOVABLE escalatedly defined
> to reflect this fact. It also makes the definition clear and texturally
> warn on any furture break-up of this escalated relastionship.
> 
> Signed-off-by: Jianyu Zhan <jianyu.zhan@emc.com>

Acked-by: David Rientjes <rientjes@google.com>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] mm, gfp: escalatedly define GFP_HIGHUSER and GFP_HIGHUSER_MOVABLE
  2014-11-24 19:01 ` Kirill A. Shutemov
@ 2014-11-24 21:35   ` David Rientjes
  2014-11-25 14:32     ` Kirill A. Shutemov
  0 siblings, 1 reply; 6+ messages in thread
From: David Rientjes @ 2014-11-24 21:35 UTC (permalink / raw)
  To: Kirill A. Shutemov
  Cc: Jianyu Zhan, akpm, mgorman, riel, sasha.levin, n-horiguchi,
	andriy.shevchenko, hannes, vdavydov, fabf, linux-mm,
	linux-kernel, Jianyu Zhan

On Mon, 24 Nov 2014, Kirill A. Shutemov wrote:

> But I would prefer to have GPF_HIGHUSER movable by default and
> GFP_HIGHUSER_UNMOVABLE to opt out.
> 

Sounds like a separate patch.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] mm, gfp: escalatedly define GFP_HIGHUSER and GFP_HIGHUSER_MOVABLE
  2014-11-24 21:35   ` David Rientjes
@ 2014-11-25 14:32     ` Kirill A. Shutemov
  0 siblings, 0 replies; 6+ messages in thread
From: Kirill A. Shutemov @ 2014-11-25 14:32 UTC (permalink / raw)
  To: David Rientjes
  Cc: Jianyu Zhan, akpm, mgorman, riel, sasha.levin, n-horiguchi,
	andriy.shevchenko, hannes, vdavydov, fabf, linux-mm,
	linux-kernel, Jianyu Zhan

On Mon, Nov 24, 2014 at 01:35:00PM -0800, David Rientjes wrote:
> On Mon, 24 Nov 2014, Kirill A. Shutemov wrote:
> 
> > But I would prefer to have GPF_HIGHUSER movable by default and
> > GFP_HIGHUSER_UNMOVABLE to opt out.
> > 
> 
> Sounds like a separate patch.

There are few questions before preparing patch:

1. Compatibility: some code which is not yet in tree can rely on
non-movable behaviour of GFP_HIGHUSER. How would we handle this?
Should we invent new name for the movable GFP_HIGHUSER?

2. Should GFP_USER be movable too? And the same compatibility question
here.

3. Do we need a separate define for non-movable GPF_HIGHUSER or caller
should use something like GPF_HIGHUSER & ~__GFP_MOVABLE?

4. Is there a gain, taking into account questions above?

-- 
 Kirill A. Shutemov

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2014-11-25 14:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-24 16:43 [PATCH] mm, gfp: escalatedly define GFP_HIGHUSER and GFP_HIGHUSER_MOVABLE Jianyu Zhan
2014-11-24 18:21 ` Johannes Weiner
2014-11-24 19:01 ` Kirill A. Shutemov
2014-11-24 21:35   ` David Rientjes
2014-11-25 14:32     ` Kirill A. Shutemov
2014-11-24 21:34 ` David Rientjes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox