[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ccdbaf76-cbdd-759e-c6de-c5b738f156e9@suse.cz>
Date: Tue, 25 Sep 2018 11:59:09 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: Arun KS <arunks@...eaurora.org>, kys@...rosoft.com,
haiyangz@...rosoft.com, sthemmin@...rosoft.com,
boris.ostrovsky@...cle.com, jgross@...e.com,
akpm@...ux-foundation.org, dan.j.williams@...el.com,
mhocko@...e.com, iamjoonsoo.kim@....com, osalvador@...e.de,
malat@...ian.org, yasu.isimatu@...il.com,
devel@...uxdriverproject.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, xen-devel@...ts.xenproject.org
Cc: vatsa@...eaurora.org, vinmenon@...eaurora.org, getarunks@...il.com
Subject: Re: [PATCH v2] memory_hotplug: Free pages as higher order
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@...eaurora.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
Powered by blists - more mailing lists