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


Groups > linux.kernel > #1422674 > unrolled thread

[PATCH] mm/compaction: remove unnecessary order check in try_to_compact_pages()

Started byGanesh Mahendran <opensource.ganesh@gmail.com>
First post2016-06-15 09:00 +0200
Last post2016-06-15 10:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] mm/compaction: remove unnecessary order check in try_to_compact_pages() Ganesh Mahendran <opensource.ganesh@gmail.com> - 2016-06-15 09:00 +0200
    Re: [PATCH] mm/compaction: remove unnecessary order check in try_to_compact_pages() Anshuman Khandual <khandual@linux.vnet.ibm.com> - 2016-06-15 10:50 +0200

#1422674 — [PATCH] mm/compaction: remove unnecessary order check in try_to_compact_pages()

FromGanesh Mahendran <opensource.ganesh@gmail.com>
Date2016-06-15 09:00 +0200
Subject[PATCH] mm/compaction: remove unnecessary order check in try_to_compact_pages()
Message-ID<rKcXT-7xD-7@gated-at.bofh.it>
The caller __alloc_pages_direct_compact() already check (order == 0).
So no need to check again.

Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com>
---
 mm/compaction.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/compaction.c b/mm/compaction.c
index fbb7b38..500acda 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -1687,7 +1687,7 @@ enum compact_result try_to_compact_pages(gfp_t gfp_mask, unsigned int order,
 	*contended = COMPACT_CONTENDED_NONE;
 
 	/* Check if the GFP flags allow compaction */
-	if (!order || !may_enter_fs || !may_perform_io)
+	if (!may_enter_fs || !may_perform_io)
 		return COMPACT_SKIPPED;
 
 	trace_mm_compaction_try_to_compact_pages(order, gfp_mask, mode);
-- 
1.9.1

[toc] | [next] | [standalone]


#1422788

FromAnshuman Khandual <khandual@linux.vnet.ibm.com>
Date2016-06-15 10:50 +0200
Message-ID<rKeGl-ez-1@gated-at.bofh.it>
In reply to#1422674
On 06/15/2016 12:22 PM, Ganesh Mahendran wrote:
> The caller __alloc_pages_direct_compact() already check (order == 0).
> So no need to check again.

Yeah, the caller (__alloc_pages_direct_compact) checks if the order of
allocation is 0. But we can remove it there and keep it in here as this
is the actual entry point for direct page compaction.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web