Received: by 10.223.176.46 with SMTP id f43csp506243wra; Wed, 24 Jan 2018 01:28:25 -0800 (PST) X-Google-Smtp-Source: AH8x224JUMA4FbD1e+hygV9yRbDqDc5L1dYiwknz5YvXuJYibiVjRjIaSgC8n5ESNgz5fpIdvyRY X-Received: by 10.98.70.18 with SMTP id t18mr12508815pfa.14.1516786105209; Wed, 24 Jan 2018 01:28:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516786105; cv=none; d=google.com; s=arc-20160816; b=d52+i1HKFWanCIN8xz8FiHnxPfYmKj7tA3yASKkpnF19V8tpcqulbIlr9I7TVknTOU wcQb5CvZvz1NooawtSke2m+Ls3NKZivEuMmGQ7OK0WiuoALhgh3132FeKaAkYu2PtrsY HMrWYlVLj7M0kSdeD3VJGjnMDwcVme1kUWO428VmRvoyVeF2hcbh7b56XmKEgVr2rysp NtMeT+W/Q79fWop4UBQPe5Jkop/pGZMgywZ3nMw8uRtckTQrCyHUloLjz+y/qhtX+3xX vBVBJMHR5iLoNcnEPU3SX/O/zY2bVTmIRTmjUwG/oy3Iqn21GG7MdBv633WrXad/X0j8 PM1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=neH9+AUAIlzbPjZYqaT6OOzhrCoEommy5sIpN1Y0TZI=; b=I+bH9qD4EO0tHD5dD08JebRyrHnuBgycPL0NbGQR67Bb7vMetVoyYqfj9VCrhPCifA PJByqyaZbQJbT/Lb/ih5UEnLED+KDw15BdBg/NIqf+Rm01uZ6mctbN9AggyURAJMroHH ljJMG7a6XmbaxzR06VpMbMdE0yfOEn4ErYwq9E4ndtWV/xQLASoOHKVszXyvXokgcnQ2 DxtgV3CrTcYC94VyNHZ5bulbq/9KC/1bri4wjByVEXsaICAi6ZMxK18Seso2RF8H3OxF gcy4ix1wutViBcN9f4fqqVAxhY2E+aqc2T+O2ODOMExW0qGIm8nbjD05dBNOPuTb9vur h2CA== 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 d18si2625645pfb.16.2018.01.24.01.28.11; Wed, 24 Jan 2018 01:28:25 -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 S932698AbeAXJ1h (ORCPT + 99 others); Wed, 24 Jan 2018 04:27:37 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:26270 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932534AbeAXJ1f (ORCPT ); Wed, 24 Jan 2018 04:27:35 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 3zRKZN1Xzjz9ttrZ; Wed, 24 Jan 2018 10:27:24 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id elKGCh74iCMx; Wed, 24 Jan 2018 10:27:24 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 3zRKZN12DJz9ttrY; Wed, 24 Jan 2018 10:27:24 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 7F4A98B86E; Wed, 24 Jan 2018 10:27:34 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id ErjmzQdV4IY3; Wed, 24 Jan 2018 10:27:34 +0100 (CET) Received: from PO15451 (po15451.idsi0.si.c-s.fr [172.25.231.40]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 58E888B867; Wed, 24 Jan 2018 10:27:34 +0100 (CET) Subject: Re: [PATCH v3 5/5] powerpc/mm: Fix growth direction for hugepages mmaps with slice To: "Aneesh Kumar K.V" , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Scott Wood Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org References: <6920f6efe2dcdabf59350b2d31ee6bd4bdef57f4.1516783089.git.christophe.leroy@c-s.fr> <362a93307a09b521878c47a8999a39a228184293.1516783089.git.christophe.leroy@c-s.fr> From: Christophe LEROY Message-ID: Date: Wed, 24 Jan 2018 10:27:33 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 24/01/2018 à 10:15, Aneesh Kumar K.V a écrit : > > > On 01/24/2018 02:32 PM, Christophe Leroy wrote: >> An application running with libhugetlbfs fails to allocate >> additional pages to HEAP due to the hugemap being done >> inconditionally as topdown mapping: >> >> mmap(0x10080000, 1572864, PROT_READ|PROT_WRITE, >> MAP_PRIVATE|MAP_ANONYMOUS|0x40000, -1, 0) = 0x73e80000 >> [...] >> mmap(0x74000000, 1048576, PROT_READ|PROT_WRITE, >> MAP_PRIVATE|MAP_ANONYMOUS|0x40000, -1, 0x180000) = 0x73d80000 >> munmap(0x73d80000, 1048576)             = 0 >> [...] >> mmap(0x74000000, 1572864, PROT_READ|PROT_WRITE, >> MAP_PRIVATE|MAP_ANONYMOUS|0x40000, -1, 0x180000) = 0x73d00000 >> munmap(0x73d00000, 1572864)             = 0 >> [...] >> mmap(0x74000000, 1572864, PROT_READ|PROT_WRITE, >> MAP_PRIVATE|MAP_ANONYMOUS|0x40000, -1, 0x180000) = 0x73d00000 >> munmap(0x73d00000, 1572864)             = 0 >> [...] >> >> As one can see from the above strace log, mmap() allocates further >> pages below the initial one because no space is available on top of it. >> >> This patch fixes it by requesting bottomup mapping as the non >> generic hugetlb_get_unmapped_area() does >> >> Fixes: d0f13e3c20b6f ("[POWERPC] Introduce address space "slices" ") >> Signed-off-by: Christophe Leroy >> --- >>   v3: Was a standalone patch before, but conflicts with this serie. >> >>   arch/powerpc/mm/hugetlbpage.c | 2 +- >>   1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/arch/powerpc/mm/hugetlbpage.c >> b/arch/powerpc/mm/hugetlbpage.c >> index 79e1378ee303..368ea6b248ad 100644 >> --- a/arch/powerpc/mm/hugetlbpage.c >> +++ b/arch/powerpc/mm/hugetlbpage.c >> @@ -558,7 +558,7 @@ unsigned long hugetlb_get_unmapped_area(struct >> file *file, unsigned long addr, >>           return radix__hugetlb_get_unmapped_area(file, addr, len, >>                                  pgoff, flags); >>   #endif >> -    return slice_get_unmapped_area(addr, len, flags, mmu_psize, 1); >> +    return slice_get_unmapped_area(addr, len, flags, mmu_psize, 0); >>   } >>   #endif > > Why make this change also for PPC64? Can you do this #ifdef 8xx?.You can > ideally move hugetlb_get_unmapped_area to slice.h and then make this > much simpler for 8xxx? > Did you try with HUGETLB_MORECORE_HEAPBASE=0x11000000 on PPC64 as I suggested in my last email on this subject (22/01/2018 9:22) ? Before doing anything specific to the PPC32/8xx, I'd like to be sure the issue is definitly only on PPC32. Thanks, Christophe