All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm: page_alloc: use enum instead of number for migratetype
@ 2014-01-02 11:25 ` SeongJae Park
  0 siblings, 0 replies; 6+ messages in thread
From: SeongJae Park @ 2014-01-02 11:25 UTC (permalink / raw)
  To: mgorman, akpm; +Cc: linux-kernel, linux-mm, SeongJae Park

Using enum instead of number for migratetype everywhere would be better
for reading and understanding.

Signed-off-by: SeongJae Park <sj38.park@gmail.com>
---
 mm/page_alloc.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 5bcbca5..08f6ed7 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -646,7 +646,7 @@ static inline int free_pages_check(struct page *page)
 static void free_pcppages_bulk(struct zone *zone, int count,
 					struct per_cpu_pages *pcp)
 {
-	int migratetype = 0;
+	int migratetype = MIGRATE_UNMOVABLE;
 	int batch_free = 0;
 	int to_free = count;
 
@@ -667,7 +667,7 @@ static void free_pcppages_bulk(struct zone *zone, int count,
 		do {
 			batch_free++;
 			if (++migratetype == MIGRATE_PCPTYPES)
-				migratetype = 0;
+				migratetype = MIGRATE_UNMOVABLE;
 			list = &pcp->lists[migratetype];
 		} while (list_empty(list));
 
@@ -4158,7 +4158,9 @@ static void pageset_init(struct per_cpu_pageset *p)
 
 	pcp = &p->pcp;
 	pcp->count = 0;
-	for (migratetype = 0; migratetype < MIGRATE_PCPTYPES; migratetype++)
+
+	for (migratetype = MIGRATE_UNMOVABLE; migratetype < MIGRATE_PCPTYPES;
+						migratetype++)
 		INIT_LIST_HEAD(&pcp->lists[migratetype]);
 }
 
-- 
1.8.1.2


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

* [PATCH] mm: page_alloc: use enum instead of number for migratetype
@ 2014-01-02 11:25 ` SeongJae Park
  0 siblings, 0 replies; 6+ messages in thread
From: SeongJae Park @ 2014-01-02 11:25 UTC (permalink / raw)
  To: mgorman, akpm; +Cc: linux-kernel, linux-mm, SeongJae Park

Using enum instead of number for migratetype everywhere would be better
for reading and understanding.

Signed-off-by: SeongJae Park <sj38.park@gmail.com>
---
 mm/page_alloc.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 5bcbca5..08f6ed7 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -646,7 +646,7 @@ static inline int free_pages_check(struct page *page)
 static void free_pcppages_bulk(struct zone *zone, int count,
 					struct per_cpu_pages *pcp)
 {
-	int migratetype = 0;
+	int migratetype = MIGRATE_UNMOVABLE;
 	int batch_free = 0;
 	int to_free = count;
 
@@ -667,7 +667,7 @@ static void free_pcppages_bulk(struct zone *zone, int count,
 		do {
 			batch_free++;
 			if (++migratetype == MIGRATE_PCPTYPES)
-				migratetype = 0;
+				migratetype = MIGRATE_UNMOVABLE;
 			list = &pcp->lists[migratetype];
 		} while (list_empty(list));
 
@@ -4158,7 +4158,9 @@ static void pageset_init(struct per_cpu_pageset *p)
 
 	pcp = &p->pcp;
 	pcp->count = 0;
-	for (migratetype = 0; migratetype < MIGRATE_PCPTYPES; migratetype++)
+
+	for (migratetype = MIGRATE_UNMOVABLE; migratetype < MIGRATE_PCPTYPES;
+						migratetype++)
 		INIT_LIST_HEAD(&pcp->lists[migratetype]);
 }
 
-- 
1.8.1.2

--
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 related	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm: page_alloc: use enum instead of number for migratetype
  2014-01-02 11:25 ` SeongJae Park
@ 2014-01-02 15:57   ` Mel Gorman
  -1 siblings, 0 replies; 6+ messages in thread
From: Mel Gorman @ 2014-01-02 15:57 UTC (permalink / raw)
  To: SeongJae Park; +Cc: akpm, linux-kernel, linux-mm

On Thu, Jan 02, 2014 at 08:25:22PM +0900, SeongJae Park wrote:
> Using enum instead of number for migratetype everywhere would be better
> for reading and understanding.
> 
> Signed-off-by: SeongJae Park <sj38.park@gmail.com>

This implicitly makes assumptions about the value of MIGRATE_UNMOVABLE
and does not appear to actually fix or improve anything.

-- 
Mel Gorman
SUSE Labs

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

* Re: [PATCH] mm: page_alloc: use enum instead of number for migratetype
@ 2014-01-02 15:57   ` Mel Gorman
  0 siblings, 0 replies; 6+ messages in thread
From: Mel Gorman @ 2014-01-02 15:57 UTC (permalink / raw)
  To: SeongJae Park; +Cc: akpm, linux-kernel, linux-mm

On Thu, Jan 02, 2014 at 08:25:22PM +0900, SeongJae Park wrote:
> Using enum instead of number for migratetype everywhere would be better
> for reading and understanding.
> 
> Signed-off-by: SeongJae Park <sj38.park@gmail.com>

This implicitly makes assumptions about the value of MIGRATE_UNMOVABLE
and does not appear to actually fix or improve anything.

-- 
Mel Gorman
SUSE Labs

--
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: page_alloc: use enum instead of number for migratetype
  2014-01-02 15:57   ` Mel Gorman
@ 2014-01-03  3:21     ` SeongJae Park
  -1 siblings, 0 replies; 6+ messages in thread
From: SeongJae Park @ 2014-01-03  3:21 UTC (permalink / raw)
  To: Mel Gorman; +Cc: akpm, linux-kernel, linux-mm

On Fri, Jan 3, 2014 at 12:57 AM, Mel Gorman <mgorman@suse.de> wrote:
> On Thu, Jan 02, 2014 at 08:25:22PM +0900, SeongJae Park wrote:
>> Using enum instead of number for migratetype everywhere would be better
>> for reading and understanding.
>>
>> Signed-off-by: SeongJae Park <sj38.park@gmail.com>
>
> This implicitly makes assumptions about the value of MIGRATE_UNMOVABLE
> and does not appear to actually fix or improve anything.
>
> --
> Mel Gorman
> SUSE Labs

I thought the implicit assumptions may be helpful for some kind of
people's readability.
But, anyway, I agree and respect your opinion now.

Thanks and Regards.
SeongJae Park

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

* Re: [PATCH] mm: page_alloc: use enum instead of number for migratetype
@ 2014-01-03  3:21     ` SeongJae Park
  0 siblings, 0 replies; 6+ messages in thread
From: SeongJae Park @ 2014-01-03  3:21 UTC (permalink / raw)
  To: Mel Gorman; +Cc: akpm, linux-kernel, linux-mm

On Fri, Jan 3, 2014 at 12:57 AM, Mel Gorman <mgorman@suse.de> wrote:
> On Thu, Jan 02, 2014 at 08:25:22PM +0900, SeongJae Park wrote:
>> Using enum instead of number for migratetype everywhere would be better
>> for reading and understanding.
>>
>> Signed-off-by: SeongJae Park <sj38.park@gmail.com>
>
> This implicitly makes assumptions about the value of MIGRATE_UNMOVABLE
> and does not appear to actually fix or improve anything.
>
> --
> Mel Gorman
> SUSE Labs

I thought the implicit assumptions may be helpful for some kind of
people's readability.
But, anyway, I agree and respect your opinion now.

Thanks and Regards.
SeongJae Park

--
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-01-03  3:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-02 11:25 [PATCH] mm: page_alloc: use enum instead of number for migratetype SeongJae Park
2014-01-02 11:25 ` SeongJae Park
2014-01-02 15:57 ` Mel Gorman
2014-01-02 15:57   ` Mel Gorman
2014-01-03  3:21   ` SeongJae Park
2014-01-03  3:21     ` SeongJae Park

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.