Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2007189rdb; Sun, 19 Nov 2023 21:32:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IF7tezzTMNwDSjFf0Bm0LIRJkT4K3CEcPACQSoV+7pZHOVarQQSDSyAHp7NSZNLC+hlQcIj X-Received: by 2002:a05:6a20:3259:b0:187:4364:b584 with SMTP id hm25-20020a056a20325900b001874364b584mr6598617pzc.17.1700458352749; Sun, 19 Nov 2023 21:32:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700458352; cv=none; d=google.com; s=arc-20160816; b=bCurwvOowvI1ujb/UJhaw+VbZCVpRqKtVMn/xW7GIi/8uWd4L9MX6lnl9zP5VO5BMO gN9zlZNcte7G7/BvLTD5VOgFZV4yw7/ljhpB/mwv81LW5O469H1Z0orq+3MWSSECHnbm nHK+fI0EcIYY+qi6VZ4MZBHBnLC4E/HmO4pLIkFaqHKPpAOsqj7RMwwfnloPRqLR/4i0 jtHIHEwMzLOJZ01/1FMxz4gL1MKj56L3lo9agO+xglOZXHj/iPT0kxCtqBUQbg360zxl hnl/ZnK/Jh+35/XosW3UblKo5Y1sDAoB/TfOXS4agGE45/swz7abt6qrayeTQfgn95zy nIZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=g5FZt8nMm2x6QmUACZ0vv+9RumrjGcpro+qBhqOkWtk=; fh=1mxT+NUX+tc1CvpSASSRJC6okAfzo9CrbNb0JVTpdEQ=; b=ULMgf/1IHIvRlRSrLOYr7t1VK11SbvEao4FSjRVmfRnr9r/5NLH1sK+G1Q3lC02JgI FC7gvOtKB0J342ZuquntVicuYnIqawt4rJAeaJ711MZK11Z/tt1Xp7a7lcY54DJyZZqY 5ns3cJEO1GWysATtrW96LVrR8O9RlUxOCwoYzXRm7X8USulAQYC680yJ4QFvBuuMlmc8 2H2deGVkRM/HePJCQUhIJnQ6+M+RwSPcxDYWvo5cuszb02yiKB44dMhuZYzm43Jki5Yi 0U+S6WqDKoEuJ/50CeHcT/leE6aWCYWp3fiOlqMg1V7Lf1eJVFf2gUERIsRMKe/fgzvH yuJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UaoYNlRz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id om9-20020a17090b3a8900b00280ca5f4ca5si10296048pjb.113.2023.11.19.21.32.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 21:32:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UaoYNlRz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id DB5DC807C575; Sun, 19 Nov 2023 21:31:57 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230033AbjKTFbr (ORCPT + 99 others); Mon, 20 Nov 2023 00:31:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbjKTFbp (ORCPT ); Mon, 20 Nov 2023 00:31:45 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97AD7D8 for ; Sun, 19 Nov 2023 21:31:42 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C2E3C433D9 for ; Mon, 20 Nov 2023 05:31:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700458302; bh=1HCXqGJ6ZcQ5roM42J7RYsG2FK1b3wyTgpAEboIgJzQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=UaoYNlRzyIugLZng/SrmTERrWhDTm06T0kBvHPARO3bdxonthfjVD7UnooClmF4uh 0x/qnZ3ZKN2Q3PEIB9GhnHrhkTC5cNLxw8FxnzyZPjjACxBxRhROaQIDyz8GS0ijFX gKwhElXcrSdxnNOPpMAwDzihaZ9wt/Rbg+//yigy9Ns54aeortl3rn4Imo9DzKVxaJ JJdkq7swFGNqJwEtw9eKgIVZSwmxzzSMjMxGFoy7GKne98RQSBXuL/lDamCDIeoKNt P3RIAx8jstLTRL3qAka5M4B7ieedVN8TSjlB8ixc7cTOG5pIm1nbRVOAubamJZvbfn u6tgSfxJt726Q== Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-27ff83feb29so3474783a91.3 for ; Sun, 19 Nov 2023 21:31:42 -0800 (PST) X-Gm-Message-State: AOJu0Yxq8b4lxUukMYe5522XoKl3QcS9wj44cuacIPlgOgOwpDLgnaGg Bo3GSBOj1bCvDG3NMnibZNhTIo01rJ0hmZg062Ehdw== X-Received: by 2002:a17:90b:1a8a:b0:27d:f711:112e with SMTP id ng10-20020a17090b1a8a00b0027df711112emr8007586pjb.45.1700458301569; Sun, 19 Nov 2023 21:31:41 -0800 (PST) MIME-Version: 1.0 References: <20231113130601.3350915-1-hezhongkun.hzk@bytedance.com> <8734x1cdtr.fsf@yhuang6-desk2.ccr.corp.intel.com> In-Reply-To: <8734x1cdtr.fsf@yhuang6-desk2.ccr.corp.intel.com> From: Chris Li Date: Sun, 19 Nov 2023 21:31:30 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] mm:zswap: fix zswap entry reclamation failure in two scenarios To: "Huang, Ying" Cc: Yosry Ahmed , Zhongkun He , Andrew Morton , Johannes Weiner , Nhat Pham , Seth Jennings , Dan Streetman , Vitaly Wool , linux-mm , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sun, 19 Nov 2023 21:31:58 -0800 (PST) On Sun, Nov 19, 2023 at 7:20=E2=80=AFPM Huang, Ying = wrote: > > Chris Li writes: > > > On Thu, Nov 16, 2023 at 12:19=E2=80=AFPM Yosry Ahmed wrote: > > That will cancel the batching effect on the swap slot free, making the > > common case for swapping faults take longer to complete, righ? > > If I recall correctly, the uncharge is the expensive part of the swap > > slot free operation. > > I just want to figure out what we are trading off against. This is not > > one side wins all situations. > > Per my understanding, we don't batch memcg uncharging in > swap_entry_free() now. Although it's possible and may improve > performance. swap_entry_free() does not do batching, it is at the caller level. I just checked. The batching is done in free_swap_slot() is still using swap slot cache and batching. It uses swapcache_free_entries() to batch free the swap_slots. That is where the uncharge happens per my understanding. Chris