From: Vlastimil Babka <vbabka@suse.cz>
To: Arun KS <arunks@codeaurora.org>,
kys@microsoft.com, haiyangz@microsoft.com,
sthemmin@microsoft.com, boris.ostrovsky@oracle.com,
jgross@suse.com, akpm@linux-foundation.org,
dan.j.williams@intel.com, mhocko@suse.com,
iamjoonsoo.kim@lge.com, osalvador@suse.de, malat@debian.org,
yasu.isimatu@gmail.com, devel@linuxdriverproject.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
xen-devel@lists.xenproject.org
Cc: vatsa@codeaurora.org, vinmenon@codeaurora.org, getarunks@gmail.com
Subject: Re: [PATCH v2] memory_hotplug: Free pages as higher order
Date: Tue, 25 Sep 2018 11:59:09 +0200 [thread overview]
Message-ID: <ccdbaf76-cbdd-759e-c6de-c5b738f156e9@suse.cz> (raw)
In-Reply-To: <1537854158-9766-1-git-send-email-arunks@codeaurora.org>
On 9/25/18 7:42 AM, Arun KS wrote:
> When free pages are done with higher order, time spend on
> coalescing pages by buddy allocator can be reduced. With
> section size of 256MB, hot add latency of a single section
> shows improvement from 50-60 ms to less than 1 ms, hence
> improving the hot add latency by 60%.
>
> Modify external providers of online callback to align with
> the change.
>
> Signed-off-by: Arun KS <arunks@codeaurora.org>
Hi,
> @@ -655,26 +655,53 @@ void __online_page_free(struct page *page)
> }
> EXPORT_SYMBOL_GPL(__online_page_free);
>
> -static void generic_online_page(struct page *page)
> +static int generic_online_page(struct page *page, unsigned int order)
> {
> - __online_page_set_limits(page);
> - __online_page_increment_counters(page);
> - __online_page_free(page);
> + unsigned long nr_pages = 1 << order;
> + struct page *p = page;
> + unsigned int loop;
> +
> + for (loop = 0 ; loop < nr_pages ; loop++, p++) {
> + __ClearPageReserved(p);
> + set_page_count(p, 0);
> + }
> +
> + adjust_managed_page_count(page, nr_pages);
> + set_page_refcounted(page);
> + __free_pages(page, order);
> +
> + return 0;
This seems like almost complete copy of __free_pages_boot_core(), could
you do some code reuse instead? I think Michal Hocko also suggested that.
Thanks,
Vlastimil
next prev parent reply other threads:[~2018-09-25 9:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-25 5:42 [PATCH v2] memory_hotplug: Free pages as higher order Arun KS
2018-09-25 9:59 ` Vlastimil Babka [this message]
2018-09-25 18:18 ` Michal Hocko
2018-09-26 10:57 ` Arun KS
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=ccdbaf76-cbdd-759e-c6de-c5b738f156e9@suse.cz \
--to=vbabka@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=arunks@codeaurora.org \
--cc=boris.ostrovsky@oracle.com \
--cc=dan.j.williams@intel.com \
--cc=devel@linuxdriverproject.org \
--cc=getarunks@gmail.com \
--cc=haiyangz@microsoft.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=jgross@suse.com \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=malat@debian.org \
--cc=mhocko@suse.com \
--cc=osalvador@suse.de \
--cc=sthemmin@microsoft.com \
--cc=vatsa@codeaurora.org \
--cc=vinmenon@codeaurora.org \
--cc=xen-devel@lists.xenproject.org \
--cc=yasu.isimatu@gmail.com \
/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).