Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2081230rdb; Sun, 4 Feb 2024 14:26:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IFOuE+Ok95Sa7ipZAi/PzUrOYoPFpTLi+2f5sh4h8Ry+cP5oEBe9ZLC0kuhf+1a4QDZbSo/ X-Received: by 2002:a05:6512:1150:b0:511:4e0c:bc3f with SMTP id m16-20020a056512115000b005114e0cbc3fmr1211460lfg.51.1707085575073; Sun, 04 Feb 2024 14:26:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707085575; cv=pass; d=google.com; s=arc-20160816; b=DZ//qUuVo/eqcnG5Mz7pEaUQdquGMtAOt54q9mqX0+0nsb3xITVvlNazn0pi/QSfHu MVs45iZROHTP515D1fYAfusq22AFWQ1pjYE0v4L9KaLBwy1XviXfMdHG91nOqYXA0WwI +FsWS4af7uIoGRXs7s1iYWuUdY84CxkASlpgStqXM8mzPPxFbbC6OWU+dIrf16cN0X/l IdPRtNt1fwwuS2618sHxV2ZmaXSpNLj18GtQbKogW5jEa8KufdT5xedIRH//xuXIWiPO hRZf4Ow066SRxU9DYE3p+OuW20zBHc9lHrAjVlaPQrnOInFIaeLyYufs8Htvj+MwAi2K ZtqQ== 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=ZrsQ1gAPq8HHoN6t4ZwPfn1Y/MogSDe4++j+eW6F0Ds=; fh=7mHnzp6ZRWRT/25GURM99y+sYSgwTmKVp0y8iXBL4I4=; b=RRMe7yPSWRDQlVCyN/N10xesvjMHiXZnQdcjhlnja0k0qp1fKcFVdq5gbSBiwrAAEG CXbkY8+vgrIoTumNnnPJvJ+FDCBoR75w8Fs8VVE66TKfnyAdsl78KsUJgGOdGa15gg6Z 4nCu8su5N8lhrtkYvdTc5kIzsZzHuoJxLvQt18Vn8k2YITnSNE8wxPD5ErujHtcTL5pK NBwrdTVsOINDB1bToORo52+7X2xwdjlCYMqJGoT+ri6DjpSa7S7YApyOBOVadSt5Y4dp Mjcoodszfc0aqNojOcno0lWd9bpm9u52vPETBAXI9DjwrYUgfgi/1Q/Gcls6/URMpwI7 SvHw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=MRuPTXHT; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-51847-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51847-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCWw8T0uv2l/KAG16/DR4i6B9PJhtk4RR3DGkxkZ3tGCxif/8aBsjyJs+6yIxvzaDRo05VnDNMokxSNLB4NQfprHbbrAlSwWySccJM8d4A== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id h7-20020a170906590700b00a37a576020fsi702201ejq.507.2024.02.04.14.26.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 14:26:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51847-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=MRuPTXHT; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-51847-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51847-linux.lists.archive=gmail.com@vger.kernel.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 8667A1F220FC for ; Sun, 4 Feb 2024 18:46:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A885224B54; Sun, 4 Feb 2024 18:46:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="MRuPTXHT" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D2CB9249E6 for ; Sun, 4 Feb 2024 18:46:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707072396; cv=none; b=mWIG9NluhsGXVDMu41Nhe83bh5t5NphhiNYQJssx6kecTHrUACGAmy7VKyErzxE4xWp9deQNDl7xuQ1vM2R+EXifBHpseqrA2936vIiEFa+jc/RlZlvJRjVcW7xNHKzEa7ri3Z/YGMz8q1WxOSIEp6XcRgghP5J0XgWwdahO+4k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707072396; c=relaxed/simple; bh=48waK8TfpLHDDxFDxz6XIBRX/g5bIPT94fN2TREShKc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CGSMGDP1Y93ckNBwwrIJd+v43F72U/z/LwJCd6orOaz6ZeMFJypioVGbYiAyuzGiap37SnezazMkZOS+6lc8td6L3bC6ueIH2VTXGuTuMEPie3iCerZv2W3PEvYR50LJG7YrhEg7hwukx7kuvftZlfN5IAUR8HU69UN9F9kZLKY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=MRuPTXHT; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ZrsQ1gAPq8HHoN6t4ZwPfn1Y/MogSDe4++j+eW6F0Ds=; b=MRuPTXHTij8SUOHq7zubl7+0kV LhuVxhkxJKFLVAvN4IHGYKpLlWxAXF+QtQ5Pth1/2Lmref4bZNU8RV0kiJjH9XsZy4T/vIevN8hf0 Fvh5IFSlbxtHD0b6PkM2jiWSQkecQm8t/mTE5Z0ZBGRAwy19uf2zKSdtfl8yfjSuCY54CysSD4VV0 linZIW/RtA/YflH8rXNp5+KLPtKAj1K+GbT81O4s8YrNJWAabSPcBtpWxUbo1XgLlIw6DgOsLWtor uKdUOlrRAmR6W2ngUaWrmcKxhl2WsIAC/FNZmah31H1zWYXaA38gUmeMRj2K43wY4Bh1xpoNFl+rq eOcYk9UA==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rWhVc-00000007JSF-1nKO; Sun, 04 Feb 2024 18:46:28 +0000 Date: Sun, 4 Feb 2024 18:46:28 +0000 From: Matthew Wilcox To: Zhongkun He Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/z3fold: remove unneeded spinlock Message-ID: References: <20240204125404.2112384-1-hezhongkun.hzk@bytedance.com> 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: <20240204125404.2112384-1-hezhongkun.hzk@bytedance.com> On Sun, Feb 04, 2024 at 08:54:04PM +0800, Zhongkun He wrote: > There is no need to use spinlock in this section, so > remove it. I don't know this code at all, but the idiom is (relatively) common. It waits until anybody _currently_ holding the lock has released it. That would, eg, make it safe to free the 'pool' memory. > - spin_lock(&pool->lock); > - spin_unlock(&pool->lock);