Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3561721iob; Sun, 1 May 2022 22:47:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsa7GWbwv5aWe+zEkypUAoZPLn6634XFD60St39NhknalLxUJwAbshdFNbJKjB0iOZq4/b X-Received: by 2002:a17:902:e883:b0:15e:86ea:846e with SMTP id w3-20020a170902e88300b0015e86ea846emr10567515plg.131.1651470477867; Sun, 01 May 2022 22:47:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651470477; cv=none; d=google.com; s=arc-20160816; b=Jg11a9onapq8KJNyku0Tk1eysw9RodyVpy8FX0QdwFx9iTfjmXD2gSWFPmwOSnUtnt xcMXRDavDcECvl5m43pHTjBl86ydxmvX5EjMHh3/eIuX2pDEo3b4FjuYIKkdJMvHnPxW wUgyNZCqlI0msTe7WTa7ZZBfCTz2pFDAlZ9aTIzHqkbTYrew1nl0LJJz5iKcgBxHRLSo /E/HlH+e+qU/jkErW5W+bbn3HSY6WpRT3zi8Se6iCmK4+isot8J+88UEbO+o4kgN5EuC DJ3ef0RFVUHiMl54q0DtgGNvH5tqKKh0Gf5rX/2TdRQrDQNqDwhROBHD0+RYQoakoijb Py0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:references:in-reply-to:subject :cc:to:from:mime-version:content-transfer-encoding:dkim-signature :dkim-signature; bh=PMLDEiOEivJVbi2ra4sFxYON8MSPoZXKHIUu7A5Dhko=; b=PXlrYG1yp1xdAmtPOHgnRIwIlOh/zO3hOyDeSFuUnsVDby3yifGjgo6v50LvX1PAM4 PmctfTydy5DKLHyJFuJ0FjROer28ZJEaA2Pc/PGU3ANMgCF3eYa/1P8AfmoI/TOsctxW dwURYDsBvIJvp7VNI4xixhg0r+TV/xowb1oTbZ7/wCpheXaWJ6Y5XPwWldBfMeSWFKBu x9qkydOVaUW880XEBEjLkTLJO8nMddNbu4t4GbtV/nnzdYRoyqgxLqDHjLESN81x3WVR f12acT+6apfKHrHq+Fp3iJQUAAW7r2ZHpQ/9oN51MyRuqkxQNrAkAJnLF3H2b6p8vW8M WKFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=iWrEtpRf; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 200-20020a6304d1000000b003a9fd439348si13222923pge.582.2022.05.01.22.47.27; Sun, 01 May 2022 22:47:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=iWrEtpRf; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355873AbiEBFc0 (ORCPT + 99 others); Mon, 2 May 2022 01:32:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236108AbiEBFcZ (ORCPT ); Mon, 2 May 2022 01:32:25 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E75A2D1C5; Sun, 1 May 2022 22:28:58 -0700 (PDT) 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-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org 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