Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2647593yba; Fri, 10 May 2019 15:56:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqw8vryek0KeFVjZCDBtiqrbnr50z0unq+mYoPqlmH7/rQRcBtJGiMfFbfqK57fVFoBlYrE+ X-Received: by 2002:a17:902:6ac6:: with SMTP id i6mr16238549plt.336.1557529001798; Fri, 10 May 2019 15:56:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557529001; cv=none; d=google.com; s=arc-20160816; b=dC7Mnv1FcPqB27jBldP5PU0kzNEAMRDo/t0pAtytcjhz9U4nTM75O2KynDakxNs/qh /41cLu01906iw9CjkYtvSzHLa1B4RhNym0ftHh3AeRowR9N4TZ1ZS5fESE6OIsFl/GlJ U8c+AY3lYfyNrXvkkeQZy9kssVv7GB1Xolk3BZCsZKHcFHkxFRVGGyPUA5ZlkICPe1YJ M4LiV0t3d43gyXIK3PUPOXLekn3X2KZO8qdpwbURtI+PYElWbD9g6KSF4+lQ5HnVXW5R WbyC9ExNtn+jEZZGMZ3qFzrdX+wO4Fsu6O3Tk7gxCzYRCzhqIcrqk3EfpekeISFDRNsV 2x2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=6aBorz213tpxEtN7PrDVgXkjkPQXEbd5tcw9DSH2CNs=; b=pEUdr4VP8ZEzgumaEO2rCakq5MALwFY5LqtJK9XCvEVLi986Id+Ec0mj9OIWYPCeQr epcENJW47+DxIyfh7hplV6SQgn2qa+r0aTLqDaAXdQ9+DE98JWFywKFFGDkV2eA5JJcd u1Ror2A+qMgNDVGck44dZo2bMyZ7r3iru06zazw9lk3DP0czBDQCC0UWk9QwNse4hAZ4 m+JgvaSDvias7yY/pV/0yFpq2TQyeUl03G1P/HgGzuVGTUjIt3WgMJStpoq1ZHCdHml+ bG7G0cvw7Oq8Yi3svi/BuEUUsAqUgdPw8jBZGvsygQvP/swHSUYEj7OnMn7kXCzl/oKf OWjg== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q73si9388935pfi.5.2019.05.10.15.56.25; Fri, 10 May 2019 15:56:41 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727957AbfEJWyV (ORCPT + 99 others); Fri, 10 May 2019 18:54:21 -0400 Received: from mga12.intel.com ([192.55.52.136]:36053 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726862AbfEJWyU (ORCPT ); Fri, 10 May 2019 18:54:20 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 May 2019 15:54:20 -0700 X-ExtLoop1: 1 Received: from iweiny-desk2.sc.intel.com ([10.3.52.157]) by fmsmga005.fm.intel.com with ESMTP; 10 May 2019 15:54:20 -0700 Date: Fri, 10 May 2019 15:54:56 -0700 From: Ira Weiny To: Matthew Wilcox 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 Subject: Re: [PATCH] mm: vmscan: correct nr_reclaimed for THP Message-ID: <20190510225456.GA13529@iweiny-DESK2.sc.intel.com> References: <1557447392-61607-1-git-send-email-yang.shi@linux.alibaba.com> <87y33fjbvr.fsf@yhuang-dev.intel.com> <20190510163612.GA23417@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190510163612.GA23417@bombadil.infradead.org> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 10, 2019 at 09:36:12AM -0700, 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). > > Better suggestions on naming gratefully received. I'm more happy with > page_size() than I am with compound_nr(). page_nr() gives the wrong > impression; page_count() isn't great either. Stupid question : what does 'nr' stand for? Ira