From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f199.google.com (mail-wr0-f199.google.com [209.85.128.199]) by kanga.kvack.org (Postfix) with ESMTP id E82746B0279 for ; Mon, 12 Jun 2017 05:06:59 -0400 (EDT) Received: by mail-wr0-f199.google.com with SMTP id v102so21535321wrc.8 for ; Mon, 12 Jun 2017 02:06:59 -0700 (PDT) Received: from mx1.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id l123si7258641wml.156.2017.06.12.02.06.58 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 12 Jun 2017 02:06:58 -0700 (PDT) Date: Mon, 12 Jun 2017 11:06:56 +0200 From: Michal Hocko Subject: Re: [RFC PATCH 4/4] hugetlb: add support for preferred node to alloc_huge_page_nodemask Message-ID: <20170612090656.GD7476@dhcp22.suse.cz> References: <20170608074553.22152-1-mhocko@kernel.org> <20170608074553.22152-5-mhocko@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: Vlastimil Babka Cc: linux-mm@kvack.org, Andrew Morton , Naoya Horiguchi , Xishi Qiu , zhong jiang , Joonsoo Kim , LKML On Thu 08-06-17 10:38:06, Vlastimil Babka wrote: > On 06/08/2017 09:45 AM, Michal Hocko wrote: > > From: Michal Hocko > > > > alloc_huge_page_nodemask tries to allocate from any numa node in the > > allowed node mask. This might lead to filling up low NUMA nodes while > > others are not used. We can reduce this risk by introducing a concept > > of the preferred node similar to what we have in the regular page > > allocator. We will start allocating from the preferred nid and then > > iterate over all allowed nodes until we try them all. Introduce > > for_each_node_mask_preferred helper which does the iteration and reuse > > the available preferred node in new_page_nodemask which is currently > > the only caller of alloc_huge_page_nodemask. > > > > Signed-off-by: Michal Hocko > > That's better, yeah. I don't think it would be too hard to use a > zonelist though. What do others think? OK, so I've given it a try. This is untested yet but it doesn't look all that bad. dequeue_huge_page_node will most proably see some clean up on top but I've kept it for simplicity for now. ---