Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2344989yba; Fri, 10 May 2019 09:57:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqyoGNHEcXEMTag10oBO247XXVt1dEa5HGC+CjOvppwOCm+0dImWciPhI9snCzhGLqS4fCZ4 X-Received: by 2002:a17:902:6949:: with SMTP id k9mr14186897plt.59.1557507435878; Fri, 10 May 2019 09:57:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557507435; cv=none; d=google.com; s=arc-20160816; b=wVgzKB1PGiDsRfQZFFTHZFRBGrWD3sHCUmtY9FS+/nzEfKVREc3poJ1y35mWlJH72c RV//8NucxS8Z0Of5axiXEqBsfAQ0dGmeCKo/gGl2PM1DSEBNdBOdKdqbMA6msIMCBMiV 6CMVSzSJ7J6t7Xc5QUXn5wkRxlgy7wV/hiQ3+6Q6j1+P/9QkbZbmY+knUqFCc24t8UQR J8HKPa8PXNSlDHnAx3zBbtbgNoU/UdKc7V0AcvS8J4xJ5ICoNvEp8jDZu5xcHOyR+ghT cR4/INAEZLYAae2R+3O780D+Cg1FGSzhckaqfd/Lxx5xf6k8cFQvvaNY+4q+cYPr5ohZ W96A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=NlNpxiNBfeC4du3cFApLVF35slSBP97aolAUyYL/GkY=; b=n+Tt7UPPNc38LXZTlvC6aBTZ2BJAArRqISV3M6O880eTly3h+OeL7ujF9gIM+5xyqY tQfh8F38Q/tTrRKlyKLdtX3CrYSyzc2ytxdaEMeJ7BXEf+BWh1wOfhRSz57rZf5smFjP qmwP0xawYEOVOOHgYrSg7+rnK17o5eeFDBnC3omfWcvq/Y9ExyJ+97pm7RKvGxAKun21 F4IZp39tcFWshOfApBPsXRVXiO33PXsjXk0rawNLeRHFpt55O9PDvESbW2PtCUo72g9j jEM1R78s3zMsivt9qnPGEkZFpFConXe7cT9ykJ6HPLt4ob3RXubvaKZtfbmSisx/wCwJ Ivzg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m10si8018407pgp.478.2019.05.10.09.56.59; Fri, 10 May 2019 09:57:15 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727873AbfEJQyZ (ORCPT + 99 others); Fri, 10 May 2019 12:54:25 -0400 Received: from out30-54.freemail.mail.aliyun.com ([115.124.30.54]:44968 "EHLO out30-54.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727771AbfEJQyZ (ORCPT ); Fri, 10 May 2019 12:54:25 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R471e4;CH=green;DM=||false|;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04394;MF=yang.shi@linux.alibaba.com;NM=1;PH=DS;RN=10;SR=0;TI=SMTPD_---0TRMMEdW_1557507254; Received: from US-143344MP.local(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0TRMMEdW_1557507254) by smtp.aliyun-inc.com(127.0.0.1); Sat, 11 May 2019 00:54:17 +0800 Subject: Re: [PATCH] mm: vmscan: correct nr_reclaimed for THP To: Matthew Wilcox Cc: "Huang, Ying" , 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 References: <1557447392-61607-1-git-send-email-yang.shi@linux.alibaba.com> <87y33fjbvr.fsf@yhuang-dev.intel.com> <20190510163612.GA23417@bombadil.infradead.org> <3a919cba-fefe-d78e-313a-8f0d81a4a75d@linux.alibaba.com> <20190510165207.GB3162@bombadil.infradead.org> From: Yang Shi Message-ID: <72fb1554-4cda-27f4-8c09-038ab3350ff8@linux.alibaba.com> Date: Fri, 10 May 2019 09:54:11 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20190510165207.GB3162@bombadil.infradead.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/10/19 9:52 AM, Matthew Wilcox wrote: > On Fri, May 10, 2019 at 09:50:04AM -0700, Yang Shi wrote: >> On 5/10/19 9:36 AM, Matthew Wilcox wrote: >>> On Fri, May 10, 2019 at 10:12:40AM +0800, Huang, Ying wrote: >>>>> + nr_reclaimed += (1 << compound_order(page)); >>>> How about to change this to >>>> >>>> nr_reclaimed += hpage_nr_pages(page); >>> Please don't. That embeds the knowledge that we can only swap out either >>> normal pages or THP sized pages. I'm trying to make the VM capable of >>> supporting arbitrary-order pages, and this would be just one more place >>> to fix. >>> >>> I'm sympathetic to the "self documenting" argument. My current tree has >>> a patch in it: >>> >>> mm: Introduce compound_nr >>> Replace 1 << compound_order(page) with compound_nr(page). Minor >>> improvements in readability. >>> >>> It goes along with this patch: >>> >>> mm: Introduce page_size() >>> >>> It's unnecessarily hard to find out the size of a potentially huge page. >>> Replace 'PAGE_SIZE << compound_order(page)' with page_size(page). >> So you prefer keeping usingĀ  "1 << compound_order" as v1 did? Then you will >> convert all "1 << compound_order" to compound_nr? > Yes. Please, let's merge v1 and ignore v2. Fine to me. I think Andrew will take care of it, Andrew?