Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp837173pxk; Thu, 3 Sep 2020 13:59:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2NuDMspttmNq652QyVrq7qUDUp6aUvfer+xtD7qCwdxqmouxzoW77xD8VTELez2vp3+MV X-Received: by 2002:a17:906:2354:: with SMTP id m20mr2475162eja.341.1599166796233; Thu, 03 Sep 2020 13:59:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599166796; cv=none; d=google.com; s=arc-20160816; b=mczKeygN5Nzdpc+LbqC7nnGPD+itI5mvlG7Tb5mGB4b3i7/F/7xLpRXfQXy3uoI/ll I7JewahceCMVdESK2ZgcsIydwauLwZuNv0HlNSlHSz5/4JgK5cBT/k/68yJLFSse+/YF zUEShwWmbFYKkZeaQjFOcmPAdt9wrmT/EQXFsLMtkqI503ZYRoCd2oqWeMstBf/wZv9E E3G+tD+jVWl93oHooz8fCIRhyzWHHtYdOs2PLhHaPZpr13/IEMjtJNmb1xuaUTlPsZOD mwqdgvZ7G8qdnNesocL8z4JhQmCWNsRB6CI3G8NHmJiBhxvuwuNpQA+sp/eA03BZTMa+ ZqMw== 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:dkim-signature; bh=fO3N/VN0fHfx53KJLvm/o+1PXllytVmLBw9NiqFC718=; b=VbsZy4J7F+VV2sXmpQR2Wca5rE7hpRW0Atmpe/2v3LzQ8mSYT1+rP41d7+mugwAN9p R6qEmw+KyTN+Vxurq6/e0+3VKbE6d6wcmtmzB4OsYcteJzjSQWe8AEp5eoKZegcaoFRu +bvipzkWOeO28BpOcbRg2896TfTRqjXvqxSsYCbt9UCHscp9bcyQciYCUA3WP2OXMKrJ QGk8IZH4H7XS8Ev1KNKkK1T1XcWVvH+537QQNdt/wGf1/dVY1UfvrT1iprC/nG2iXzpq rPmyZuN364R7BpfhND0S/oelh0g/A9tNrhBm/hdpVg/qOOv7kNbVeN7RFOJPdGjKearC P8hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=lUNcp7I1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n3si2936002eji.384.2020.09.03.13.59.33; Thu, 03 Sep 2020 13:59:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=lUNcp7I1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728382AbgICU6d (ORCPT + 99 others); Thu, 3 Sep 2020 16:58:33 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:38866 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726088AbgICU6c (ORCPT ); Thu, 3 Sep 2020 16:58:32 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 083KrfR5158586; Thu, 3 Sep 2020 20:58:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=fO3N/VN0fHfx53KJLvm/o+1PXllytVmLBw9NiqFC718=; b=lUNcp7I1OPTsvfkY9Euq10BwePdjs2W9PPUonHdCCtRPQlxLn1MqR1yFPTDrb4pDT27y NHdtks8T46vXfzb2VCJVDVh7nzLZK2LdaoEmnoGoAFuRu+HLCpPlK+LLqV/sw1GClMza 5Ahak67qkx9f6qjUSdmZri7smCGzJPziys6qtGmN7epuH51pu4399NVNHSQLGv6PffqI Jdp+gN12jRfmzU6laB1xH0n7uVVP2tZQXSxep+H260LZJo4SGp8FhSOGy/vWpsVWmxKC /trO2MY+yTdqQd2l2s+teL6it96pa8GC2AuQTCVT8Wx4yWZNJ/qFUs6+iZ1U/Im+BRbN nA== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 339dmn9m71-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 03 Sep 2020 20:58:01 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 083Kt6sn097106; Thu, 3 Sep 2020 20:58:01 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3020.oracle.com with ESMTP id 33b7syrcq9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 03 Sep 2020 20:58:00 +0000 Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 083Kvu96020787; Thu, 3 Sep 2020 20:57:56 GMT Received: from [192.168.2.112] (/50.38.35.18) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 03 Sep 2020 13:57:56 -0700 Subject: Re: [RFC PATCH 00/16] 1GB THP support on x86_64 To: Roman Gushchin , Michal Hocko Cc: Zi Yan , linux-mm@kvack.org, Rik van Riel , "Kirill A.Shutemov" , Matthew Wilcox , Shakeel Butt , Yang Shi , David Nellans , linux-kernel@vger.kernel.org References: <20200902180628.4052244-1-zi.yan@sent.com> <20200903073254.GP4617@dhcp22.suse.cz> <20200903162527.GF60440@carbon.dhcp.thefacebook.com> From: Mike Kravetz Message-ID: Date: Thu, 3 Sep 2020 13:57:54 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200903162527.GF60440@carbon.dhcp.thefacebook.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9733 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 suspectscore=0 spamscore=0 phishscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009030187 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9733 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 phishscore=0 mlxlogscore=999 adultscore=0 impostorscore=0 mlxscore=0 suspectscore=0 spamscore=0 clxscore=1011 malwarescore=0 lowpriorityscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009030186 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/3/20 9:25 AM, Roman Gushchin wrote: > On Thu, Sep 03, 2020 at 09:32:54AM +0200, Michal Hocko wrote: >> On Wed 02-09-20 14:06:12, Zi Yan wrote: >>> From: Zi Yan >>> >>> Hi all, >>> >>> This patchset adds support for 1GB THP on x86_64. It is on top of >>> v5.9-rc2-mmots-2020-08-25-21-13. >>> >>> 1GB THP is more flexible for reducing translation overhead and increasing the >>> performance of applications with large memory footprint without application >>> changes compared to hugetlb. >> >> Please be more specific about usecases. This better have some strong >> ones because THP code is complex enough already to add on top solely >> based on a generic TLB pressure easing. > > Hello, Michal! > > We at Facebook are using 1 GB hugetlbfs pages and are getting noticeable > performance wins on some workloads. > > Historically we allocated gigantic pages at the boot time, but recently moved > to cma-based dynamic approach. Still, hugetlbfs interface requires more management > than we would like to do. 1 GB THP seems to be a better alternative. So I definitely > see it as a very useful feature. > > Given the cost of an allocation, I'm slightly skeptical about an automatic > heuristics-based approach, but if an application can explicitly mark target areas > with madvise(), I don't see why it wouldn't work. > > In our case we'd like to have a reliable way to get 1 GB THPs at some point > (usually at the start of an application), and transparently destroy them on > the application exit. Hi Roman, In your current use case at Facebook, are you adding 1G hugetlb pages to the hugetlb pool and then using them within applications? Or, are you dynamically allocating them at fault time (hugetlb overcommit/surplus)? Latency time for use of such pages includes: - Putting together 1G contiguous - Clearing 1G memory In the 'allocation at fault time' mode you incur both costs at fault time. If using pages from the pool, your only cost at fault time is clearing the page. -- Mike Kravetz