Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1245276 > unrolled thread

[PATCH V2] mm, page_alloc: reserve pageblocks for high-order atomic allocations on demand -fix

Started byyalin wang <yalin.wang2010@gmail.com>
First post2015-10-13 03:50 +0200
Last post2015-10-14 04:40 +0200
Articles 4 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH V2] mm, page_alloc: reserve pageblocks for high-order atomic allocations on demand -fix yalin wang <yalin.wang2010@gmail.com> - 2015-10-13 03:50 +0200
    Re: [PATCH V2] mm, page_alloc: reserve pageblocks for high-order  atomic allocations on demand -fix Vlastimil Babka <vbabka@suse.cz> - 2015-10-13 09:30 +0200
    Re: [PATCH V2] mm, page_alloc: reserve pageblocks for high-order  atomic allocations on demand -fix "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-10-13 11:10 +0200
    Re: [PATCH V2] mm, page_alloc: reserve pageblocks for high-order  atomic allocations on demand -fix David Rientjes <rientjes@google.com> - 2015-10-14 04:40 +0200

#1245276 — [PATCH V2] mm, page_alloc: reserve pageblocks for high-order atomic allocations on demand -fix

Fromyalin wang <yalin.wang2010@gmail.com>
Date2015-10-13 03:50 +0200
Subject[PATCH V2] mm, page_alloc: reserve pageblocks for high-order atomic allocations on demand -fix
Message-ID<qiWSZ-4U-15@gated-at.bofh.it>
There is a redundant check and a memory leak introduced by a patch in
mmotm. This patch removes an unlikely(order) check as we are sure order
is not zero at the time. It also checks if a page is already allocated
to avoid a memory leak.

This is a fix to the mmotm patch
mm-page_alloc-reserve-pageblocks-for-high-order-atomic-allocations-on-demand.patch

Signed-off-by: yalin wang <yalin.wang2010@gmail.com>
Acked-by: Mel Gorman <mgorman@techsingularity.net>
---
 mm/page_alloc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 0d6f540..043b691 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2241,13 +2241,13 @@ struct page *buffered_rmqueue(struct zone *preferred_zone,
 		spin_lock_irqsave(&zone->lock, flags);
 
 		page = NULL;
-		if (unlikely(order) && (alloc_flags & ALLOC_HARDER)) {
+		if (alloc_flags & ALLOC_HARDER) {
 			page = __rmqueue_smallest(zone, order, MIGRATE_HIGHATOMIC);
 			if (page)
 				trace_mm_page_alloc_zone_locked(page, order, migratetype);
 		}
-
-		page = __rmqueue(zone, order, migratetype, gfp_flags);
+		if (!page)
+			page = __rmqueue(zone, order, migratetype, gfp_flags);
 		spin_unlock(&zone->lock);
 		if (!page)
 			goto failed;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1245408 — Re: [PATCH V2] mm, page_alloc: reserve pageblocks for high-order atomic allocations on demand -fix

FromVlastimil Babka <vbabka@suse.cz>
Date2015-10-13 09:30 +0200
SubjectRe: [PATCH V2] mm, page_alloc: reserve pageblocks for high-order atomic allocations on demand -fix
Message-ID<qj2c2-80M-9@gated-at.bofh.it>
In reply to#1245276
On 10/13/2015 03:42 AM, yalin wang wrote:
> There is a redundant check and a memory leak introduced by a patch in
> mmotm. This patch removes an unlikely(order) check as we are sure order
> is not zero at the time. It also checks if a page is already allocated
> to avoid a memory leak.
>
> This is a fix to the mmotm patch
> mm-page_alloc-reserve-pageblocks-for-high-order-atomic-allocations-on-demand.patch
>
> Signed-off-by: yalin wang <yalin.wang2010@gmail.com>
> Acked-by: Mel Gorman <mgorman@techsingularity.net>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

> ---
>   mm/page_alloc.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 0d6f540..043b691 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -2241,13 +2241,13 @@ struct page *buffered_rmqueue(struct zone *preferred_zone,
>   		spin_lock_irqsave(&zone->lock, flags);
>
>   		page = NULL;
> -		if (unlikely(order) && (alloc_flags & ALLOC_HARDER)) {
> +		if (alloc_flags & ALLOC_HARDER) {
>   			page = __rmqueue_smallest(zone, order, MIGRATE_HIGHATOMIC);
>   			if (page)
>   				trace_mm_page_alloc_zone_locked(page, order, migratetype);
>   		}
> -
> -		page = __rmqueue(zone, order, migratetype, gfp_flags);
> +		if (!page)
> +			page = __rmqueue(zone, order, migratetype, gfp_flags);
>   		spin_unlock(&zone->lock);
>   		if (!page)
>   			goto failed;
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1245485 — Re: [PATCH V2] mm, page_alloc: reserve pageblocks for high-order atomic allocations on demand -fix

From"Kirill A. Shutemov" <kirill@shutemov.name>
Date2015-10-13 11:10 +0200
SubjectRe: [PATCH V2] mm, page_alloc: reserve pageblocks for high-order atomic allocations on demand -fix
Message-ID<qj3KO-1Wm-27@gated-at.bofh.it>
In reply to#1245276
On Tue, Oct 13, 2015 at 09:42:24AM +0800, yalin wang wrote:
> There is a redundant check and a memory leak introduced by a patch in
> mmotm. This patch removes an unlikely(order) check as we are sure order
> is not zero at the time. It also checks if a page is already allocated
> to avoid a memory leak.
> 
> This is a fix to the mmotm patch
> mm-page_alloc-reserve-pageblocks-for-high-order-atomic-allocations-on-demand.patch
> 
> Signed-off-by: yalin wang <yalin.wang2010@gmail.com>
> Acked-by: Mel Gorman <mgorman@techsingularity.net>

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

-- 
 Kirill A. Shutemov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1246264 — Re: [PATCH V2] mm, page_alloc: reserve pageblocks for high-order atomic allocations on demand -fix

FromDavid Rientjes <rientjes@google.com>
Date2015-10-14 04:40 +0200
SubjectRe: [PATCH V2] mm, page_alloc: reserve pageblocks for high-order atomic allocations on demand -fix
Message-ID<qjk8V-1uB-7@gated-at.bofh.it>
In reply to#1245276
On Tue, 13 Oct 2015, yalin wang wrote:

> There is a redundant check and a memory leak introduced by a patch in
> mmotm. This patch removes an unlikely(order) check as we are sure order
> is not zero at the time. It also checks if a page is already allocated
> to avoid a memory leak.
> 
> This is a fix to the mmotm patch
> mm-page_alloc-reserve-pageblocks-for-high-order-atomic-allocations-on-demand.patch
> 
> Signed-off-by: yalin wang <yalin.wang2010@gmail.com>
> Acked-by: Mel Gorman <mgorman@techsingularity.net>

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

Cool find!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web