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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3098C433F5 for ; Mon, 2 May 2022 05:28:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F3F8B6B0072; Mon, 2 May 2022 01:28:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EEF526B0073; Mon, 2 May 2022 01:28:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DDD5F6B0074; Mon, 2 May 2022 01:28:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id CE22F6B0072 for ; Mon, 2 May 2022 01:28:58 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 99CD828DE7 for ; Mon, 2 May 2022 05:28:58 +0000 (UTC) X-FDA: 79419673956.16.E5593E9 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf31.hostedemail.com (Postfix) with ESMTP id C955820076 for ; Mon, 2 May 2022 05:28:44 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id C0EEA1F390; Mon, 2 May 2022 05:28:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1651469336; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PMLDEiOEivJVbi2ra4sFxYON8MSPoZXKHIUu7A5Dhko=; b=iWrEtpRf1Gdn9iVp2B+2WeSIQSksT+R7WdfF8ZJEWZb48EwY5gXJXPsgnGDTTCG5mKabbq AMkj40CvAqbYrTxnfGFBZkQCOspxnPW1nA4/dMBHA5KrX8mH+vE62QggZVYKWVqOfe4nxo rMWYyiVUAAW9OYUQow7ecE8HZEqrFNM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1651469336; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PMLDEiOEivJVbi2ra4sFxYON8MSPoZXKHIUu7A5Dhko=; b=CnGfXikueRG/5LVtwxpIed/U+DF8mUW1H8pG6ii0GicKNyZ8DApge1Q6Ep9DLhc1xAGGfy ItwuhukBBI5LK8CA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A035313491; Mon, 2 May 2022 05:28:53 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 80+bEhVsb2K5TAAAMHmgww (envelope-from ); Mon, 02 May 2022 05:28:53 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: "NeilBrown" To: "Matthew Wilcox" Cc: "Miaohe Lin" , "Andrew Morton" , "Geert Uytterhoeven" , "Christoph Hellwig" , linux-nfs@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] MM: handle THP in swap_*page_fs() - count_vm_events() In-reply-to: References: <165146746627.24404.2324091720943354711@noble.neil.brown.name>, Date: Mon, 02 May 2022 15:28:49 +1000 Message-id: <165146932944.24404.17790836056748683378@noble.neil.brown.name> X-Stat-Signature: t9b1anpfirz4n155szbdjs9sapbqj937 X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: C955820076 Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=iWrEtpRf; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=CnGfXiku; spf=pass (imf31.hostedemail.com: domain of neilb@suse.de designates 195.135.220.29 as permitted sender) smtp.mailfrom=neilb@suse.de; dmarc=pass (policy=none) header.from=suse.de X-Rspam-User: X-HE-Tag: 1651469324-176336 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, 02 May 2022, Matthew Wilcox wrote: > On Mon, May 02, 2022 at 02:57:46PM +1000, NeilBrown wrote: > > @@ -390,9 +392,9 @@ static void sio_read_complete(struct kiocb *iocb, lon= g ret) > > struct page *page =3D sio->bvec[p].bv_page; > > =20 > > SetPageUptodate(page); > > + count_swpout_vm_event(page); > > unlock_page(page); > > } > > - count_vm_events(PSWPIN, sio->pages); >=20 > Surely that should be count_swpIN_vm_event? >=20 I'm not having a good day.... Certainly shouldn't be swpout. There isn't a count_swpin_vm_event(). swap_readpage() only counts once for each page no matter how big it is. While swap_writepage() counts one for each PAGE_SIZE written. And we have THP_SWPOUT but not THP_SWPIN And I cannot find where any of these counters are documents, so I cannot say what is "correct". Well.... arch/s390/appldata/appldata_mem.c says u64 pswpin; /* pages swapped in */ u64 pswpout; /* pages swapped out */ but that isn't exactly unambiguous, and is for s390 which doesn't support THP_SWAP Ho hum. I guess I put that back as it was. Thanks for the review!!! NeilBrown