Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2013087rdb; Sun, 19 Nov 2023 21:52:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IGgthLXZ5Hp83FMyTFUaKVlLZM0HKifqwSa+O/R1+bUEzibgkMgBcUL3dFA7Vk2KqXOGt2s X-Received: by 2002:a05:6a21:788f:b0:187:1cb7:337f with SMTP id bf15-20020a056a21788f00b001871cb7337fmr17368659pzc.15.1700459562948; Sun, 19 Nov 2023 21:52:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700459562; cv=none; d=google.com; s=arc-20160816; b=RtdkHLzwvAiKmJ3e/9N8SAkZDy7U17mhP/qlZPrMgWnl65qyG37BgfNU9Yb98nFmI1 1xtZzjS2/Omhc1ASl9E54RLRnzeX08eHEPVfwGQrAeMYgXF3hS0oX1cME2j/S5liF/on 1g1VeT8u/dfC9M8gz9Fs5Fk+v+5TQj61OKCYoh7QCSyytOPkM601rYfnUU6+l0LqI3wX spfyAxeYzGxMZv0ucd0uh7JE4bcH7XfHwyS56wAgeTMf+dAV3jm713AVPz86w3GU3s51 vk9Oc0IX+GYNwYEn8OangQzOTYohaFILdVWheMDzaic0sv5XrIv8KXFWU98em01hY/Ul ekQw== 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=6Mllcf6AYt4DBYP46+o5Bb7s5cu87ckkFhDdXhlP0X4=; fh=1mxT+NUX+tc1CvpSASSRJC6okAfzo9CrbNb0JVTpdEQ=; b=TJu/ev/wthOje0256HS43d/8CQFPY7ur0PJh31+yUtPa6OIDjlSls1pSXPgpp2O0OX rEzyHFJ4IPMPdqGHucK4o+q8H2wZ0/RwdytvsAlJWDz4ZGRCLha3ePoauurn+hLcWmzk QgTYEOX+WhbTfE68RUt+d+xuTpxaYGVDooQr78ue07uivI20AM1VlNW+YY0xhrzvMlZl GPXDHVXfHQzax4Y9cfiiNujjuvqD1X4BdoNAz3kDQ2oPChPykliwOUeUChobvvZzxcrE da0V4x4MLn5gIgS79l21czNbPIoSvmqLQypjza3YN1zPBU8WoUEx8xwZ6Aht1TXa8+NF JfwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IKm20+6a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id cl18-20020a056a02099200b005c1e762bc50si7895588pgb.742.2023.11.19.21.52.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 21:52:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IKm20+6a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 91DB88053C54; Sun, 19 Nov 2023 21:52:40 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231949AbjKTFwR (ORCPT + 99 others); Mon, 20 Nov 2023 00:52:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229483AbjKTFwP (ORCPT ); Mon, 20 Nov 2023 00:52:15 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DCA5C5 for ; Sun, 19 Nov 2023 21:52:12 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D111C43391 for ; Mon, 20 Nov 2023 05:52:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700459532; bh=E9ujdWu0JkGB4tMSSGQ3StztKVc8mtmrd8/ujNEDyM4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=IKm20+6aNU+9zmsyjxbzhJ8v/v6iuMU4T5yewPrRS6d8F/f11vTn+9mZJDnA/Egs/ C2oxO1RqQCidkeHQZhOATAO5styFoWTJlOCIZUbCxOPyNJJdTxj7c4ceW2NJPHVBiQ UFFQSvpjYbr106i4hx+io3+bwlt7kkA/g3yPBdhw6yzWlbrJsbveGhV+EoAXBk3frl XJ/P6XDjdqTlpOMPuejNCc5u+h2ZHWAf3jSRBSHt7Yyt1gPKY1rtC6d1KRgAUDEjJF MkWyBq1Tg+6RRCgfIO96OjdpEyJ2CTasJ1TpxKSdAemB3Nv/K2gBk+RkzYE5opGJ+r W2jhKZy+zRS5g== Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-2802b744e52so3408920a91.0 for ; Sun, 19 Nov 2023 21:52:12 -0800 (PST) X-Gm-Message-State: AOJu0YxFpJtRMyitQFqdVnPNTxGm6fH4hDEqjlYGQoFOOY/2mWjEubX6 36jt1dXUdTDJP6kl8FhROg8ECIS6OUZIbqr++7OqRA== X-Received: by 2002:a17:90b:3b82:b0:281:d84:a97e with SMTP id pc2-20020a17090b3b8200b002810d84a97emr9133820pjb.2.1700459531497; Sun, 19 Nov 2023 21:52:11 -0800 (PST) MIME-Version: 1.0 References: <20231113130601.3350915-1-hezhongkun.hzk@bytedance.com> <8734x1cdtr.fsf@yhuang6-desk2.ccr.corp.intel.com> <87v89xasq0.fsf@yhuang6-desk2.ccr.corp.intel.com> In-Reply-To: <87v89xasq0.fsf@yhuang6-desk2.ccr.corp.intel.com> From: Chris Li Date: Sun, 19 Nov 2023 21:51:59 -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 agentk.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 (agentk.vger.email [0.0.0.0]); Sun, 19 Nov 2023 21:52:40 -0800 (PST) On Sun, Nov 19, 2023 at 9:41=E2=80=AFPM Huang, Ying = wrote: > > Chris Li writes: > > > On Sun, Nov 19, 2023 at 7:20=E2=80=AFPM Huang, Ying wrote: > > Per my understanding, memcg uncharging happens in > > swapcache_free_entries() > swap_entry_free() > mem_cgroup_uncharge_swap() > > The swap entries are uncharged one-by-one, not Yes. That matches my understanding as well. I think I am using the term "batching" very loosely. My bad and thanks for the clarification. I am referring to the fact that in most cases, the free_swap_slot() does not perform uncharge. It is grouped together with other entries to uncharge together inside swapcache_free_entries(). Yes, the uncharge itself is done by a for loop page by page. No batching in the for loop. BTW, Not all uncharges can be batched, because they can come from different memcg. Chris