Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1115819rdb; Fri, 2 Feb 2024 14:25:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IEKemGzQajz6lWZgxURk55zdkGTy+Ayti/JYDmqt1U/vax+xNT+XoNWjdrL4Drg9ZG3kpAW X-Received: by 2002:a17:90b:613:b0:296:321c:9bdc with SMTP id gb19-20020a17090b061300b00296321c9bdcmr626061pjb.13.1706912736392; Fri, 02 Feb 2024 14:25:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706912736; cv=pass; d=google.com; s=arc-20160816; b=R0pxML0ZzmQvuir4nJXyPcoRcDgUtKIVXQ7KgTfBOd6PSqfebX6KSO8Mja7iAblAnJ 35ORkTtjyt1EG9Z2hftFcIN3L0NA/AytxMikUZqcVeD9NsBpEEgaZLo8ZNVDWi2y09Wq Oagvz0J6dR9qwVKWV40WBZzs+uL/xtzlxk/l3ozuFBkKjautAbEzPRaMmpP+IcVCMfhp ZjS/wROCT1dPnI/Xk87QIOycoPXfNBqFbMXNeQsq/ElLIBPkUJgFvHUPN5CPkHWL3yX3 Jxq8P7Jy9JfDaWUBVtw/ezgC9J5aCknRKQOQzM768l4uxJpZMlXpoEx2qlzW8GeiX28N oN6g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=J/sn53AuQa/t9OBf4N+SZyv90hNss6ZsfiMdF+isiJs=; fh=Gzehna7hQ3JCZGe2T8H9KOdqImzTPZ39Xjyt6seJ2+4=; b=h1R64FGCBYJHw0eTFLtPDejWhiX/VxcxbqZ4wRqCwziPZhwoXUxitgMHJuA68mNcEy mk+C3DxIijTqnRjmzj/UjEjV6M8THt/NZS1gepDY9WaUQUSRFEU5IHTk3THMH1Mo9ua+ nraMv8GxqADdUfm+ELiN1sWIML1Z3TMLNPzZGosv8CC+JWf+cXN0jCugJhOlIPRmre0b bWz7/QVX3BKcuCIBwUOzBViLjXeDVvlxi/eyUGJ/HMEwmDSsEiNcyYHz7JxtxsRsyDvs NjuU2yozbxq3jzzK4cznfTHjLJA3KaZ3tnzKO3/AfR2qI7ZNnZip4GNDrOeOrxKM+IUa 3o3g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Pr5Es3o+; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-50661-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50661-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=1; AJvYcCXdnZNa5JMsJ6+8SdQPe/h+Ds/Ugzf9LvlcP8REcqLA9ZkPM8eQP9ZOx2rPAJRfga3US4rLvYvPg5x3YD1CeRZh4EhtJDYhBW8Ii3yyZQ== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id m8-20020a17090a34c800b0028b21dd5308si577666pjf.37.2024.02.02.14.25.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 14:25:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50661-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Pr5Es3o+; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-50661-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50661-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id DAC3D28B672 for ; Fri, 2 Feb 2024 22:25:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 31B3E8593E; Fri, 2 Feb 2024 22:25:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Pr5Es3o+" Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CDBB315E5C0 for ; Fri, 2 Feb 2024 22:25:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706912728; cv=none; b=bfNocw1EyZupJZQAXxF7dvkH50VYyZd4QqhmShgsuDPBy+hfv8VQS58KYyTUq+Qtlb4wSuRzlwPukTFWlb34GvonT2YOPlf/VcfD4TcpRCM1EAYQ/0+ulklVxB81BPUAiGME1E+Z+sN+AJawSbKkhEY9DFvlh4ThRW7JeVARlUc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706912728; c=relaxed/simple; bh=J/sn53AuQa/t9OBf4N+SZyv90hNss6ZsfiMdF+isiJs=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=jGAw1YiZmWje48+8mc7dOv8RqyBY+LtQ7dxdDvxIb9rFJyUmpWRGbaNwFmqgFqSr+LdURPueatF8J9t9iv874XfOfA8iNdbPXXQbymtlHMN7+VF6eHK48pfGRw9U5tD9ai3+p5Y9fgZZBC0amc6IEfoNRjDCbnYPWBuiUg9rxdM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Pr5Es3o+; arc=none smtp.client-ip=209.85.166.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-io1-f53.google.com with SMTP id ca18e2360f4ac-7c029beb8efso30214439f.0 for ; Fri, 02 Feb 2024 14:25:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706912725; x=1707517525; 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=J/sn53AuQa/t9OBf4N+SZyv90hNss6ZsfiMdF+isiJs=; b=Pr5Es3o+azN5JP7RVmjVllYuSWRw0UmneRO5PY+eMFzQqA1+7JWgbDh5qgJaQPNyaU KWPGmLYBSqE/FUbisMNnWKoHEWmJGcBnmyo6785jrE1yC60JWY6Uh2rOvQNSOLTgwUjV Udchf4/NIvKRZ3JYKcIBe1+xgCIYdnHnIcHitAuHRnIy6NHG12FRob08apKCybMeEZnl QCZO8urrO4k2S7t6CktPpuTLSCC0cNzLVWRLTAoKE5hhDUhxHi95af7NZXmFZGQ7DuWy RjKP04f8KB4dpXa+FZlB3db5zooPLbxWrzMa4KsOauch+tG/92+zXSD+PEfPPNjYAog+ kiWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706912725; x=1707517525; 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=J/sn53AuQa/t9OBf4N+SZyv90hNss6ZsfiMdF+isiJs=; b=MVHXb8mOwR8ZBqVedb57wypdi5yJkzVuZFb5pqin0MzOonTXUm8MNgK04GbQpFCXLl RBat0r+G+bXAfNn1z9tXs7lk2SUtgnx9jrcjCb4Zqiy56wqORnhYAhekPaujPz+ZRYOY cD698MVxy/HgKH5u2+44OJrDIVAFoqqdjktkI7XqyaOLoIrLxy1mMCS0jpjZrDu2qcht bZaXM8DboGVDDmBqD/ubaRvLSkDs2xSh6zcVlj6g2nH7i/ASQfnV4Q9WaE3jHKpvV7Cc dU3qaVZMRkaR9YrfRZORO/Z7XqUZdapLcyttFE7mJwfTX+HcmKid8l5BWCD4ZdpE6fVY jngw== X-Gm-Message-State: AOJu0YzV7ceS/MvO5gt60ghot/WW/FmMxEjIoZa3JvD05yNtdceT1lRg Vuli0uZ/Gq2uG1n6iu/N+PAkBNSJdqmplQbsX/Bem+M3CLfCPH0ox4bWlSy6m+d7YQXdF18SF3B KI78eG9KwXHhyTRp0wfzzA+XJQqc= X-Received: by 2002:a05:6602:2d8c:b0:7bf:e164:e4f1 with SMTP id k12-20020a0566022d8c00b007bfe164e4f1mr376788iow.2.1706912725540; Fri, 02 Feb 2024 14:25:25 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240201-b4-zswap-invalidate-entry-v1-0-56ed496b6e55@bytedance.com> <20240201-b4-zswap-invalidate-entry-v1-1-56ed496b6e55@bytedance.com> In-Reply-To: <20240201-b4-zswap-invalidate-entry-v1-1-56ed496b6e55@bytedance.com> From: Nhat Pham Date: Fri, 2 Feb 2024 14:25:14 -0800 Message-ID: Subject: Re: [PATCH 1/6] mm/zswap: add more comments in shrink_memcg_cb() To: Chengming Zhou Cc: Johannes Weiner , Andrew Morton , Yosry Ahmed , linux-kernel@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Feb 1, 2024 at 7:50=E2=80=AFAM Chengming Zhou wrote: > > Add more comments in shrink_memcg_cb() to describe the deref dance > which is implemented to fix race problem between lru writeback and > swapoff, and the reason why we rotate the entry at the beginning. > > Also fix the stale comments in zswap_writeback_entry(), and add > more comments to state that we only deref the tree after we get > the swapcache reference. > > Suggested-by: Yosry Ahmed > Suggested-by: Johannes Weiner > Signed-off-by: Chengming Zhou > --- Reviewed-by: Nhat Pham