[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1303071050080.6087@eggly.anvils>
Date: Thu, 7 Mar 2013 10:54:15 -0800 (PST)
From: Hugh Dickins <hughd@...gle.com>
To: Joonsoo Kim <iamjoonsoo.kim@....com>
cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH] mm: page_alloc: remove branch operation in
free_pages_prepare()
On Thu, 7 Mar 2013, Joonsoo Kim wrote:
> When we found that the flag has a bit of PAGE_FLAGS_CHECK_AT_PREP,
> we reset the flag. If we always reset the flag, we can reduce one
> branch operation. So remove it.
>
> Cc: Hugh Dickins <hughd@...gle.com>
> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@....com>
I don't object to this patch. But certainly I would have written it
that way in order not to dirty a cacheline unnecessarily. It may be
obvious to you that the cacheline in question is almost always already
dirty, and the branch almost always more expensive. But I'll leave that
to you, and to those who know more about these subtle costs than I do.
Hugh
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 8fcced7..778f2a9 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -614,8 +614,7 @@ static inline int free_pages_check(struct page *page)
> return 1;
> }
> page_nid_reset_last(page);
> - if (page->flags & PAGE_FLAGS_CHECK_AT_PREP)
> - page->flags &= ~PAGE_FLAGS_CHECK_AT_PREP;
> + page->flags &= ~PAGE_FLAGS_CHECK_AT_PREP;
> return 0;
> }
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists