Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3623600yba; Sat, 11 May 2019 15:36:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqyGbAX1CRmUmOEodsR76llgOjrZZb37nSu3+QFKTMkntRMBOAcZl1tSJgGGKQRoo0H1e22l X-Received: by 2002:a17:902:7594:: with SMTP id j20mr22590809pll.78.1557614197262; Sat, 11 May 2019 15:36:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557614197; cv=none; d=google.com; s=arc-20160816; b=fMKfnYPUDXLw642S5ScZJrAKBIsUGhapVSgMB5Y1u9Jyf2rgRF+gpKvcfiFVpycsGC Vw1MT2J7CFAtTZQXv9WXd9ysxfYTTOa0X4sWSTuZHDGzWzx462NBRI2xdARh2l6PdRmv gGQiJHhzEFGVK6DjjHPiDb5VWmdfHZzs4p/Qg1qRsrahO8oMc823l+Pcolk3pzrtG/g/ E2D+hdJXFPP5ZasnJk+52QfCblkJIqqcwQwHQjI5er7KrWsG4lVOeZkRUVz200v7mbEs XF5+AuTUF3rWR9/pKEdBe21AB5/wv9mnghZsH1dHHrxIy26OTNmG4tFP21AFSKEQuWEc A8CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=cg1vXAzcRFjP3GXfQCRMyWsYUJ2Cc80Ce/8Y/l18iMY=; b=1G/3SEFch6W0N/K78nYnZYMj6kAdhq4NMuOBJiJpobojCTMdjKne/vgqn+MzzdvBy4 whYI7KoUzL5Pw+hh+WsCZT4F6+JZCD7966lOAXUcFuQztpwakGdNqKkIlAf/HyQc1Igu LEwS32ZpRJtsAT8ZdJbU4kyi8RZY9bxKAu9XnJNy//n/0apHhg5RapjclMITm/9f1FKA wkXG3WwuWb6Hzf+K9iSnTm6hvuMR7Af9gCaNGwe06eKC15miQ0uV6Mgo/YEXaqPTq7kq URLXPJUt5l/Eu/B+qSbkKPoS7QxQ+ZFIRw22QsJHpkzl7XdTHDM5TowlbLF2AQvMW6lZ A4JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=ZdWDQ1Gl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p13si766024pfq.57.2019.05.11.15.35.58; Sat, 11 May 2019 15:36:37 -0700 (PDT) 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; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=ZdWDQ1Gl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726319AbfEKWd7 (ORCPT + 99 others); Sat, 11 May 2019 18:33:59 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:45318 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726033AbfEKWd7 (ORCPT ); Sat, 11 May 2019 18:33:59 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4BMOgAx189680; Sat, 11 May 2019 22:33:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=content-type : mime-version : subject : from : in-reply-to : date : cc : content-transfer-encoding : message-id : references : to; s=corp-2018-07-02; bh=cg1vXAzcRFjP3GXfQCRMyWsYUJ2Cc80Ce/8Y/l18iMY=; b=ZdWDQ1GlAM12R9SP3yvHS31Pp2G9dDtfK6IA0Xac73GUL0zD+nS5QIo9lvdcjZ5fprLA RBbMfZZNbNg7LHtQStm4pDyD/kTyDxRSFVIpDYaZ5bi46EqE1cO5vrM0GyB4xNERhak9 yLuT+zJ6U4ji3CReu/YV3pgmEit6FxgJhnlIBlaOUbVCno7+KKe5lCmUqDhFZeKWWdxf 8nnR9/rkifOcnfFelT97uZNiWd0oRDT+U5BL1WatnesS8orEMoWrKdrXEKPlm31Ov/yt FV7tVoJ9IBEHOI+xnGd9A3CRc4PfZQ4ViHzyHeVTms+aLyu5ofN+oiZU8+peyHK9KO8y 3g== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 2sdntt9r1v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 11 May 2019 22:33:20 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4BMXH7O112688; Sat, 11 May 2019 22:33:19 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 2sdme9yw8t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 11 May 2019 22:33:19 +0000 Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x4BMX5ur020474; Sat, 11 May 2019 22:33:05 GMT Received: from [192.168.0.110] (/73.243.10.6) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 11 May 2019 15:33:05 -0700 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: [PATCH] mm: vmscan: correct nr_reclaimed for THP From: William Kucharski In-Reply-To: <20190510163612.GA23417@bombadil.infradead.org> Date: Sat, 11 May 2019 16:33:01 -0600 Cc: "Huang, Ying" , Yang Shi , hannes@cmpxchg.org, mhocko@suse.com, mgorman@techsingularity.net, kirill.shutemov@linux.intel.com, hughd@google.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: <7B762A95-B8A6-4281-94F1-5DA6B62EDCF9@oracle.com> References: <1557447392-61607-1-git-send-email-yang.shi@linux.alibaba.com> <87y33fjbvr.fsf@yhuang-dev.intel.com> <20190510163612.GA23417@bombadil.infradead.org> To: Matthew Wilcox X-Mailer: Apple Mail (2.3445.104.11) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9254 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=688 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905110166 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9254 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=718 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905110165 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On May 10, 2019, at 10:36 AM, Matthew Wilcox = wrote: >=20 > Please don't. That embeds the knowledge that we can only swap out = either=20 > normal pages or THP sized pages. I'm trying to make the VM capable of=20= > supporting arbitrary-order pages, and this would be just one more = place > to fix. >=20 > I'm sympathetic to the "self documenting" argument. My current tree = has > a patch in it: >=20 > mm: Introduce compound_nr >=20 > Replace 1 << compound_order(page) with compound_nr(page). Minor > improvements in readability. >=20 > It goes along with this patch: >=20 > mm: Introduce page_size() >=20 > It's unnecessarily hard to find out the size of a potentially huge = page. > Replace 'PAGE_SIZE << compound_order(page)' with page_size(page). >=20 > Better suggestions on naming gratefully received. I'm more happy with=20= > page_size() than I am with compound_nr(). page_nr() gives the wrong > impression; page_count() isn't great either. I like page_size() as well. At least to me, page_nr() or page_count() = would imply a basis of PAGESIZE, or that you would need to do something like: page_size =3D page_nr() << PAGE_SHIFT; to get the size in bytes; page_size() is more straightforward in that = respect.=