Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1143732rdb; Tue, 30 Jan 2024 09:05:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IEOlOayMkNH9Ma6Q2icGDttUyyCvkdyoH8L1lxqF9IYH06nd9A6MkzHUPoiwRBPqd10zhRG X-Received: by 2002:a62:6105:0:b0:6d9:bb2f:3a69 with SMTP id v5-20020a626105000000b006d9bb2f3a69mr4378091pfb.28.1706634318916; Tue, 30 Jan 2024 09:05:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706634318; cv=pass; d=google.com; s=arc-20160816; b=bVBPnIbmpuJ5Edq9+sAG/CTqmn2NvpT4EPbUibXZDeKRZVYaurSvgmccbGh1Eellco 1ljn1Ewl7K7slMfYqswE3vKm5esCGRzwvRmyJK4AIJzJARg+nfO4EJCX81oVTXtZql8d 3BNF1K8dzxPNW6L864B0RC+ZqMMiBIPiZdU2piM4OGuilpmi/LycfKp1Sym5iVeiSPOS iDZGx081MWn+Kk1kAC18GmVrxhUzaj97srBzsPMrX3MQAwlifsUQOxeFi7btt9G7Ri80 YtfEXXIfdrBXTf650s9m57wOqpnxxmSPNvOJZ36FH/oGBL4q0EZF6pIQZrh3xRm6Em50 l2cw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :in-reply-to:date:dkim-signature; bh=6OxUoyIJ3bgXe6LBTsvCQjNpEhIzQfA+N+joEQUVhLo=; fh=GeWS2T39Qrhrojsl2X4W+LcDOtuBfOeM5awrmn9BXRA=; b=kUjzFI4ol5sy0OzIS/ON+vvUGtPZx+2oPr4ZeX9Z3SvYvUIeSvDSzYqs6ipGj1R4hY B2J8+kaI6/+2QSuhB9uxBx5M/rsOVufoPTZob50YYuzmF0hX/AYs3/sbshs8WiOwmehI 1nVCYgWPBeITM4wz91WwfHmNTnZikHubAnxd3cor26Ec6WVClEufGlIvcaWhO2Rw4w9d uRIGIjRK99q6pjd0h7ErJBaTEvmEOGxhfJHhQbiRR9WCXVLiafjMmoIRkEJW37ADgaRV SZqysaLeOVAHMXzb8vK6XUEx71xkATLmK0F/kQqKa+UooQvGbkIPltz5UO/DahLkgPTt yCMw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=uEaB2tMH; 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-45006-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45006-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id t14-20020a62d14e000000b006dbe1b70210si7768129pfl.176.2024.01.30.09.05.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 09:05:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45006-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=uEaB2tMH; 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-45006-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45006-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 844DE285789 for ; Tue, 30 Jan 2024 17:02:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 15993128378; Tue, 30 Jan 2024 17:02:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="uEaB2tMH" Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.202]) (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 E2BFA1E4A1 for ; Tue, 30 Jan 2024 17:02:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706634143; cv=none; b=Z92EVWpcWwucxrYxKXwKVh9NVoO8TVrJOqUuVfRb6ue9Dn6MlCE4QxgoA3ejLmP282NZXYUXm9FrWF8C3Ajo1azHAV3daQdF943wpQNnS0CLWcZKmzlXMh0eaK2K2JZ05OHcVbwIFw6IXwOL6WwVcyF+5/0tCxYVbIfK5JXGhzQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706634143; c=relaxed/simple; bh=L/KdqVCV6Bzxc3SoLK/k21kGaOh5FQ6fpwBhCQsyUQ8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=CkJUNxAEIsEQwXELOYotYr37MyLUoKCh9YREPLvM7YbeI37SgIFifjOmyR/9vK1+OBkJ1HKwCQ83FKnLfFSkC0yj5e7r3ltgKsYM6MwUE5/+crfYwjNjLbra1scDz4ApsNqtTFSz0XyoB78dh8vQ8S4ithj+vPPxiHZOSMQAl7Q= 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=uEaB2tMH; arc=none smtp.client-ip=209.85.210.202 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-pf1-f202.google.com with SMTP id d2e1a72fcca58-6ddb83a5deeso4487886b3a.3 for ; Tue, 30 Jan 2024 09:02:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1706634141; x=1707238941; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=6OxUoyIJ3bgXe6LBTsvCQjNpEhIzQfA+N+joEQUVhLo=; b=uEaB2tMHCWHFvNnko7C9pYhyUb3xDinTfDQHRPxWh7AwF8RGHdy6PtKoa+g8c703j/ Z8O9J3XVjcEFFXzyuk/fKQm1NMAT1xJxKCPF4jHlxeoFrG8qvMLztaMjTUfWGXZtJHx5 9eFKAAGwkSPVs8tJ5fRLMx19RYZefK9oFDYSkBaFuijSMemzcvnmE6jIUnkynNsAKQib DM9UbRQWdL7oYrKw3CZDUYHAAJayj6iboAbbI+ETaXWdM6CTJqIaGj+5GPH1B1yKoBpp BnbIjp4E26T17bdVrrdjBeg03tPk82h81BOe9r7co9QwkMc1a8RJ+sBJli2jKBi5epM8 BRLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706634141; x=1707238941; h=content-transfer-encoding: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=6OxUoyIJ3bgXe6LBTsvCQjNpEhIzQfA+N+joEQUVhLo=; b=JLySpYSIxgHZaN3GPq65TszYhCJ0lBTR8KKKHkvQN/Mj9kMTEttjx3mKP8nbBt19Fv hqjCnMMDNl1c1LFnwqu0QWYkr4pNskK5C+7vGYBUCVYKmJhWNqIEAKu/LbCLTDv0tySi 3XjsnmO9OBHv/kAaWyLmfcai4LaRHEKvdb62AZBM2/JN1cL/Mp+aRSevImua6S847OJu nETBY/cN44gpGWbLVjgjzbWm8Tuv6fLNXJ+YlVStEaB0DZ4bHtTBOchu1+keCTuPWvqh JGIysj09z0Mt+cfvn6T5W+8g3GLnLD2tcfJ34wHtXnuBeOGRuqpGk9pwjcTdzvg5no3Q mKJg== X-Gm-Message-State: AOJu0YyPowTA/wfrfKtZ23dMT3SG44iinx270SuzB/q1ooinrI+Qp7qS SG1RC6y6FUDVFZuGiYCkfzIVFhX0TWsqWj5EgFJEG0hEW8s2cxPZ7tapIB1eLw2bWHJonBzPyY5 /ArLTSKErShRrnpYhSg== X-Received: from yosry.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:29b4]) (user=yosryahmed job=sendgmr) by 2002:a05:6a00:27a5:b0:6de:39ef:7e05 with SMTP id bd37-20020a056a0027a500b006de39ef7e05mr408355pfb.3.1706634141087; Tue, 30 Jan 2024 09:02:21 -0800 (PST) Date: Tue, 30 Jan 2024 17:02:18 +0000 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240130014208.565554-1-hannes@cmpxchg.org> <20240130014208.565554-6-hannes@cmpxchg.org> Message-ID: Subject: Re: [PATCH 05/20] mm: zswap: clean up zswap_entry_put() From: Yosry Ahmed To: Nhat Pham Cc: Johannes Weiner , Andrew Morton , Chengming Zhou , linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Tue, Jan 30, 2024 at 08:31:22AM -0800, Nhat Pham wrote: > On Mon, Jan 29, 2024 at 11:51=E2=80=AFPM Yosry Ahmed wrote: > > > > On Mon, Jan 29, 2024 at 08:36:41PM -0500, Johannes Weiner wrote: > > > Remove stale comment and unnecessary local variable. > > > > > > Signed-off-by: Johannes Weiner > > > --- > > > mm/zswap.c | 10 +++------- > > > 1 file changed, 3 insertions(+), 7 deletions(-) > > > > > > diff --git a/mm/zswap.c b/mm/zswap.c > > > index 0c6adaf2fdb6..7a7e8da2b4f8 100644 > > > --- a/mm/zswap.c > > > +++ b/mm/zswap.c > > > @@ -546,15 +546,11 @@ static void zswap_entry_get(struct zswap_entry = *entry) > > > entry->refcount++; > > > } > > > > > > -/* caller must hold the tree lock > > > -* remove from the tree and free it, if nobody reference the entry > > > -*/ > > > +/* caller must hold the tree lock */ > > > > We should replace all those "caller must hold the tree lock" comments > > with lockdep_assert_held() or assert_spin_locked() or something. > > > > I can send follow up patches on top if you don't want to resend this > > series. >=20 > Agree. There's also this: >=20 > /* should be called under RCU */ > #ifdef CONFIG_MEMCG > static inline struct mem_cgroup *mem_cgroup_from_entry(struct > zswap_entry *entry) > { > return entry->objcg ? obj_cgroup_memcg(entry->objcg) : NULL; > } >=20 > which you pointed out in the per-cgroup zswap LRU review :) I will send out a patch this week or so.