Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp83813rdb; Thu, 16 Nov 2023 12:31:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IGRMaodH2hNwLn1EUDWCtcJwIHtsjGmXNAie2gIdEQ22teJafzivr+hwzlxgMek5B/znpB+ X-Received: by 2002:a17:902:74c1:b0:1cc:6906:c016 with SMTP id f1-20020a17090274c100b001cc6906c016mr3230935plt.9.1700166684301; Thu, 16 Nov 2023 12:31:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700166684; cv=none; d=google.com; s=arc-20160816; b=G6eHhNtzcNHyFTTu0sUYgrUKNpINlFbQFF9XTrpHhpuJidjQ4SU0aQ/+gzPlabxH9e K6x7TZedh/A+9S5OhOgsmEWsJVGTyBJvPpmIKazffyvs9/0DhwRXYcPEoW66XVwg+79j Zwjkc+qRrMKvqCkLfkWH9VrTqLJdvXIa23ms44t4NLC9QiUymIBoXA3Khja1y5wgBAbE M4ayBhE+pDoIYDep6JPHVedpL7hsG6no6gjMP+KSPze2K9jCn4qEWX0i45YcXFrNqAYv DGPTVJjEmJ8PVU/qgNt9EAApdhxY8iQbpp1GWlzjc2qonLwxTaBx2odmNhH72Edsy4Yj sS2A== 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=PEjWCpU7EfzbZkp/cS+44K0fOvV6SNfbaikoUgu/Bh8=; fh=m7ChAaP62mefYjgTndas/guZ525O/6R0Mq9l2biEjtk=; b=JteqswCJe77QzQvB8yyAWizmPmK8PBaR6v2CFnefQKcFVXlXi+KrbpUc8YTjpc071+ IUQTVspJh7xRWQKMEBOsvEwM8C4buqEfvOohu9lFg9Nh+/JTrJRiUGK7/OI1YRbOv9ju en2GyTswtkhLCzhuTsz7IoypfRWBh6RkeNYRa1EXUPNdob6kwQmXqyGIHRSP93xYrIpA 8O009Tcu0Stm1hmpEgSacB2ZoEyD0D0Kr6mYpTYJexURzc0bq3HEvSEFgmNeDNony1Jo hRsp6WI0cdDDZhf0ljp2syz1fboUNcwu25IF+taa6k9Qaw8nMYO5XkVW+R9j4r10EQuV bBqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Mltlf2OG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id n13-20020a170902d2cd00b001c9b2c2644bsi162414plc.451.2023.11.16.12.31.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 12:31:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Mltlf2OG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 86A39808EF63; Thu, 16 Nov 2023 12:30:50 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229533AbjKPUah (ORCPT + 99 others); Thu, 16 Nov 2023 15:30:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbjKPUag (ORCPT ); Thu, 16 Nov 2023 15:30:36 -0500 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE3D5D4D for ; Thu, 16 Nov 2023 12:30:32 -0800 (PST) Received: by mail-pj1-x1031.google.com with SMTP id 98e67ed59e1d1-28014fed9efso1031357a91.0 for ; Thu, 16 Nov 2023 12:30:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1700166632; x=1700771432; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=PEjWCpU7EfzbZkp/cS+44K0fOvV6SNfbaikoUgu/Bh8=; b=Mltlf2OGSIZl6NMhQ0FLbsxzYaCxySDWTbJUMotRpzbxes2Y5PUkJfFk+lIS6Qn291 aQ3b1jOHHsJj77GbgRhFZxaTpyO1XjACFPtJuUnUtBL6591LDI+K3EwMLYKcvT5xGinD zJqz5YPKZsWM8PGGmpU55QMGgSmi3kiR9ZsfUTFLwa9hiOn/xxicBiHTQAYzFPQ39F65 XXIrx4CVKDuisJw8p2IAy4+kgZk+bBBwQrBDwy8n+lfZJLIX5WsZSW0JuqOlYn4D6EMG 8wM2wnJbC0u5DYaa+kN86/M3LttKf2luxU+PyYMzVpDNiMtxX22b8UXf1KRFTylGuMsD qKVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700166632; x=1700771432; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PEjWCpU7EfzbZkp/cS+44K0fOvV6SNfbaikoUgu/Bh8=; b=PxiRkUX3KQlAXf35zWOMTory8ZJcjUprOSFyXRmHGhU7GKqEnIqIK6DJ2pO0Cqqxci S8hF0gezQoosEvO8e36P+Zf0A29Uk7T0AtpBvfNQ82qKa2n8ohzQmIlG+MPsaNYYuaDK E0ZjDml04IYNy9zmWBfKj5kaMJ68FYK46LTbKy/ADdhj5CdBn+RKYsqfyDCUDRxAdbK/ wSYSRqnnBRtmt7pLd/B2JhKDQ9pVHOtAtQr9Q/wY24oHSjv4qmKo7Ir2y72LxAvGAYEW mqeZ6u1WtMIoQKwBgGvJs/W59W2BdvqUl8xydh8wKneRmrmPn0NOd5MVlnAkB1NjQxkL KETQ== X-Gm-Message-State: AOJu0YwlywsJdGGgQy42e1b//I1fsAyy+CfLoKg0je4kWwAVAMEyeDto 9NHAvKutK4bD5Hrly7iHqLIGiJS0G8LEiQ/gobn0aA== X-Received: by 2002:a17:90b:33c6:b0:27c:ef18:d270 with SMTP id lk6-20020a17090b33c600b0027cef18d270mr13434773pjb.20.1700166632042; Thu, 16 Nov 2023 12:30:32 -0800 (PST) MIME-Version: 1.0 References: <20231113130601.3350915-1-hezhongkun.hzk@bytedance.com> In-Reply-To: From: Chris Li Date: Thu, 16 Nov 2023 12:30:20 -0800 Message-ID: Subject: Re: [PATCH] mm:zswap: fix zswap entry reclamation failure in two scenarios To: Yosry Ahmed Cc: Zhongkun He , Andrew Morton , Johannes Weiner , Nhat Pham , Seth Jennings , Dan Streetman , Vitaly Wool , linux-mm , LKML , Ying Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Thu, 16 Nov 2023 12:30:50 -0800 (PST) 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. Chris