From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752053AbdFOAMt (ORCPT ); Wed, 14 Jun 2017 20:12:49 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:20894 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750768AbdFOAMr (ORCPT ); Wed, 14 Jun 2017 20:12:47 -0400 Subject: Re: [RFC PATCH 2/4] hugetlb: add support for preferred node to alloc_huge_page_nodemask To: Michal Hocko , linux-mm@kvack.org References: <20170613090039.14393-1-mhocko@kernel.org> <20170613090039.14393-3-mhocko@kernel.org> Cc: Naoya Horiguchi , Mel Gorman , Vlastimil Babka , Andrew Morton , LKML , Michal Hocko From: Mike Kravetz Message-ID: <3ac3d6a8-b62f-2386-cb04-f32b3bebffe7@oracle.com> Date: Wed, 14 Jun 2017 17:12:31 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/14/2017 03:12 PM, Mike Kravetz wrote: > On 06/13/2017 02:00 AM, Michal Hocko wrote: >> From: Michal Hocko >> >> alloc_huge_page_nodemask tries to allocate from any numa node in the >> allowed node mask starting from lower numa nodes. This might lead to >> filling up those 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 in the zonelist >> order until we try them all. >> >> This is mimicking the page allocator logic except it operates on >> per-node mempools. dequeue_huge_page_vma already does this so distill >> the zonelist logic into a more generic dequeue_huge_page_nodemask >> and use it in alloc_huge_page_nodemask. >> >> Signed-off-by: Michal Hocko >> --- > > > I built attempts/hugetlb-zonelists, threw it on a test machine, ran the > libhugetlbfs test suite and saw failures. The failures started with this > patch: commit 7e8b09f14495 in your tree. I have not yet started to look > into the failures. It is even possible that the tests are making bad > assumptions, but there certainly appears to be changes in behavior visible > to the application(s). nm. The failures were the result of dequeue_huge_page_nodemask() always returning NULL. Vlastimil already noticed this issue and provided a solution. -- Mike Kravetz > > FYI - My 'test machine' is an x86 KVM insatnce with 8GB memory simulating > 2 nodes. Huge page allocations before running tests: > node0 > 512 free_hugepages > 512 nr_hugepages > 0 surplus_hugepages > node1 > 512 free_hugepages > 512 nr_hugepages > 0 surplus_hugepages > > I can take a closer look at the failures tomorrow. >