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 87C7DC433F5 for ; Tue, 8 Feb 2022 03:22:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D39B66B0078; Mon, 7 Feb 2022 22:22:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CE87C6B007B; Mon, 7 Feb 2022 22:22:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BD74E6B007D; Mon, 7 Feb 2022 22:22:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0103.hostedemail.com [216.40.44.103]) by kanga.kvack.org (Postfix) with ESMTP id AFF9C6B0078 for ; Mon, 7 Feb 2022 22:22:39 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 654CE824C421 for ; Tue, 8 Feb 2022 03:22:39 +0000 (UTC) X-FDA: 79118165238.10.F9AD533 Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) by imf03.hostedemail.com (Postfix) with ESMTP id 0A0E520002 for ; Tue, 8 Feb 2022 03:22:38 +0000 (UTC) Received: by mail-qv1-f49.google.com with SMTP id o5so5438259qvm.3 for ; Mon, 07 Feb 2022 19:22:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:in-reply-to:message-id:references :mime-version; bh=90XsEdNXJrY04sKVLTFX0hH6LSLsZT/XD+WqONrkToE=; b=A3MJ4wbIsuKoXv2XlF+FIWZDf6FKTHnTRwv/el2HCZDOJL8MM0JUDUMXydMJ9qi4ax QKPE9ODBrOzNvMKOWrFY6PwMorAsBCmCHACP+tDJTlBOc/+pgLzYxfcUNoWhEm7k+B3+ pAIaToCVRmNn1ADS//ppPQRdQfhrB+8z0oE33Nzpw8QrulQLvfOcrt0unVcj4VvIysdL AxtrdhBJIYEhtkBeduKmSHdfiHzTwW8A3f2KwJUcAxeC4/UEqJ2Ve7BINyhwvrNwSmRW qIcigu49r9AdsLQJXqyxIB9ClQ75uP1XfhIShlIJOOJ+KyzPabViwipr5JZGH9aEZrDu KpKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:mime-version; bh=90XsEdNXJrY04sKVLTFX0hH6LSLsZT/XD+WqONrkToE=; b=LuG7/OixK412p0/lE6gk+VWo5OMu9W6JnCfcIjtOoi/It4CUa6zBLcKEfg4AuCqw9l qVL2lurmBNuZ1Z6eAQ1K/Q4OjmNXCmgZcI6z4RwM7vdiAtFD8+3rnEPPgBXuoRG+CQI6 4LVGDzhoxRCvxQVclesVdQij+yTko08YHq98heRXTIj6/BuSUyQ9oZlAy+66emrkr1B9 8allxNwVSa94IDJdx+nA+2neI0vRnu9gSPRYtRm2vtaozudFFwLHhPsPmBilLKhHz5rF 57x4xz3KSVbLLaygR56GGozwFataxvrlxxQ6wd+mmjWwtJDzE7m+pVxsPvHHqf7ZIwes mfhA== X-Gm-Message-State: AOAM531mC7/xFqva4+n4dYM5wJs6YpgP8nPe16JpzZPQILctyPU0h2sn VygLBgU2HPrZExJZE2AmaPOxzA== X-Google-Smtp-Source: ABdhPJyQibgCzqK7N2jnCNnhCK1tSEVAws6CXxjHT8O0zK/hOFoMmYMF6ToVfj7Q12aSwrgiskTwIQ== X-Received: by 2002:a05:6214:5081:: with SMTP id kk1mr1932846qvb.112.1644290558185; Mon, 07 Feb 2022 19:22:38 -0800 (PST) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id u35sm6948625qtc.26.2022.02.07.19.22.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 19:22:35 -0800 (PST) Date: Mon, 7 Feb 2022 19:22:22 -0800 (PST) From: Hugh Dickins X-X-Sender: hugh@ripple.anvils To: CGEL cc: Johannes Weiner , akpm@linux-foundation.org, sfr@canb.auug.org.au, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yang Yang Subject: Re: [PATCH] psi: Treat ksm swapping in copy as memstall In-Reply-To: <61f35591.1c69fb81.48dad.3244@mx.google.com> Message-ID: <72532675-d898-9f30-1ba4-318fbd61786@google.com> References: <20220116152150.859520-1-yang.yang29@zte.com.cn> <61e7ac25.1c69fb81.e8938.bc67@mx.google.com> <61ea820f.1c69fb81.e79d5.09c9@mx.google.com> <61f35591.1c69fb81.48dad.3244@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=A3MJ4wbI; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf03.hostedemail.com: domain of hughd@google.com designates 209.85.219.49 as permitted sender) smtp.mailfrom=hughd@google.com X-Rspam-User: X-Rspamd-Queue-Id: 0A0E520002 X-Stat-Signature: qre6ji1s6ay4gergj14ch9dp39unppw6 X-Rspamd-Server: rspam07 X-HE-Tag: 1644290558-953490 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000163, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, 28 Jan 2022, CGEL wrote: > On Thu, Jan 27, 2022 at 08:29:08PM -0500, Johannes Weiner wrote: > > On Fri, Jan 21, 2022 at 09:51:08AM +0000, CGEL wrote: > > > Wed, Jan 19, 2022 at 07:58:23AM -0500, Johannes Weiner wrote: > > > > On Wed, Jan 19, 2022 at 06:13:54AM +0000, CGEL wrote: > > > > > I did a test, when we use zram, it takes longer time for ksm copying than > > > > > swap_readpage(). Ksm copying average takes 147263ns, swap_readpage() > > > > > average takes 55639ns. So I think this patch is reasonable. > > > > > > > > Ok, that sounds reasonable to me as well. Please add the > > > > PageWorkingset() check and resubmit the patch. Thanks! > > > I am a litte confused about adding PageWorkingset(), since I > > > think ksm_might_need_to_copy() memstall is like swap_readpage() > > > memstall and swap_readpage() doesn't add PageWorkingset(). > > > > That's actually a bug! It should do that. > I recently found that too. Please CC to me your new patch, thanks! > And I will send V2 of this patch "psi: Treat ksm swapping in copy > as memstall" with PageWorkingset(). I'm entirely PSI-ignorant, and reluctant to disagree with Johannes, but I don't see how your patch to ksm_might_need_to_copy() could be correct - maybe the "swapping" in your subject is confusing. There is no PSI enter and exit around the page allocation and copying in wp_page_copy(), so why in the analogous ksm_might_need_to_copy()? Hugh