Received: by 10.223.185.116 with SMTP id b49csp654031wrg; Wed, 21 Feb 2018 04:54:41 -0800 (PST) X-Google-Smtp-Source: AH8x224oLglgj0/wQiNHkg755K3yna7U8W8pc1/5hZs7VJi6M5GayeDMXPb3/44c/PCx88VzMAAF X-Received: by 10.98.185.24 with SMTP id z24mr3227254pfe.185.1519217681570; Wed, 21 Feb 2018 04:54:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519217681; cv=none; d=google.com; s=arc-20160816; b=N95T6LkG2svyxlJB4KcQmBBe5VyUbpSIMFOnOyk786tPY2lpXz4oCYDgRt4nFxngez /6cQODtFLqhsv3NEMybbAFOZOrSBqDz40UnnO5zWzOo3PD+SVmmGp8OKFLJo3yJmJXTw 6sxeID80UrINKUQrIvPEQjSRBeflTIVOQQwjgryAmcPVAypNcrhBhtq1NEH24hn0g5fP Z81OJo4Rak0KBSLFRl00/RqZnlHsaopAyex3bF8YUa38LeAXXOE4wJl9zlZ0Sgc079aK LDkfJ5Uz8ENNh/i41g7CYYHEhk98Ae3abgBfywBam9rAZ/lmlhx632j6fz5k7UqNI1Ho tskQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=Mt130aCMwN/l8BPbTrAl04+u9+rz/8SSQf9Ud4yhKKc=; b=zH/gez2iI0ki8rsXkawgsLGLUS8O+YGETB14Tbo08u8JeDrBab7na9BYvZFOsgdw6k J+njxM0ONjipVEMvJHA8MCOVpsSTehiLQGlOFnQ3O7U4AKFgcKHBvhBHDHEPd8gt3yGL xB4KxDuK/wkSv1u4g6AjZGRAaUykds90/qHS+w+r/sjSUhjSuE9QxgByS53yqnsEfRtW ede0i1rO2nqBrFzyiCYlsZxSZp11QwROWGeeO7CZI1eHkQkMlXX9LhaIZj8ZbAjhyHm4 l2L20kjDVEvrXtN8lLY0qDRdXyo8BMZfXbPX7iJbbQq77i33STXb7dH4NMLsnLaIm03a Ciag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s36-v6si2853087pld.175.2018.02.21.04.54.27; Wed, 21 Feb 2018 04:54:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753473AbeBUJz3 (ORCPT + 99 others); Wed, 21 Feb 2018 04:55:29 -0500 Received: from mx2.suse.de ([195.135.220.15]:56375 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752656AbeBUJz2 (ORCPT ); Wed, 21 Feb 2018 04:55:28 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 1C55DAD7C; Wed, 21 Feb 2018 09:55:27 +0000 (UTC) Date: Wed, 21 Feb 2018 10:55:26 +0100 From: Michal Hocko To: Dan Rue Cc: Andrew Morton , linux-mm@kvack.org, Mike Kravetz , Naoya Horiguchi , LKML Subject: Re: [PATCH 5/6] mm, hugetlb: further simplify hugetlb allocation API Message-ID: <20180221095526.GB2231@dhcp22.suse.cz> References: <20180103093213.26329-1-mhocko@kernel.org> <20180103093213.26329-6-mhocko@kernel.org> <20180221042457.uolmhlmv5je5dqx7@xps> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180221042457.uolmhlmv5je5dqx7@xps> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 20-02-18 22:24:57, Dan Rue wrote: > On Wed, Jan 03, 2018 at 10:32:12AM +0100, Michal Hocko wrote: > > From: Michal Hocko > > > > Hugetlb allocator has several layer of allocation functions depending > > and the purpose of the allocation. There are two allocators depending > > on whether the page can be allocated from the page allocator or we need > > a contiguous allocator. This is currently opencoded in alloc_fresh_huge_page > > which is the only path that might allocate giga pages which require the > > later allocator. Create alloc_fresh_huge_page which hides this > > implementation detail and use it in all callers which hardcoded the > > buddy allocator path (__hugetlb_alloc_buddy_huge_page). This shouldn't > > introduce any funtional change because both migration and surplus > > allocators exlude giga pages explicitly. > > > > While we are at it let's do some renaming. The current scheme is not > > consistent and overly painfull to read and understand. Get rid of prefix > > underscores from most functions. There is no real reason to make names > > longer. > > * alloc_fresh_huge_page is the new layer to abstract underlying > > allocator > > * __hugetlb_alloc_buddy_huge_page becomes shorter and neater > > alloc_buddy_huge_page. > > * Former alloc_fresh_huge_page becomes alloc_pool_huge_page because we put > > the new page directly to the pool > > * alloc_surplus_huge_page can drop the opencoded prep_new_huge_page code > > as it uses alloc_fresh_huge_page now > > * others lose their excessive prefix underscores to make names shorter > > Hi Michal - > > We (Linaro) run the libhugetlbfs test suite continuously against > mainline and recently (Feb 1), the 'counters' test started failing on > with the following error: > > root@localhost:~# mount_point="/mnt/hugetlb/" > root@localhost:~# echo 200 > /proc/sys/vm/nr_hugepages > root@localhost:~# mkdir -p "${mount_point}" > root@localhost:~# mount -t hugetlbfs hugetlbfs "${mount_point}" > root@localhost:~# export LD_LIBRARY_PATH=/root/libhugetlbfs/libhugetlbfs-2.20/obj64 > root@localhost:~# /root/libhugetlbfs/libhugetlbfs-2.20/tests/obj64/counters > Starting testcase "/root/libhugetlbfs/libhugetlbfs-2.20/tests/obj64/counters", pid 3319 > Base pool size: 0 > Clean... > FAIL Line 326: Bad HugePages_Total: expected 0, actual 1 > > Line 326 refers to the test source @ > https://github.com/libhugetlbfs/libhugetlbfs/blob/master/tests/counters.c#L326 Thanks for the report. I am fighting to get hugetlb tests working. My previous deployment is gone and the new git snapshot fails to build. I will look into it further but ... > I bisected the failure to this commit. The problem is seen on multiple > architectures (tested x86-64 and arm64). The patch shouldn't have introduced any functional changes IIRC. But let me have a look -- Michal Hocko SUSE Labs