Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751430AbeAQDTN (ORCPT + 1 other); Tue, 16 Jan 2018 22:19:13 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:41490 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750811AbeAQDTM (ORCPT ); Tue, 16 Jan 2018 22:19:12 -0500 Subject: Re: [PATCH v2] powerpc/mm: Fix growth direction for hugepages mmaps with slice To: Christophe LEROY , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Scott Wood Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <20180109101810.2471D6C6CF@localhost.localdomain> <87wp0haizf.fsf@linux.vnet.ibm.com> From: "Aneesh Kumar K.V" Date: Wed, 17 Jan 2018 08:49:03 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; 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: en-US Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 18011703-8235-0000-0000-00000CE151C8 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008392; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000246; SDB=6.00976128; UDB=6.00494799; IPR=6.00756056; BA=6.00005781; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00019084; XFM=3.00000015; UTC=2018-01-17 03:19:10 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18011703-8236-0000-0000-00003F478E0E Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-17_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801170046 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 01/16/2018 10:18 PM, Christophe LEROY wrote: > > > Le 16/01/2018 à 17:03, Aneesh Kumar K.V a écrit : >> Christophe Leroy writes: >> >>> 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 >>> [...] >>> >> >> Can you explain the failure details above. I am not sure I understand >> what to read from the above output. > > libhugetlbfs first requests an area of size 1.5Mbytes, at address > 0x10080000 > mmap() returns an area at address 0x73e80000 > > Then libhugetlbfs requests an additional area on top of that, ie at > address 0x74000000, to expand the heap. > But mmap() returns an area at address 0x73d80000, ie under the previous > area. > Can you share the test details?. Why does it not fail on book3s64? We use topdown search with book3s64. > This is not the behaviour when using the generic (ie without mm_slices) > hugepages code, and this is not what libhugetlbfs expects for expending > the heap. > > -aneesh