Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp928642lqt; Fri, 7 Jun 2024 03:02:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX72woUFbNrfgPrdhLKnE/Jgq7jENXPpYfsFQRkUvGvoF0ybcW9MlJpKJiAC965ExbTZ1CBioPn8FL36yuPsqAHTvqbvWXzXvyNnGc9sg== X-Google-Smtp-Source: AGHT+IG06NDJQzZNbxE0lW2NACzpI4vcCCTmO4B8bjwdsh/966Fh95FyTz86dUbuKZ8RlaBGe+bX X-Received: by 2002:a05:6e02:156e:b0:373:7f70:bb8f with SMTP id e9e14a558f8ab-3758037ea48mr26356415ab.22.1717754552852; Fri, 07 Jun 2024 03:02:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717754552; cv=pass; d=google.com; s=arc-20160816; b=UqBiaGvm7Z+4zZI2ilHcJMM/O49oSTvV/+DuwQRF2Iogro7QWiQqKiU7/rYX8TXwN3 +OmppR35DZiOIqkxjaWs+/XNM78uC1bsYEbK18+139st952hGDsBZoQKuMVp07H6pC0f YlA2xhZczxGBzVfdaaedGEj3SGMuNGgRc+wUYbw87JFER/euFpZ+N7Z6XYOTqNdKx2Po dSfQqRWMca9mFpTyAco4SVYJPA5WCXDp7tzsZ9b5+NdRmD3Ez3ESjZt15OyWcL1VsJDP dyyXHSeAHpXRuAimJdD5PlECQa6LBxZR/JkJRfT8UxVizEyKZrf6uhBc5hmHKPcn5LAK TQsg== 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=N3eKsRnAYRK1h7qu28YJgeAnWFt3S0skQfE4J69qFxk=; fh=UWAnzW1Zl6s0Z46iJzuSldy9iNoPkeI+YitYib4514Q=; b=NQEusbyl989BpeT4MwWprKGOso5RJ7l3P0m5bmkWk8sSrorWlZN7cqv3EFicms/cbv hkf6xy9arr8sTyKCvVvzbdOaV/aGoFSIKnEFjEXlOx8/i8jRsmG/LwXFZEkmg6X+ENcF +wLVyjdQ+nMplB6wm4sYyg/hGV0cpsH0ZP/p0UwNHZFjjOVRtySD5Kt4l89VyHnvr2Cw 85U2JK671jBlBFPTJSe0rUBxgqMVcGV6L3bHoWSNFeLCWeyZAMmidewJ6v/FYLCKkw9i ENox0FZE5DyjgMT3oKQsguAhhRVlOe1s/YAy8iH69JCypjwBvEd7QKyjG2K8+T1Ea/ga 1Omg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=JMZRRWwQ; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-205645-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205645-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6de261cae2csi2750582a12.277.2024.06.07.03.02.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 03:02:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205645-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=JMZRRWwQ; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-205645-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205645-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 8CA30B2361A for ; Fri, 7 Jun 2024 08:51:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ECA6D15B969; Fri, 7 Jun 2024 08:51:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="JMZRRWwQ" 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 7EDD2525D; Fri, 7 Jun 2024 08:51:11 +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=1717750273; cv=none; b=G1h1Xla38vTLOE3Ju1pwfrNf4b4xBG8dtePeWdAuUeP1FIbwsrjVJILqnldPiDQteHto/5cMfP7L5v1ni11eeDL7GyiOq7QXcpTQCCARi5zefwmjoMSHxzhuHtfvr4TwCQPuuykDp4FLIB75sKzbhHmayLf/vtpSyg64/C+g1fI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717750273; c=relaxed/simple; bh=vpgHYf4KNjaS10gM3AzhCsI3g/sQUs9BDH6puuuj7JQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=c7i4ji7/jUclxZ02MQ58F6ggt8AF7qR9LVKLcxvmIeUFGqu3S8oKTmxPDzsoJ0gnjZOQEEDiCMzbPN6MS3nZZV8TEu3mEqNLiIlGqCBzgnFkq3FANEEdApDoL826tbxYIGE2MIlKUv9yQsDvFlN2fB80ZkayJL/Ko3yJVzmCQLc= 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=JMZRRWwQ; 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=N3eKsRnAYRK1h7qu28YJgeAnWFt3S0skQfE4J69qFxk=; b=JMZRRWwQsTsU7BtGunXVqRfkhz g6GjdKkVdNPkfyyOgBHxQDvAbn53C5lPynN2rJmPjJxftVNVQK3fMNOTYToo6HvtaAcXLFY5RyK78 HzSoxn9hnUMO03n3P0C5cUCCaRu12lTzPglLuZvuMiW0kqtj/rBqxFOZrlM4+0pZHXdeyehFgarn9 eug3hruCLSbgbQVdGH39JQ5gpzqEt8hqFjrfvkpvKyM58VF/TuvWiMAPqjkip1b8WU5Nn7VF3/SQi i+KEBDGLJwZRQWhIT7DHXJL8/uzObc/m5upJT9jgulskyH/IsPfXGUuS1Onpgfe5mmRud/234bjDz Cg4OS8vQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1sFVJP-00000004f73-0aAS; Fri, 07 Jun 2024 08:51:03 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 8EDDE30058E; Fri, 7 Jun 2024 10:50:55 +0200 (CEST) Date: Fri, 7 Jun 2024 10:50:55 +0200 From: Peter Zijlstra To: Sebastian Andrzej Siewior Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, "David S. Miller" , Daniel Bristot de Oliveira , Boqun Feng , Daniel Borkmann , Eric Dumazet , Frederic Weisbecker , Ingo Molnar , Jakub Kicinski , Paolo Abeni , Thomas Gleixner , Waiman Long , Will Deacon Subject: Re: [PATCH v5 net-next 01/15] locking/local_lock: Introduce guard definition for local_lock. Message-ID: <20240607085055.GL8774@noisy.programming.kicks-ass.net> References: <20240607070427.1379327-1-bigeasy@linutronix.de> <20240607070427.1379327-2-bigeasy@linutronix.de> 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: <20240607070427.1379327-2-bigeasy@linutronix.de> On Fri, Jun 07, 2024 at 08:53:04AM +0200, Sebastian Andrzej Siewior wrote: > Introduce lock guard definition for local_lock_t. There are no users > yet. > > Signed-off-by: Sebastian Andrzej Siewior Acked-by: Peter Zijlstra (Intel) > --- > include/linux/local_lock.h | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/include/linux/local_lock.h b/include/linux/local_lock.h > index e55010fa73296..82366a37f4474 100644 > --- a/include/linux/local_lock.h > +++ b/include/linux/local_lock.h > @@ -51,4 +51,15 @@ > #define local_unlock_irqrestore(lock, flags) \ > __local_unlock_irqrestore(lock, flags) > > +DEFINE_GUARD(local_lock, local_lock_t __percpu*, > + local_lock(_T), > + local_unlock(_T)) > +DEFINE_GUARD(local_lock_irq, local_lock_t __percpu*, > + local_lock_irq(_T), > + local_unlock_irq(_T)) > +DEFINE_LOCK_GUARD_1(local_lock_irqsave, local_lock_t __percpu, > + local_lock_irqsave(_T->lock, _T->flags), > + local_unlock_irqrestore(_T->lock, _T->flags), > + unsigned long flags) > + > #endif > -- > 2.45.1 >