[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170612114800.GJ7476@dhcp22.suse.cz>
Date: Mon, 12 Jun 2017 13:48:01 +0200
From: Michal Hocko <mhocko@...nel.org>
To: Vlastimil Babka <vbabka@...e.cz>
Cc: linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
Xishi Qiu <qiuxishi@...wei.com>,
zhong jiang <zhongjiang@...wei.com>,
Joonsoo Kim <js1304@...il.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH 4/4] hugetlb: add support for preferred node to
alloc_huge_page_nodemask
On Mon 12-06-17 11:06:56, Michal Hocko wrote:
[...]
> @@ -1723,29 +1729,26 @@ struct page *alloc_huge_page_node(struct hstate *h, int nid)
> return page;
> }
>
> -struct page *alloc_huge_page_nodemask(struct hstate *h, const nodemask_t *nmask)
> +struct page *alloc_huge_page_nodemask(struct hstate *h, int preferred_nid,
> + nodemask_t *nmask)
> {
> struct page *page = NULL;
> - int node;
>
> spin_lock(&hugetlb_lock);
> if (h->free_huge_pages - h->resv_huge_pages > 0) {
> - for_each_node_mask(node, *nmask) {
> - page = dequeue_huge_page_node_exact(h, node);
> - if (page)
> - break;
> - }
> + page = dequeue_huge_page_nodemask(h, preferred_nid, nmask);
> + if (page)
> + goto unlock;
> }
> +unlock:
> spin_unlock(&hugetlb_lock);
> if (page)
> return page;
>
> /* No reservations, try to overcommit */
> - for_each_node_mask(node, *nmask) {
> - page = __alloc_buddy_huge_page_no_mpol(h, node);
> - if (page)
> - return page;
> - }
> + page = __alloc_buddy_huge_page_no_mpol(h, preferred_nid);
> + if (page)
> + return page;
I was too quick. The fallback allocation needs some more love. I am
working on this but it quickly gets quite hairy so let's see whether
this still can converge to something reasonable.
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists