linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: clear pages_scanned only if draining a pcp adds pages to the buddy allocator again
@ 2012-06-14 16:16 kosaki.motohiro
  2012-06-14 17:46 ` Rik van Riel
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: kosaki.motohiro @ 2012-06-14 16:16 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-mm, akpm, KOSAKI Motohiro, David Rientjes, Mel Gorman,
	Johannes Weiner, Minchan Kim, Wu Fengguang, KAMEZAWA Hiroyuki,
	Rik van Riel

From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>

commit 2ff754fa8f (mm: clear pages_scanned only if draining a pcp adds pages
to the buddy allocator again) fixed one free_pcppages_bulk() misuse. But two
another miuse still exist.

This patch fixes it.

Cc: David Rientjes <rientjes@google.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Minchan Kim <minchan.kim@gmail.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
---
 mm/page_alloc.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 5716b00..4e7059d 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1157,8 +1157,10 @@ void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp)
 		to_drain = pcp->batch;
 	else
 		to_drain = pcp->count;
-	free_pcppages_bulk(zone, to_drain, pcp);
-	pcp->count -= to_drain;
+	if (to_drain > 0) {
+		free_pcppages_bulk(zone, to_drain, pcp);
+		pcp->count -= to_drain;
+	}
 	local_irq_restore(flags);
 }
 #endif
@@ -3914,7 +3916,8 @@ static int __zone_pcp_update(void *data)
 		pcp = &pset->pcp;
 
 		local_irq_save(flags);
-		free_pcppages_bulk(zone, pcp->count, pcp);
+		if (pcp->count > 0)
+			free_pcppages_bulk(zone, pcp->count, pcp);
 		setup_pageset(pset, batch);
 		local_irq_restore(flags);
 	}
-- 
1.7.1


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

* Re: [PATCH] mm: clear pages_scanned only if draining a pcp adds pages to the buddy allocator again
  2012-06-14 16:16 [PATCH] mm: clear pages_scanned only if draining a pcp adds pages to the buddy allocator again kosaki.motohiro
@ 2012-06-14 17:46 ` Rik van Riel
  2012-06-15  7:19 ` Minchan Kim
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Rik van Riel @ 2012-06-14 17:46 UTC (permalink / raw)
  To: kosaki.motohiro
  Cc: linux-kernel, linux-mm, akpm, KOSAKI Motohiro, David Rientjes,
	Mel Gorman, Johannes Weiner, Minchan Kim, Wu Fengguang,
	KAMEZAWA Hiroyuki

On 06/14/2012 12:16 PM, kosaki.motohiro@gmail.com wrote:
> From: KOSAKI Motohiro<kosaki.motohiro@jp.fujitsu.com>
>
> commit 2ff754fa8f (mm: clear pages_scanned only if draining a pcp adds pages
> to the buddy allocator again) fixed one free_pcppages_bulk() misuse. But two
> another miuse still exist.
>
> This patch fixes it.
>
> Cc: David Rientjes<rientjes@google.com>
> Cc: Mel Gorman<mel@csn.ul.ie>
> Cc: Johannes Weiner<hannes@cmpxchg.org>
> Cc: Minchan Kim<minchan.kim@gmail.com>
> Cc: Wu Fengguang<fengguang.wu@intel.com>
> Cc: KAMEZAWA Hiroyuki<kamezawa.hiroyu@jp.fujitsu.com>
> Cc: Rik van Riel<riel@redhat.com>
> Cc: Andrew Morton<akpm@linux-foundation.org>
> Signed-off-by: KOSAKI Motohiro<kosaki.motohiro@jp.fujitsu.com>

Acked-by: Rik van Riel <riel@redhat.com>


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

* Re: [PATCH] mm: clear pages_scanned only if draining a pcp adds pages to the buddy allocator again
  2012-06-14 16:16 [PATCH] mm: clear pages_scanned only if draining a pcp adds pages to the buddy allocator again kosaki.motohiro
  2012-06-14 17:46 ` Rik van Riel
@ 2012-06-15  7:19 ` Minchan Kim
  2012-06-15 15:52   ` KOSAKI Motohiro
  2012-06-15  9:24 ` Mel Gorman
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 12+ messages in thread
From: Minchan Kim @ 2012-06-15  7:19 UTC (permalink / raw)
  To: kosaki.motohiro
  Cc: linux-kernel, linux-mm, akpm, KOSAKI Motohiro, David Rientjes,
	Mel Gorman, Johannes Weiner, Minchan Kim, Wu Fengguang,
	KAMEZAWA Hiroyuki, Rik van Riel

On 06/15/2012 01:16 AM, kosaki.motohiro@gmail.com wrote:

> From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> 
> commit 2ff754fa8f (mm: clear pages_scanned only if draining a pcp adds pages
> to the buddy allocator again) fixed one free_pcppages_bulk() misuse. But two
> another miuse still exist.
> 
> This patch fixes it.
> 
> Cc: David Rientjes <rientjes@google.com>
> Cc: Mel Gorman <mel@csn.ul.ie>
> Cc: Johannes Weiner <hannes@cmpxchg.org>
> Cc: Minchan Kim <minchan.kim@gmail.com>
> Cc: Wu Fengguang <fengguang.wu@intel.com>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Cc: Rik van Riel <riel@redhat.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>

Reviewed-by: Minchan Kim <minchan@kernel.org>

Just nitpick.
Personally, I want to fix it follwing as 
It's more simple and reduce vulnerable error in future.

If you mind, go ahead with your version. I am not against with it, either.

barrios@bbox:~/linux-next$ git diff
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 4403009..a32ac56 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -637,6 +637,12 @@ static void free_pcppages_bulk(struct zone *zone, int count,
        int batch_free = 0;
        int to_free = count;
 
+       /*
+        * Let's avoid unnecessary reset of pages_scanned.
+        */
+       if (!count)
+               return;
+
        spin_lock(&zone->lock);
        zone->all_unreclaimable = 0;
        zone->pages_scanned = 0;
@@ -1175,6 +1181,7 @@ static void drain_pages(unsigned int cpu)
 {
        unsigned long flags;
        struct zone *zone;
+       int to_drain;
 
        for_each_populated_zone(zone) {
                struct per_cpu_pageset *pset;
@@ -1184,10 +1191,9 @@ static void drain_pages(unsigned int cpu)
                pset = per_cpu_ptr(zone->pageset, cpu);
 
                pcp = &pset->pcp;
-               if (pcp->count) {
-                       free_pcppages_bulk(zone, pcp->count, pcp);
-                       pcp->count = 0;
-               }
+               to_drain = pcp->count;
+               free_pcppages_bulk(zone, to_drain, pcp);
+               pcp->count -= to_drain;
                local_irq_restore(flags);
        }
 }

-- 
Kind regards,
Minchan Kim

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

* Re: [PATCH] mm: clear pages_scanned only if draining a pcp adds pages to the buddy allocator again
  2012-06-14 16:16 [PATCH] mm: clear pages_scanned only if draining a pcp adds pages to the buddy allocator again kosaki.motohiro
  2012-06-14 17:46 ` Rik van Riel
  2012-06-15  7:19 ` Minchan Kim
@ 2012-06-15  9:24 ` Mel Gorman
  2012-06-15 16:19 ` Johannes Weiner
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Mel Gorman @ 2012-06-15  9:24 UTC (permalink / raw)
  To: kosaki.motohiro
  Cc: linux-kernel, linux-mm, akpm, KOSAKI Motohiro, David Rientjes,
	Johannes Weiner, Minchan Kim, Wu Fengguang, KAMEZAWA Hiroyuki,
	Rik van Riel

On Thu, Jun 14, 2012 at 12:16:10PM -0400, kosaki.motohiro@gmail.com wrote:
> From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> 
> commit 2ff754fa8f (mm: clear pages_scanned only if draining a pcp adds pages
> to the buddy allocator again) fixed one free_pcppages_bulk() misuse. But two
> another miuse still exist.
> 
> This patch fixes it.
> 
> Cc: David Rientjes <rientjes@google.com>
> Cc: Mel Gorman <mel@csn.ul.ie>
> Cc: Johannes Weiner <hannes@cmpxchg.org>
> Cc: Minchan Kim <minchan.kim@gmail.com>
> Cc: Wu Fengguang <fengguang.wu@intel.com>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Cc: Rik van Riel <riel@redhat.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>

Acked-by: Mel Gorman <mel@csn.ul.ie>

-- 
Mel Gorman
SUSE Labs

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

* Re: [PATCH] mm: clear pages_scanned only if draining a pcp adds pages to the buddy allocator again
  2012-06-15  7:19 ` Minchan Kim
@ 2012-06-15 15:52   ` KOSAKI Motohiro
  2012-06-15 23:21     ` Minchan Kim
  0 siblings, 1 reply; 12+ messages in thread
From: KOSAKI Motohiro @ 2012-06-15 15:52 UTC (permalink / raw)
  To: Minchan Kim
  Cc: kosaki.motohiro, linux-kernel, linux-mm, akpm, KOSAKI Motohiro,
	David Rientjes, Mel Gorman, Johannes Weiner, Minchan Kim,
	Wu Fengguang, KAMEZAWA Hiroyuki, Rik van Riel

(6/15/12 3:19 AM), Minchan Kim wrote:
> On 06/15/2012 01:16 AM, kosaki.motohiro@gmail.com wrote:
>
>> From: KOSAKI Motohiro<kosaki.motohiro@jp.fujitsu.com>
>>
>> commit 2ff754fa8f (mm: clear pages_scanned only if draining a pcp adds pages
>> to the buddy allocator again) fixed one free_pcppages_bulk() misuse. But two
>> another miuse still exist.
>>
>> This patch fixes it.
>>
>> Cc: David Rientjes<rientjes@google.com>
>> Cc: Mel Gorman<mel@csn.ul.ie>
>> Cc: Johannes Weiner<hannes@cmpxchg.org>
>> Cc: Minchan Kim<minchan.kim@gmail.com>
>> Cc: Wu Fengguang<fengguang.wu@intel.com>
>> Cc: KAMEZAWA Hiroyuki<kamezawa.hiroyu@jp.fujitsu.com>
>> Cc: Rik van Riel<riel@redhat.com>
>> Cc: Andrew Morton<akpm@linux-foundation.org>
>> Signed-off-by: KOSAKI Motohiro<kosaki.motohiro@jp.fujitsu.com>
>
> Reviewed-by: Minchan Kim<minchan@kernel.org>
>
> Just nitpick.
> Personally, I want to fix it follwing as
> It's more simple and reduce vulnerable error in future.
>
> If you mind, go ahead with your version. I am not against with it, either.

I don't like your version because free_pcppages_bulk() can be called from
free_pages() hotpath. then, i wouldn't like to put a branch if we can avoid it.

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

* Re: [PATCH] mm: clear pages_scanned only if draining a pcp adds pages to the buddy allocator again
  2012-06-14 16:16 [PATCH] mm: clear pages_scanned only if draining a pcp adds pages to the buddy allocator again kosaki.motohiro
                   ` (2 preceding siblings ...)
  2012-06-15  9:24 ` Mel Gorman
@ 2012-06-15 16:19 ` Johannes Weiner
  2012-06-16  6:55 ` Kamezawa Hiroyuki
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Johannes Weiner @ 2012-06-15 16:19 UTC (permalink / raw)
  To: kosaki.motohiro
  Cc: linux-kernel, linux-mm, akpm, KOSAKI Motohiro, David Rientjes,
	Mel Gorman, Minchan Kim, Wu Fengguang, KAMEZAWA Hiroyuki,
	Rik van Riel

On Thu, Jun 14, 2012 at 12:16:10PM -0400, kosaki.motohiro@gmail.com wrote:
> From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> 
> commit 2ff754fa8f (mm: clear pages_scanned only if draining a pcp adds pages
> to the buddy allocator again) fixed one free_pcppages_bulk() misuse. But two
> another miuse still exist.
> 
> This patch fixes it.
> 
> Cc: David Rientjes <rientjes@google.com>
> Cc: Mel Gorman <mel@csn.ul.ie>
> Cc: Johannes Weiner <hannes@cmpxchg.org>
> Cc: Minchan Kim <minchan.kim@gmail.com>
> Cc: Wu Fengguang <fengguang.wu@intel.com>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Cc: Rik van Riel <riel@redhat.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>

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

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

* Re: [PATCH] mm: clear pages_scanned only if draining a pcp adds pages to the buddy allocator again
  2012-06-15 15:52   ` KOSAKI Motohiro
@ 2012-06-15 23:21     ` Minchan Kim
  0 siblings, 0 replies; 12+ messages in thread
From: Minchan Kim @ 2012-06-15 23:21 UTC (permalink / raw)
  To: KOSAKI Motohiro
  Cc: Minchan Kim, linux-kernel, linux-mm, akpm, KOSAKI Motohiro,
	David Rientjes, Mel Gorman, Johannes Weiner, Minchan Kim,
	Wu Fengguang, KAMEZAWA Hiroyuki, Rik van Riel

On Fri, Jun 15, 2012 at 11:52:34AM -0400, KOSAKI Motohiro wrote:
> (6/15/12 3:19 AM), Minchan Kim wrote:
> >On 06/15/2012 01:16 AM, kosaki.motohiro@gmail.com wrote:
> >
> >>From: KOSAKI Motohiro<kosaki.motohiro@jp.fujitsu.com>
> >>
> >>commit 2ff754fa8f (mm: clear pages_scanned only if draining a pcp adds pages
> >>to the buddy allocator again) fixed one free_pcppages_bulk() misuse. But two
> >>another miuse still exist.
> >>
> >>This patch fixes it.
> >>
> >>Cc: David Rientjes<rientjes@google.com>
> >>Cc: Mel Gorman<mel@csn.ul.ie>
> >>Cc: Johannes Weiner<hannes@cmpxchg.org>
> >>Cc: Minchan Kim<minchan.kim@gmail.com>
> >>Cc: Wu Fengguang<fengguang.wu@intel.com>
> >>Cc: KAMEZAWA Hiroyuki<kamezawa.hiroyu@jp.fujitsu.com>
> >>Cc: Rik van Riel<riel@redhat.com>
> >>Cc: Andrew Morton<akpm@linux-foundation.org>
> >>Signed-off-by: KOSAKI Motohiro<kosaki.motohiro@jp.fujitsu.com>
> >
> >Reviewed-by: Minchan Kim<minchan@kernel.org>
> >
> >Just nitpick.
> >Personally, I want to fix it follwing as
> >It's more simple and reduce vulnerable error in future.
> >
> >If you mind, go ahead with your version. I am not against with it, either.
> 
> I don't like your version because free_pcppages_bulk() can be called from
> free_pages() hotpath. then, i wouldn't like to put a branch if we can avoid it.

Fair enough.

Thanks.

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

* Re: [PATCH] mm: clear pages_scanned only if draining a pcp adds pages to the buddy allocator again
  2012-06-14 16:16 [PATCH] mm: clear pages_scanned only if draining a pcp adds pages to the buddy allocator again kosaki.motohiro
                   ` (3 preceding siblings ...)
  2012-06-15 16:19 ` Johannes Weiner
@ 2012-06-16  6:55 ` Kamezawa Hiroyuki
  2012-06-17  2:05 ` David Rientjes
  2012-06-22 20:19 ` Andrew Morton
  6 siblings, 0 replies; 12+ messages in thread
From: Kamezawa Hiroyuki @ 2012-06-16  6:55 UTC (permalink / raw)
  To: kosaki.motohiro
  Cc: linux-kernel, linux-mm, akpm, KOSAKI Motohiro, David Rientjes,
	Mel Gorman, Johannes Weiner, Minchan Kim, Wu Fengguang,
	Rik van Riel

(2012/06/15 1:16), kosaki.motohiro@gmail.com wrote:
> From: KOSAKI Motohiro<kosaki.motohiro@jp.fujitsu.com>
> 
> commit 2ff754fa8f (mm: clear pages_scanned only if draining a pcp adds pages
> to the buddy allocator again) fixed one free_pcppages_bulk() misuse. But two
> another miuse still exist.
> 
> This patch fixes it.
> 
> Cc: David Rientjes<rientjes@google.com>
> Cc: Mel Gorman<mel@csn.ul.ie>
> Cc: Johannes Weiner<hannes@cmpxchg.org>
> Cc: Minchan Kim<minchan.kim@gmail.com>
> Cc: Wu Fengguang<fengguang.wu@intel.com>
> Cc: KAMEZAWA Hiroyuki<kamezawa.hiroyu@jp.fujitsu.com>
> Cc: Rik van Riel<riel@redhat.com>
> Cc: Andrew Morton<akpm@linux-foundation.org>
> Signed-off-by: KOSAKI Motohiro<kosaki.motohiro@jp.fujitsu.com>

Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>



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

* Re: [PATCH] mm: clear pages_scanned only if draining a pcp adds pages to the buddy allocator again
  2012-06-14 16:16 [PATCH] mm: clear pages_scanned only if draining a pcp adds pages to the buddy allocator again kosaki.motohiro
                   ` (4 preceding siblings ...)
  2012-06-16  6:55 ` Kamezawa Hiroyuki
@ 2012-06-17  2:05 ` David Rientjes
  2012-06-22 20:19 ` Andrew Morton
  6 siblings, 0 replies; 12+ messages in thread
From: David Rientjes @ 2012-06-17  2:05 UTC (permalink / raw)
  To: kosaki.motohiro
  Cc: linux-kernel, linux-mm, akpm, KOSAKI Motohiro, Mel Gorman,
	Johannes Weiner, Minchan Kim, Wu Fengguang, KAMEZAWA Hiroyuki,
	Rik van Riel

On Thu, 14 Jun 2012, kosaki.motohiro@gmail.com wrote:

> From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> 
> commit 2ff754fa8f (mm: clear pages_scanned only if draining a pcp adds pages
> to the buddy allocator again) fixed one free_pcppages_bulk() misuse. But two
> another miuse still exist.
> 
> This patch fixes it.
> 
> Cc: David Rientjes <rientjes@google.com>
> Cc: Mel Gorman <mel@csn.ul.ie>
> Cc: Johannes Weiner <hannes@cmpxchg.org>
> Cc: Minchan Kim <minchan.kim@gmail.com>
> Cc: Wu Fengguang <fengguang.wu@intel.com>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Cc: Rik van Riel <riel@redhat.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>

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

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

* Re: [PATCH] mm: clear pages_scanned only if draining a pcp adds pages to the buddy allocator again
  2012-06-14 16:16 [PATCH] mm: clear pages_scanned only if draining a pcp adds pages to the buddy allocator again kosaki.motohiro
                   ` (5 preceding siblings ...)
  2012-06-17  2:05 ` David Rientjes
@ 2012-06-22 20:19 ` Andrew Morton
  2012-06-22 21:10   ` KOSAKI Motohiro
  6 siblings, 1 reply; 12+ messages in thread
From: Andrew Morton @ 2012-06-22 20:19 UTC (permalink / raw)
  To: kosaki.motohiro
  Cc: linux-kernel, linux-mm, KOSAKI Motohiro, David Rientjes,
	Mel Gorman, Johannes Weiner, Minchan Kim, Wu Fengguang,
	KAMEZAWA Hiroyuki, Rik van Riel

On Thu, 14 Jun 2012 12:16:10 -0400
kosaki.motohiro@gmail.com wrote:

> commit 2ff754fa8f (mm: clear pages_scanned only if draining a pcp adds pages
> to the buddy allocator again) fixed one free_pcppages_bulk() misuse. But two
> another miuse still exist.

This changelog is irritating.  One can understand it a bit if one
happens to have a git repo handy (and why do this to the reader?), but
the changelog for 2ff754fa8f indicates that the patch might fix a
livelock.  Is that true of this patch?  Who knows...

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

* Re: [PATCH] mm: clear pages_scanned only if draining a pcp adds pages to the buddy allocator again
  2012-06-22 20:19 ` Andrew Morton
@ 2012-06-22 21:10   ` KOSAKI Motohiro
  2012-06-22 21:39     ` Andrew Morton
  0 siblings, 1 reply; 12+ messages in thread
From: KOSAKI Motohiro @ 2012-06-22 21:10 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, linux-mm, David Rientjes, Mel Gorman,
	Johannes Weiner, Minchan Kim, Wu Fengguang, KAMEZAWA Hiroyuki,
	Rik van Riel

On Fri, Jun 22, 2012 at 4:19 PM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> On Thu, 14 Jun 2012 12:16:10 -0400
> kosaki.motohiro@gmail.com wrote:
>
>> commit 2ff754fa8f (mm: clear pages_scanned only if draining a pcp adds pages
>> to the buddy allocator again) fixed one free_pcppages_bulk() misuse. But two
>> another miuse still exist.
>
> This changelog is irritating.  One can understand it a bit if one
> happens to have a git repo handy (and why do this to the reader?), but
> the changelog for 2ff754fa8f indicates that the patch might fix a
> livelock.  Is that true of this patch?  Who knows...

The code in this simple patch speak the right usage, isn't it? And yes,
this patch also fixes a possibility of live lock. (but i haven't seen actual
live lock cause from this mistake)

When anyone find a function misuse and fixes it, He/She should confirm other
callsite and should all of mistake too. Otherwise we observe the same issue
sooner of later.

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

* Re: [PATCH] mm: clear pages_scanned only if draining a pcp adds pages to the buddy allocator again
  2012-06-22 21:10   ` KOSAKI Motohiro
@ 2012-06-22 21:39     ` Andrew Morton
  0 siblings, 0 replies; 12+ messages in thread
From: Andrew Morton @ 2012-06-22 21:39 UTC (permalink / raw)
  To: KOSAKI Motohiro
  Cc: linux-kernel, linux-mm, David Rientjes, Mel Gorman,
	Johannes Weiner, Minchan Kim, Wu Fengguang, KAMEZAWA Hiroyuki,
	Rik van Riel

On Fri, 22 Jun 2012 17:10:59 -0400
KOSAKI Motohiro <kosaki.motohiro@gmail.com> wrote:

> On Fri, Jun 22, 2012 at 4:19 PM, Andrew Morton
> <akpm@linux-foundation.org> wrote:
> > On Thu, 14 Jun 2012 12:16:10 -0400
> > kosaki.motohiro@gmail.com wrote:
> >
> >> commit 2ff754fa8f (mm: clear pages_scanned only if draining a pcp adds pages
> >> to the buddy allocator again) fixed one free_pcppages_bulk() misuse. But two
> >> another miuse still exist.
> >
> > This changelog is irritating. __One can understand it a bit if one
> > happens to have a git repo handy (and why do this to the reader?), but
> > the changelog for 2ff754fa8f indicates that the patch might fix a
> > livelock. __Is that true of this patch? __Who knows...
> 
> The code in this simple patch speak the right usage, isn't it?

It depends who is listening.

Please, put yourself in the position of poor-scmuck@linux-distro.com
who is reading your patch and wondering whether it will fix some
customer bug report he is working on.  Or wondering whether he should
backport it into his company's next kernel release.  He simply won't be
able to do this with the information which was provided here.  And if
we don't tell him, who will?

> And yes,
> this patch also fixes a possibility of live lock. (but i haven't seen actual
> live lock cause from this mistake)

hrm, I guess I'll put it in the 3.6 pile.

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

end of thread, other threads:[~2012-06-22 21:39 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-14 16:16 [PATCH] mm: clear pages_scanned only if draining a pcp adds pages to the buddy allocator again kosaki.motohiro
2012-06-14 17:46 ` Rik van Riel
2012-06-15  7:19 ` Minchan Kim
2012-06-15 15:52   ` KOSAKI Motohiro
2012-06-15 23:21     ` Minchan Kim
2012-06-15  9:24 ` Mel Gorman
2012-06-15 16:19 ` Johannes Weiner
2012-06-16  6:55 ` Kamezawa Hiroyuki
2012-06-17  2:05 ` David Rientjes
2012-06-22 20:19 ` Andrew Morton
2012-06-22 21:10   ` KOSAKI Motohiro
2012-06-22 21:39     ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).