From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: Sasha Levin <sasha.levin@oracle.com>
Cc: linux-kernel@vger.kernel.org, mhocko@suse.cz,
Andrew Morton <akpm@linux-foundation.org>,
Mel Gorman <mgorman@suse.de>, Vlastimil Babka <vbabka@suse.cz>,
Johannes Weiner <hannes@cmpxchg.org>,
David Rientjes <rientjes@google.com>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
linux-mm@kvack.org (open list:MEMORY MANAGEMENT)
Subject: Re: [PATCH 2/2] mm: __free_pages batch up 0-order pages for freeing
Date: Wed, 01 Apr 2015 14:48:13 +0200 [thread overview]
Message-ID: <87wq1w10c2.fsf@rasmusvillemoes.dk> (raw)
In-Reply-To: <1427839895-16434-2-git-send-email-sasha.levin@oracle.com> (Sasha Levin's message of "Tue, 31 Mar 2015 18:11:33 -0400")
On Wed, Apr 01 2015, Sasha Levin <sasha.levin@oracle.com> wrote:
> Rather than calling free_hot_cold_page() for every page, batch them up in a
> list and pass them on to free_hot_cold_page_list(). This will let us defer
> them to a workqueue.
>
> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
> ---
> mm/page_alloc.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 812ca75..e58e795 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -2997,12 +2997,16 @@ EXPORT_SYMBOL(get_zeroed_page);
>
> void __free_pages(struct page *page, unsigned int order)
> {
> + LIST_HEAD(hot_cold_pages);
> +
> if (put_page_testzero(page)) {
> if (order == 0)
> - free_hot_cold_page(page, false);
> + list_add(&page->lru, &hot_cold_pages);
> else
> __free_pages_ok(page, order);
> }
> +
> + free_hot_cold_page_list(&hot_cold_pages, false);
Is there a reason to do this function call when the list is empty? In
other words, why can't this just be done inside the if (order == 0)?
Rasmus
next prev parent reply other threads:[~2015-04-01 12:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-31 22:11 [PATCH 1/2] mm: free large amount of 0-order pages in workqueue Sasha Levin
2015-03-31 22:11 ` [PATCH 2/2] mm: __free_pages batch up 0-order pages for freeing Sasha Levin
2015-04-01 12:48 ` Rasmus Villemoes [this message]
2015-03-31 22:31 ` [PATCH 1/2] mm: free large amount of 0-order pages in workqueue Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wq1w10c2.fsf@rasmusvillemoes.dk \
--to=linux@rasmusvillemoes.dk \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mhocko@suse.cz \
--cc=rientjes@google.com \
--cc=sasha.levin@oracle.com \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).