Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp513841rdb; Thu, 1 Feb 2024 15:55:19 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUvM+wwdxqnyEhwzJHeZKbqIDZBN0dHKW8QGrBTV5wqQkbTCf9+kxW3w2CDjgyBJuEso8G+leCJTqdrnzmHFApBoaA7w9jFFe3LJcD6GQ== X-Google-Smtp-Source: AGHT+IFoGDYx/ucLdEf97CP3GRD3gVtWEHgTLoxxxdC1epqTLtNl0KgGj+7De0xFTzJWZ0vgVreX X-Received: by 2002:a05:6214:2502:b0:68c:814e:e972 with SMTP id gf2-20020a056214250200b0068c814ee972mr453896qvb.42.1706831719117; Thu, 01 Feb 2024 15:55:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706831719; cv=pass; d=google.com; s=arc-20160816; b=aDyXJhcJ+Umw7RR2VF2EqwOxWfjQKMzB/EZvN0ThOETuYCEsEXfB5OHv7NBbS5ljBq GHv2wk9tEyZDV6l9+j1/44Fcy176H9gMgKiwVjAG3PMUWCOgDIOlGe6rQ3srjA3hGWmI 7ffR/3Oe3eAd/Ht1HFwwI0T/S7wgdaVQAUP4sSW53H1+oLxRt9pqq6JuVrtz43Cb4yhk WVzkMlimliIYeApnLQOtO2T1vRPXGL3KjnFyVOd7jVstquB55aE2N5ND1Wxwy7c087Jv scOjS0laTiEJhaPJIcIbpOOO5nFGl/p2XYXtrOn8juNzKwGnNChIp0yjE37ixYg6yFoz p1dQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=oPoNxScY22KtGi7I65v3KQkSSA7OlIpnXFGU1MLqXvc=; fh=0DDwxAo/iAomRVPebYh08RBaIKC91/ZCO1Gguvhi4y0=; b=cGEbjzecq7FYV0flYQwH1B4B0ETU6ZXDsU+/O/tJuCNQ56m/Svt3SuiDxDl2WUFVX0 UooSbhPsM1FYdrejevNiOU6/XlP/eEY/eatpxfAUApfhNWnqVfY1IYPUgSKwS9knU989 Jarkekiqy37ga8MRIXO4KWswG7o2ylido/W0ERZHHQmsIbT2YdyWigpq7i4o2r+yGDwP p5qsm2kADZcXfMdmStTJ8l/65b88rmVxVD4vsMCWwnvHSzSijBn9VK3RK5DiAn84niSQ 1Fu4TFuNey/2nFMdDUlmDDDmTsyBR4cpAJ51cP+z9ZRpl5E27Jxv9OtESbQ/2gunm5dQ 58Pg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Qu5pl20a; arc=pass (i=1 spf=pass spfdomain=flex--yosryahmed.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-49010-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49010-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=1; AJvYcCXaWFVLQP2ME4UomfpSu/Nd5RZLUwpmAQTcg6ZF26pg/psePaypKa6LvzToBmEEkHeuTCc569rKGJtgyhHa46D7ch5V9VOwpswz/YL7iA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id qm8-20020a056214568800b0068c8487c789si652984qvb.326.2024.02.01.15.55.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 15:55:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49010-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Qu5pl20a; arc=pass (i=1 spf=pass spfdomain=flex--yosryahmed.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-49010-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49010-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id D99B71C2170F for ; Thu, 1 Feb 2024 23:55:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 71B9C47F69; Thu, 1 Feb 2024 23:55:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Qu5pl20a" Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (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 10AA736134 for ; Thu, 1 Feb 2024 23:55:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706831711; cv=none; b=mxJ3THVVGqq3135OQbpGozCmMmtqq9XGSU9PI4xL3d0RAyHGZ7eiUqSE+aWc0VTwl7K6kn0evQI+0JBuPNnfWa5uZqmn1L9/bLcTSVv0HipD6KnaqYk8GYwKABrauAhW3w025Syo7hcRw1Ify2oWemW78Bui42hIPWf6Mp1gYqE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706831711; c=relaxed/simple; bh=4I8+ID/QCgVbvpHEKkPVczMNuLT5+SxOXot/zYU2Ycs=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=liyr/nv0g1x7knND6pmL3eWEG72cEsaMln0SOOBHjEs79bMsR/EwYv/DE/zSN+4M/yKFo7Gs0g96bPshkPR6jdgjtwGcLYUK/Ea3bHDVNCD6magUudEWxV7UPilk6KPU2vQ+WzlvZckjr2EvPqr6ih+XA65XQlIAWo4llLLPuBw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--yosryahmed.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Qu5pl20a; arc=none smtp.client-ip=209.85.128.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--yosryahmed.bounces.google.com Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-5fc6463b0edso25221077b3.0 for ; Thu, 01 Feb 2024 15:55:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1706831709; x=1707436509; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=oPoNxScY22KtGi7I65v3KQkSSA7OlIpnXFGU1MLqXvc=; b=Qu5pl20aOA3bFv/3ii4sGPTwWQSTp3llVv36NnUaOg5bsGzD9SBdEL417RsF2aARX8 f8/O8QBc+AGH/Zv7+0h3MYl1BV4zaqFqr4Lvh+gn0I0B0DQV1o6BfQ1YxG3VUuM9NjS9 3AOV8Ip0pQdHE8iRZ3e0Koq0Zs1EWRlaEPPXoiJkBE9TTnm6FpcWYGcjEfXuivgM8Rzj q0QAnw+FDxdIivDFTD5R0KdffonuOe7gSA3UxsfPpaa4MfRoT23qJGvsXHTjl+PLr+qd VSVS48PL+YMLuZwKwfc36gj+OgBGPd9tNnc601hQ/dTafHYEH7i9Ym+E8NsKWBz/4Sgd HC/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706831709; x=1707436509; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oPoNxScY22KtGi7I65v3KQkSSA7OlIpnXFGU1MLqXvc=; b=Xi9mfHorV4Ic0eUODfhNSwxerEKuxXEyxBSsgvCgL3+IaukNF2MGYgumBiV/F7tVsp zK9AeD4zcZrelWcC16qLpz4U6sxlwndn4rdjdYpcTHRSQ5uIwet3yiBHN/yBtl67fSfA Jm5G14uHMbNZNsDJS0QerHtwChHruP39OqZG1dgmwlUdRVBZJ/0OBbbeO8gPdTpzP8UW VVBN9CELoUIutng2B2dW6RHJMm4yO/vakbl6wwEpom9u71XRbzuT9SWQ6QOQIjcn67nn xgAMxGeKGI7/IpSlANZJOYX4efIXWq0eK4TgkgT/DOE6NBhbqWUEfv+PpW1o3+ZVlNiS C4Mg== X-Forwarded-Encrypted: i=0; AJvYcCW7Y3kpQMpqox+opPclr/ffq3sTilBzRa65hTSdIBlbwCqhKk44LQ2/JWlEkgOuUyW4V3yAao2sXqmEHvxDzXuehSIjVOMZ/fp9WKmR X-Gm-Message-State: AOJu0YwjLZ0ajwNnmwspq6WDJBlh+8Dt8gJ1qbNrUWKYE987lWk5CYA/ qe4V/JhInrdd0bBfLnlT6w4uHazV4NoGYfJgvaXoMKpbD/UP9CHzT5g2HGGYpgBtrDDDkKlVKeP uviB1tvJd6lEHHj86rw== X-Received: from yosry.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:29b4]) (user=yosryahmed job=sendgmr) by 2002:a05:690c:12:b0:5fc:4ef9:9d6b with SMTP id bc18-20020a05690c001200b005fc4ef99d6bmr116493ywb.9.1706831709102; Thu, 01 Feb 2024 15:55:09 -0800 (PST) Date: Thu, 1 Feb 2024 23:55:07 +0000 In-Reply-To: <20240201-b4-zswap-invalidate-entry-v1-1-56ed496b6e55@bytedance.com> 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> Message-ID: Subject: Re: [PATCH 1/6] mm/zswap: add more comments in shrink_memcg_cb() From: Yosry Ahmed To: Chengming Zhou Cc: Nhat Pham , Johannes Weiner , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="us-ascii" On Thu, Feb 01, 2024 at 03:49:01PM +0000, 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 Acked-by: Yosry Ahmed Thanks!