From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25679CA9EC7 for ; Tue, 5 Nov 2019 06:28:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B0687206BA for ; Tue, 5 Nov 2019 06:28:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B0687206BA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 60E866B0007; Tue, 5 Nov 2019 01:28:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5BE686B0008; Tue, 5 Nov 2019 01:28:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4D4BD6B000A; Tue, 5 Nov 2019 01:28:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0189.hostedemail.com [216.40.44.189]) by kanga.kvack.org (Postfix) with ESMTP id 37D2C6B0007 for ; Tue, 5 Nov 2019 01:28:25 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id DB17E180AD815 for ; Tue, 5 Nov 2019 06:28:24 +0000 (UTC) X-FDA: 76121244528.06.view97_2c3e643752c32 X-HE-Tag: view97_2c3e643752c32 X-Filterd-Recvd-Size: 2455 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by imf20.hostedemail.com (Postfix) with ESMTP for ; Tue, 5 Nov 2019 06:28:23 +0000 (UTC) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Nov 2019 22:28:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,270,1569308400"; d="scan'208";a="192002353" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by orsmga007.jf.intel.com with ESMTP; 04 Nov 2019 22:28:21 -0800 Date: Tue, 5 Nov 2019 14:28:09 +0800 From: Wei Yang To: Matthew Wilcox Cc: Wei Yang , linux-mm@kvack.org Subject: Re: Why sometimes count vm event with page number, sometimes not? Message-ID: <20191105062809.GA15848@richard> Reply-To: Wei Yang References: <20191105022643.GA14722@richard> <20191105033251.GB11823@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191105033251.GB11823@bombadil.infradead.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Bogosity: Ham, tests=bogofilter, spamicity=0.025098, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Nov 04, 2019 at 07:32:51PM -0800, Matthew Wilcox wrote: >On Tue, Nov 05, 2019 at 10:26:44AM +0800, Wei Yang wrote: >> Hi, All, >> >> I am curious about the semantic of __count_vm_event[s]. >> >> For example, we count PGDEACTIVATE event in lru_deactivate_file_fn() and >> lru_deactivate_fn(). One of them count with number of page, the other not. >> >> Just curious about the exact value we want to count. > >I don't understand the question. We deactivate one page >in lru_deactivate_file_fn(). We deactivate several pages in >shrink_active_list(). PGDEACTIVATE counts the number of pages which >have been deactivated. > >Does that answer your question? Not yet. In function, lru_deactivate_fn(), __count_vm_events's second parameter is hpage_nr_pages(page). This is the number in size of "normal" page. Per my understanding, the page deactivated in lru_deactivate_file_fn() could be a hpage too. But it just count the deactivation once instead of hpage_nr_pages(). Or you want to say the page deactivated in lru_deactivate_file_fn() must be an order 0 page? -- Wei Yang Help you, Help me