lkml.org 
[lkml]   [2016]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] mm/compaction: remove unnecessary order check in direct compact path
On Thu 16-06-16 10:42:36, Ganesh Mahendran wrote:
> In direct compact path, both __alloc_pages_direct_compact and
> try_to_compact_pages check (order == 0).
>
> This patch removes the check in __alloc_pages_direct_compact() and
> move the modifying of current->flags to the entry point of direct
> page compaction where we really do the compaction.

I do not have strong opinion on whether the order should be checked at
try_to_compact_pages or __alloc_pages_direct_compact. The later one
sounds more suitable because no further steps are really appropriate for
order == 0. try_to_compact_pages is not used anywhere else to be order
aware (maybe it will in future, who knows). But this all is a matter of
taste.

[...]
> diff --git a/mm/compaction.c b/mm/compaction.c
> index fbb7b38..dcfaf57 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -1686,12 +1686,16 @@ 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 */
> + /*
> + * Check if this is an order-0 request and
> + * if the GFP flags allow compaction.
> + */

If you are touching this comment then it would be appropriate to change
it from "what is checked" into "why it is checked" because that is far
from obvious from this context. Especially !fs/io part.

> if (!order || !may_enter_fs || !may_perform_io)
> return COMPACT_SKIPPED;
>

That being said, I am not really sure the patch is an improvement. If
anything I would much rather see the above comment updated.

Thanks!
--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2016-06-16 13:01    [W:0.060 / U:4.936 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site