Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp1968783rdb; Sun, 19 Nov 2023 19:21:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IH8PIEDa3mNrGrra4n4S795CJOatLU8MIYSK43Ev2x4VhaUjqvSkrWNzbOaeaI9sj8HWA8J X-Received: by 2002:a05:6a20:8f27:b0:186:8dc1:f4a with SMTP id b39-20020a056a208f2700b001868dc10f4amr8852654pzk.0.1700450493470; Sun, 19 Nov 2023 19:21:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700450493; cv=none; d=google.com; s=arc-20160816; b=CAf/8BZHhfb8aagIb8NQunVDkTbIEisMXyej3On65Lv6JsurwH6wiLdOxPVu8GICeH vdykLw6vYPiRlLOcIyPn6Wnz7Vit+/v1S29oTZZjeQ4Yk/jb4uTk5k01cMoWxkpBMzcp 9ZLrS6kmUDkGC+NOSrGdO4lknQnrsmfgcuxnvuxHpsopFIc/4YDbmLESnruJ9nyuh6Fc VWfLhb9Cqf5W9uH4gJ2oxJiaR8fzQbt+jhIKRFrrcDmVbSNv74OrAlKV1FJV5eeoUMPu JqMr3DhAhtTA9Y3dSQRWsLzfTReL/0eEOZB/TMF1stgssYZTqsbJtfk1wNa8tc7CGoo4 uvfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:date:references:in-reply-to:subject:cc:to :from:dkim-signature; bh=FiNwuKz5eS+9GGt2nyql0t1KZ68oiztC2r9YtVQeVck=; fh=YDqn6AObHNjVm6R4/XQ/sJRheM5xXGx0KuLYF4loHZY=; b=pZN4okc68SA/Lf55us1RPFExtr15Jv6PVv57675HLglVg+5Vs7oBCW5UDK95s5U51A uOJmiFwa+LiUROXy3Jqk4t8f1bgbGcf8jr29l0c1ioKpfRyKMx0XHTd3OeiYKFW/bNcj 6fG56S8BDgIKL/zLaREDrKhvfmcJTULF3HVozpV/QlMaSVtse5g18t46/e5LwRvmfawY aaWZTwAxYKemgJ1UPmSCx4E0NNm5fv1D/OU9B4TXGtyndoAH9Tzs8XwfsFecCCPzZC9T OSjKHoAJKeRaqUyu/1K6fuxNeq7OxPoz+VfeYHgVrXX8cA65+/OQxHOsbb5wIry/O3UD yyPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=A+dHWEsl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id h4-20020a17090a2ec400b002839aba9d89si6225189pjs.25.2023.11.19.19.21.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 19:21:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=A+dHWEsl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 75442807C659; Sun, 19 Nov 2023 19:20:55 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231910AbjKTDUs (ORCPT + 99 others); Sun, 19 Nov 2023 22:20:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231873AbjKTDUq (ORCPT ); Sun, 19 Nov 2023 22:20:46 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E94CFD52 for ; Sun, 19 Nov 2023 19:20:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700450428; x=1731986428; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version:content-transfer-encoding; bh=/WwpyBY5Lz5uVgYgV4rkDEvUBBIi7Rj6tYssKEgChWE=; b=A+dHWEslrhAArcYt1awSudttL+wjqH15nfTeCL8PoqJVWiy9crEj/Z0o ld/2mOUq56UMLR7RcMl1DxMmyWZ9TG3rgD50AiNjsl4/rVVcmwFbtF1A9 Gy2mHvD3tIXsv4TfVipqgWyfMHajS1TyR2RxOuP6rJ9d6yb7ORRGHH3Ox Z+urGzJKbeXkihzCY7HbZdmV1L9r+sSoU+psaJ5/GGUdE81vhmx0FbAV6 W2Of157Y9GXRtMic0vMxk+N9KGDeaJASn7epOYZjLT3Koy9zv8e68z43n rY6TaU/LhqCtBADNXDHsCfDpDyTJTSmqEKGslEboGXGUGNmPAku0I0+rH w==; X-IronPort-AV: E=McAfee;i="6600,9927,10899"; a="381930739" X-IronPort-AV: E=Sophos;i="6.04,212,1695711600"; d="scan'208";a="381930739" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Nov 2023 19:20:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,212,1695711600"; d="scan'208";a="14028926" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.238.208.55]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Nov 2023 19:20:25 -0800 From: "Huang, Ying" To: Chris Li Cc: Yosry Ahmed , Zhongkun He , Andrew Morton , Johannes Weiner , Nhat Pham , Seth Jennings , Dan Streetman , Vitaly Wool , linux-mm , LKML Subject: Re: [PATCH] mm:zswap: fix zswap entry reclamation failure in two scenarios In-Reply-To: (Chris Li's message of "Thu, 16 Nov 2023 12:30:20 -0800") References: <20231113130601.3350915-1-hezhongkun.hzk@bytedance.com> Date: Mon, 20 Nov 2023 11:18:24 +0800 Message-ID: <8734x1cdtr.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Sun, 19 Nov 2023 19:20:55 -0800 (PST) Chris Li writes: > On Thu, Nov 16, 2023 at 12:19=E2=80=AFPM Yosry Ahmed wrote: >> >> Not bypassing the swap slot cache, just make the callbacks to >> invalidate the zswap entry, do memg uncharging, etc when the slot is >> no longer used and is entering the swap slot cache (i.e. when >> free_swap_slot() is called), instead of when draining the swap slot >> cache (i.e. when swap_range_free() is called). For all parts of MM >> outside of swap, the swap entry is freed when free_swap_slot() is >> called. We don't free it immediately because of caching, but this >> should be transparent to other parts of MM (e.g. zswap, memcg, etc). > > 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. -- Best Regards, Huang, Ying