Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5350514pxu; Tue, 22 Dec 2020 14:58:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLLo2QyNTtwBtwuWPv0W7pcaUHkI8fQgrGy3PnxLnWsKvzLhXHbqXfeMETNYLuZ/XiI2Ey X-Received: by 2002:a50:e882:: with SMTP id f2mr21817008edn.76.1608677893637; Tue, 22 Dec 2020 14:58:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608677893; cv=none; d=google.com; s=arc-20160816; b=qzalgb0n+eGlvaihygp9axwUrzLQnnBF1NOm4cL3yW7Tg7KkYsZMx3AoAheHvUxzl5 Z2cpwo32xT8k611FkvlGXeDvpplzy/m2DAYyizYh096x04YSwAKwUjVvyxuJW4Zovl1b oePV2lZ6H59Aabg6ov1UQ8CcRJfzkchoYQMl1gsRHKUzY41z1d/k12Pp5xhLnr3PyyyR +DEpWFy48qt3wvvU36elMrxA1Y1mjsbZMTAltfVkTK8f2tNBGQj2VKzOB2WX6hCMe7si MPnOQPLxZ8gGPSN+GupR7l4rMdqSc3sculILeKtQZczollyXj1PrMWfHFcS1UMr3WbZY 50aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:dkim-signature; bh=N+6K3mCeYK/CoMCgVBBUHQgK04gVj9asaTrrtBEH5II=; b=DZf7HOqfgepMKbu8p2jO6Q3bIDCcQ7kRHDgj4+FfYv4fAQRXvfDBtoFR3SJX40afOQ gtVKwVhiDdx/C846zpbTpU+HFkdF+CS0s7OUFvxzztkVUfwr4uvxW9fVmJONe8NeoY/m gSVdEyTXI36YDLSFgiiyZDtcP5ZplzFJPAIHfaNagSX2JetcAN0eYTWxKzGrqRNTylai Ukx1WSlM7WPd7AxD1/L28IUCeBcT2S9yxMz0FqthD7MnHK1OV+/t1gFSsHLdoDm6+hcJ 2LK5bW8vJX+Dlye25+WiuixkK0ImCUp+7wxgh1rJbPUvkHnObPQ1Fh6c9W1x+vqFuZ4o rxmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=xMjE8Cj2; 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 l8si10534664ejp.707.2020.12.22.14.57.50; Tue, 22 Dec 2020 14:58:13 -0800 (PST) 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=xMjE8Cj2; 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 S1727844AbgLVW4o (ORCPT + 99 others); Tue, 22 Dec 2020 17:56:44 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:52968 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726637AbgLVW4o (ORCPT ); Tue, 22 Dec 2020 17:56:44 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0BMMpWlD174018; Tue, 22 Dec 2020 22:55:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=N+6K3mCeYK/CoMCgVBBUHQgK04gVj9asaTrrtBEH5II=; b=xMjE8Cj23ZoYzPmldN5IYeUk4iWwtF72gnepmDtV597NPn+XfF/jb1Yqrc4kKLw8UPuO PuF+Gz3HXDcBc8LC/BTKqPlOSqus6fuXw1pYdzahisjKl8VvplckbgiyU4x5/a0YAlA5 pvvmTYnW+6aTLZ+MmYu5u+nPG0qfNtOB+LJZVbltZ1NPMgEk+3WkY6XpZYmQqog0CkBa pBHUX6Ng/TtbZo+eFfHgMj8dxB2ZNakMuz8QmkhyC2kX5wLAuh4l+nO2UADVxEcBKLAK g5RCX73Cbryr+0+2pEz/MzI+NpM0d6/yup1ELAwRsjFUI1THCc84UNGYBpn1IWzB/fUQ iA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2130.oracle.com with ESMTP id 35k0d15m2k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 22 Dec 2020 22:55:35 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0BMMnvTk007881; Tue, 22 Dec 2020 22:55:35 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3020.oracle.com with ESMTP id 35k0ea3sym-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 22 Dec 2020 22:55:35 +0000 Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 0BMMtUxk026442; Tue, 22 Dec 2020 22:55:31 GMT Received: from [192.168.2.112] (/50.38.35.18) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 22 Dec 2020 14:55:30 -0800 Subject: Re: [RFC PATCH 1/3] mm: support hugetlb free page reporting To: Alexander Duyck , Alexander Duyck , Mel Gorman , Andrew Morton , Andrea Arcangeli , Dan Williams , "Michael S. Tsirkin" , David Hildenbrand , Jason Wang , Dave Hansen , Michal Hocko , Liang Li , Liang Li , linux-mm , LKML , virtualization@lists.linux-foundation.org, qemu-devel@nongnu.org References: <20201222074656.GA30035@open-light-1.localdomain> From: Mike Kravetz Message-ID: <52a6cb93-1fed-dfd7-d21e-f14197a9c9dc@oracle.com> Date: Tue, 22 Dec 2020 14:55:28 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9843 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 mlxscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012220165 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9843 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 suspectscore=0 adultscore=0 bulkscore=0 priorityscore=1501 mlxscore=0 clxscore=1011 phishscore=0 mlxlogscore=999 spamscore=0 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012220165 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/22/20 11:59 AM, Alexander Duyck wrote: > On Mon, Dec 21, 2020 at 11:47 PM Liang Li wrote: >> + >> + if (huge_page_order(h) > MAX_ORDER) >> + budget = HUGEPAGE_REPORTING_CAPACITY; >> + else >> + budget = HUGEPAGE_REPORTING_CAPACITY * 32; > > Wouldn't huge_page_order always be more than MAX_ORDER? Seems like we > don't even really need budget since this should probably be pulling > out no more than one hugepage at a time. On standard x86_64 configs, 2MB huge pages are of order 9 < MAX_ORDER (11). What is important for hugetlb is the largest order that can be allocated from buddy. Anything bigger is considered a gigantic page and has to be allocated differently. If the code above is trying to distinguish between huge and gigantic pages, it is off by 1. The largest order that can be allocated from the buddy is (MAX_ORDER - 1). So, the check should be '>='. -- Mike Kravetz