Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp5506lqh; Fri, 3 May 2024 11:30:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXSmz75vTcgQqXDCUJ+3PXWSrgqEkqv56eqiAJD+f3P9PtV0uHw+MY5afeqLVw/Q5yJDGO9PYBbwiIst/MpqXhkRri5nYAAMS7BmHoF0A== X-Google-Smtp-Source: AGHT+IGvC/47Rz7TAZGtOeM8cg7P2e+dNn4+b7Myf6zzOpSBEAvCjpdubeoNFCPdmtxrGbZAvA8t X-Received: by 2002:a17:902:d315:b0:1e2:7dc7:477 with SMTP id b21-20020a170902d31500b001e27dc70477mr2988744plc.57.1714761025634; Fri, 03 May 2024 11:30:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714761025; cv=pass; d=google.com; s=arc-20160816; b=rUCSUVn3v0GAs5VKa20oSPGRkDMLyjcHnZXtJW/+Sg4bdQySFgm+WyZvDt1gU6/9Ke XPGRtNA3pnRB1iMoDQZmo0FCAmndZ415oo+dILHBiWDiAyUoEG3P2u4rFf8w00URUVP9 Tdae5KmKgQs6jcSqpjybPFGe/Vx542icuXdiyasoAwQP+mB0hF7Kpshem+g+lnk89436 AU18HJgkGyRQjry0ywtj5LS1i6T4DSReukdackMGPa1sLMUFQcXL21yzPCrLNGK1hdIK 7jCIhESahiBaNCSCnr2HVz5p25dxUs3DikAW6CHeoe/S3Iy+4oNUl1JCe5Zyc1rAnKBw r7RA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:dkim-signature:dkim-signature:from; bh=kqOsZwjUVyamGiYcxy8jPtVsK2vi9nUiJ6gwIp5xpHA=; fh=mRMHo6FEBd+e0N/0wwmt9BaEcwCnNTE8npQn9DDRWX4=; b=JIz+rEJDSGCSIfAYgiqvHYfHH4kTHJ/D3OysNyAKtiRwZ3OS6Ng4bH8wWwhWynYJfT Vu2ODpTfmFde9135Nlhbep966Kf60+lO/UIaQqeK+YMSeBPkjv7vun/MLdUyLNtvzLfP Ep4PpihBQIn0fJeLyk2Kko5HQ+XXOLlahMi0OMagJdFcQGOIQGRNlUAZJAvUWmeW+iKi KMkJ1WjYZfOPE100DKaKJkmkvr3Irt2SA7hagqfGafxFGHup5O2XnMB0UWhZ+zzk+r5y hXcCFWSL8d8Ki0g8tcEjnDR16HJWtEwWFQUzF/5M//m85nY9n7+7O/nk10Twn6QGCuze MDJA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=uPyhr+Ia; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-168052-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168052-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id k2-20020a170902ba8200b001e4e4f5a487si3281311pls.132.2024.05.03.11.30.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 11:30:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168052-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=@linutronix.de header.s=2020 header.b=uPyhr+Ia; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-168052-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168052-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 43E21281FBE for ; Fri, 3 May 2024 18:30:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D9CEE158A27; Fri, 3 May 2024 18:30:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="uPyhr+Ia"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="TzxsqJJV" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 8E07A15357D; Fri, 3 May 2024 18:30:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714761009; cv=none; b=qmtTDpOrOpaXsL6ZsQ0g866Qtx7EPJ44yG0t4Y/H3t2EhUx01raROrzoZPJfQrwdrdE35RjK+17GyHndSmyD5A5BR87Flpnh3FFatZ6LDQzE5+waxHYBoG7a821pUlWYFMoYuQnYUnU6p5JQEuTWquCcmr/OLkiLGuQbDCp+ask= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714761009; c=relaxed/simple; bh=ls6qSExaMi9oGHo1aKY5TnxWHp62QkOustRT2dJ8ZUw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=G1Oydp2MVPTFXmOaEFVm1HFJMJPxQ8mJdmcfNSHc+3F4VsbrycNj6sIVwgnOL95Phq8ldFy8GCfUn4/CU4HrZwPpjFWRlwD+9iDe4w7d7Tal6zGd6D7AvahA/Bs9q5xfZEcJeM7ufkJhTHCqfClTS4Wmr+JxnpWcoPiXC8ur/Mk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=uPyhr+Ia; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=TzxsqJJV; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1714761006; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kqOsZwjUVyamGiYcxy8jPtVsK2vi9nUiJ6gwIp5xpHA=; b=uPyhr+IaM4TTXkpfS4mUaGcqxwypUDiHODx7u6SXINmsWn+64+hp45pu/amaaEV8pA2KNh WpGRWIPkUenotXnlxXT345XXgx6hPo2L6YSRVoSVhbVUst3qxUgwtT3TVmOhQGhmfJT5DX dQD+TaJjYiy2Z4/c0NdLbXvJShXKu/rrhSc7DbEUQcYoKTbsfgSzlxK2gYPCCP5/jvur48 xr9C8vIKY2hyvPAbw0GW0umz/MNu8Ws/EWwhD5zqd5tDI9+08cTdjtqiME3l1XD5jrByZ4 2WbPQHeA3kcqKc1urEr038R5i7ba8qb9ahYfYztbxCq3GntzUwfABJYhtipyrQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1714761006; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kqOsZwjUVyamGiYcxy8jPtVsK2vi9nUiJ6gwIp5xpHA=; b=TzxsqJJVhweJyXxUPRML+Ux+ypJAEkV6+koJ8uMBvRS1T+Ul9ZGb/CIquFUPe7QK3dCnQI eRe7iPTAAZ2NZ6Aw== To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: "David S. Miller" , Boqun Feng , Daniel Borkmann , Eric Dumazet , Frederic Weisbecker , Ingo Molnar , Jakub Kicinski , Paolo Abeni , Peter Zijlstra , Thomas Gleixner , Waiman Long , Will Deacon , Sebastian Andrzej Siewior Subject: [PATCH net-next 01/15] locking/local_lock: Introduce guard definition for local_lock. Date: Fri, 3 May 2024 20:25:05 +0200 Message-ID: <20240503182957.1042122-2-bigeasy@linutronix.de> In-Reply-To: <20240503182957.1042122-1-bigeasy@linutronix.de> References: <20240503182957.1042122-1-bigeasy@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Introduce lock guard definition for local_lock_t. There are no users yet. Signed-off-by: Sebastian Andrzej Siewior --- 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) =20 +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 --=20 2.43.0