Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp463157lqs; Tue, 5 Mar 2024 07:09:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWxS5gytDmmDkNkAanfl8CXiOyudN+FtG+ewAZqPLW39cxaFOcAKGvydaema7q/qS/ZpqLd2ChxGhPecghJt4tX7tcyKzHRlHXblORA3A== X-Google-Smtp-Source: AGHT+IGD8zvazkiJ77MuRT7iqN4+8Jwr0/yCohgtytSlC/vgj5TpF7x5rDLld58jY0sMwPRnIOEJ X-Received: by 2002:a17:906:7fc8:b0:a3f:d260:4a72 with SMTP id r8-20020a1709067fc800b00a3fd2604a72mr3269187ejs.27.1709651376994; Tue, 05 Mar 2024 07:09:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709651376; cv=pass; d=google.com; s=arc-20160816; b=kHeXFmcRnZDngxjJX/OcB/M//Xbx4UAwKraHmZUGc93LvAO4/MV9xAVRkrIG87vEfd K6FjuFidE+l2bXzOYXiaDWjo9ZwjTrhFT8yXZvWT633ori5UVwQx4IoVa20LLqe14Jer Bn9F1sYIbo6hxmvrAOcPH0gZE5WUrTcbLzGuZRZRqgHxW4JDRyuGIxWy9Ezyx69b/tYj jZ1mAOfNqb7nwxIzbZjeUWToLZa07wcBJ/NGOwcBKgVP/0ODoGZPZM5xrNtq2Qj+aI+N DbXT/+CzWtvXZVN1h/cMaGg7CyezAiS81q+8wqCIpS5wNSvT/oqYO+ABPd+l+njUUcsW MIqw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=sMJUcs7j0iO8KThfdIZ+8SZ0/aXDPhgmGxD0Vm/szV8=; fh=MmeGxiQsAlbRuBZYdNzhyqSVZq7dUPuk7owfjxQ/tpU=; b=Met4eVlwCX4gdFF5DsCPUm87A+PDd7SsMn0K3BFGRNY2c+1Ov4ut3Kqu3j+SUIBB6d NzOLEX6L6KwtcigDuqBjF6zQlG8JlgiNgY0LfTz3NGl1q/BoH+aVOsjlXi3bJ+OUA70f Pu0aeEqr8DURA1nA+nS7z+in8QPm/zFDPXkgNfqFfzZ7CfVMrGckVyhzmsXQqqgYYyaU Lwa4L7Eo7KSxSkgg1LfOPu7iRVrIJNhvX/Eknou0n7XWwRQGIM8ekRU+Bfe3Dwm/1lIQ zU9xdm++mXqo4mwR+3rGE93HLCNsNJOIJ2z40DVhqf/aSYFL9SjZycPIkzvEbgbIrqm5 Pw+w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=3gTKCYw5; arc=pass (i=1 spf=pass spfdomain=cmpxchg.org dkim=pass dkdomain=cmpxchg-org.20230601.gappssmtp.com dmarc=pass fromdomain=cmpxchg.org); spf=pass (google.com: domain of linux-kernel+bounces-92579-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92579-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id di17-20020a170906731100b00a45accef61asi468226ejc.190.2024.03.05.07.09.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 07:09:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-92579-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=3gTKCYw5; arc=pass (i=1 spf=pass spfdomain=cmpxchg.org dkim=pass dkdomain=cmpxchg-org.20230601.gappssmtp.com dmarc=pass fromdomain=cmpxchg.org); spf=pass (google.com: domain of linux-kernel+bounces-92579-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92579-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 835621F23712 for ; Tue, 5 Mar 2024 15:09:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 926FC1272A0; Tue, 5 Mar 2024 15:09:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg-org.20230601.gappssmtp.com header.i=@cmpxchg-org.20230601.gappssmtp.com header.b="3gTKCYw5" Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (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 6BC0A4683 for ; Tue, 5 Mar 2024 15:09:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709651369; cv=none; b=O1PCGY9Xqrp5A6lqStwNr18P4ELWhS9/pmyplAyrtykucR26KfEkAmasWYaXpi09KBPXyeuqmNkTnFwTIIZs5MUlB/1ganuVYkzfZTv22t3xZFr6mXehODbfPLLaBkCrBBvVYiAW7d1T7VcbvndmEd30lDRsAFhoOZaPe67XsWY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709651369; c=relaxed/simple; bh=hdCuVGSBUPeP62wVW13hZzP4jReqsbbFglcuHtVJNfM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iFFZokeYJ/7sK9nLRCj8qNpp0+VrYagwpA8+2czzhWNcnjQPYKmmJrVg4IKVF0rwNcQgJ1hOsDdYug7ZzBd7/CDvMdLR6E64/akQHGBxwrt0h/vLAMGAdQ+XDkv5nFaXfBYikycVzOa+phRRw1HodTn9Rx/JqsJIn3RKsBrNN9k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org; spf=pass smtp.mailfrom=cmpxchg.org; dkim=pass (2048-bit key) header.d=cmpxchg-org.20230601.gappssmtp.com header.i=@cmpxchg-org.20230601.gappssmtp.com header.b=3gTKCYw5; arc=none smtp.client-ip=209.85.222.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmpxchg.org Received: by mail-qk1-f171.google.com with SMTP id af79cd13be357-7883810ff3fso23259385a.3 for ; Tue, 05 Mar 2024 07:09:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20230601.gappssmtp.com; s=20230601; t=1709651365; x=1710256165; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=sMJUcs7j0iO8KThfdIZ+8SZ0/aXDPhgmGxD0Vm/szV8=; b=3gTKCYw5btQGUCqqENFghLxvffYiJjL2Gy/H+Y77SOS0xE2rpYL3J3VXUDqp20BeUO meolbe0sHmHMA9JsI+YahO3rYX512ytM9z8839BvhmstCX1nzwDM1R6gGD6NB5j6wnMz 1u216vzd97xehCBVUXtTNj5E/BxBU6B/xAHgdo+3dk5Q/YMTVlkRiRp+SHEcbYMKmAvv Ps2Y7wT+67WOsIjkaDuuV8kgm17Cc2G4LQKKPWgq45xPbeR37OR8FO0AuCOKUq+nSAGq Zj8F31+oDVe8CwABCCnwJWJS/38DUz2FY4Hwg5sQJ6vryOCGp34YLeKvEbhF4WIkFE2K 1NBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709651365; x=1710256165; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=sMJUcs7j0iO8KThfdIZ+8SZ0/aXDPhgmGxD0Vm/szV8=; b=dKQEcLLIzKhB75jVhREbh89SLLZ/b9a/ozPvbgyT/Dd8Q/Ur3WPxpxiZpebbnTZ9Vg JIUH1quUOSMjOXvRxjBUQ3H8tmBeKpLxtvc0Vgm6kV86p/2GJXFD432Sk0+FfCzyHxMg diZyGqeTz1UMAsR6w+8kIjzLZGK+/EeoNyU1avNtfHLL/bTWqfMLe8d7yCFPWC/WvlP5 qVp+69UId6COTws4G1rZsLLUHKKQqTu8m4v50NPbBHwVKzeL+pycZDcEWiwWn1ZYQ0lg YPx0d0Bewe2iXNqIEPMWEDtL1XHLy9H2fdBQi9VZX9LKgO5cDlyjvR3j88Pc0TwWreT4 Hc+A== X-Forwarded-Encrypted: i=1; AJvYcCXnQ4aAqr+aik+oslqeUcGhAoxDexYK/nSr8YiI41tk6Tp4CENybCmscPPSzlVOWOOic15qu4A5mRSh1ACuXcG4VsFdxtzMzhlW6CWs X-Gm-Message-State: AOJu0Yxu9ehKD/i+3PmtA4O/eqWX6v8A/ejXzgN3WQXthCq74i/iuFzS zpnvAkspGdsxUIXqazuD1yi4Rkw4ugMKXo0HrSo+7v1m2UGso/xb9mMd6sMPx8Q= X-Received: by 2002:a05:6214:70b:b0:690:6e84:3e11 with SMTP id c11-20020a056214070b00b006906e843e11mr2241127qvz.63.1709651365113; Tue, 05 Mar 2024 07:09:25 -0800 (PST) Received: from localhost (2603-7000-0c01-2716-da5e-d3ff-fee7-26e7.res6.spectrum.com. [2603:7000:c01:2716:da5e:d3ff:fee7:26e7]) by smtp.gmail.com with ESMTPSA id qq3-20020a0562142c0300b0068f11430971sm6328206qvb.35.2024.03.05.07.09.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 07:09:24 -0800 (PST) Date: Tue, 5 Mar 2024 10:09:23 -0500 From: Johannes Weiner To: Chengming Zhou Cc: akpm@linux-foundation.org, yosryahmed@google.com, nphamcs@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel test robot Subject: Re: [PATCH mm-unstable] mm/zswap: global lru and shrinker shared by all zswap_pools fix Message-ID: <20240305150923.GB1491027@cmpxchg.org> References: <20240210-zswap-global-lru-v3-1-200495333595@bytedance.com> <20240305075345.1493214-1-chengming.zhou@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240305075345.1493214-1-chengming.zhou@linux.dev> On Tue, Mar 05, 2024 at 07:53:45AM +0000, Chengming Zhou wrote: > The commit bf9b7df23cb3 ("mm/zswap: global lru and shrinker shared by > all zswap_pools") introduced a new lock to protect zswap_next_shrink, > instead of reusing zswap_pools_lock. > > But the problem is that it's initialized only when zswap enabled, > which causes bug if zswap_memcg_offline_cleanup() called without > zswap enabled. > > Fix it by using DEFINE_SPINLOCK() to statically initialize them > and define them as multiple static variables to keep in consistent > with the existing global variables in zswap. > > Fixes: bf9b7df23cb3 ("mm/zswap: global lru and shrinker shared by all zswap_pools") > Reported-by: kernel test robot > Closes: https://lore.kernel.org/oe-lkp/202403051008.a8cf8a94-lkp@intel.com > Signed-off-by: Chengming Zhou Acked-by: Johannes Weiner