linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/compaction: remove unnecessary order check in try_to_compact_pages()
@ 2016-06-15  6:52 Ganesh Mahendran
  2016-06-15  8:46 ` Anshuman Khandual
  0 siblings, 1 reply; 3+ messages in thread
From: Ganesh Mahendran @ 2016-06-15  6:52 UTC (permalink / raw)
  To: akpm, vbabka, iamjoonsoo.kim, mhocko, mina86, minchan
  Cc: linux-mm, linux-kernel, Ganesh Mahendran

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

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

* Re: [PATCH] mm/compaction: remove unnecessary order check in try_to_compact_pages()
  2016-06-15  6:52 [PATCH] mm/compaction: remove unnecessary order check in try_to_compact_pages() Ganesh Mahendran
@ 2016-06-15  8:46 ` Anshuman Khandual
  2016-06-24 20:58   ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Anshuman Khandual @ 2016-06-15  8:46 UTC (permalink / raw)
  To: Ganesh Mahendran, akpm, vbabka, iamjoonsoo.kim, mhocko, mina86, minchan
  Cc: linux-mm, linux-kernel

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.

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

* Re: [PATCH] mm/compaction: remove unnecessary order check in try_to_compact_pages()
  2016-06-15  8:46 ` Anshuman Khandual
@ 2016-06-24 20:58   ` Andrew Morton
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2016-06-24 20:58 UTC (permalink / raw)
  To: Anshuman Khandual
  Cc: Ganesh Mahendran, vbabka, iamjoonsoo.kim, mhocko, mina86,
	minchan, linux-mm, linux-kernel

On Wed, 15 Jun 2016 14:16:20 +0530 Anshuman Khandual <khandual@linux.vnet.ibm.com> wrote:

> 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.

I think the check in __alloc_pages_direct_compact() is OK - it's a bit
silly to do a (small) bunch of additional work in
__alloc_pages_direct_compact() when orer==0.

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

end of thread, other threads:[~2016-06-24 20:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-15  6:52 [PATCH] mm/compaction: remove unnecessary order check in try_to_compact_pages() Ganesh Mahendran
2016-06-15  8:46 ` Anshuman Khandual
2016-06-24 20:58   ` 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).