Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp859386lqt; Fri, 7 Jun 2024 00:06:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVzwKibnX6sRa2qY4TeY25WdBuVyHno09zY7NyQ10lPb4CoF63ZHHjGcH/VCInopiP+g59hezBSxCEkJQ7vbxTiNhY1khmAa5Of2Wrkaw== X-Google-Smtp-Source: AGHT+IEHCWI2vmXCAXv26TjrAkl3y6E5PS4OJdTMTE3Ga+xvIKB9ovQJLm+SJqYPXBpq6u6mfAL0 X-Received: by 2002:a05:620a:4146:b0:794:d0d5:e615 with SMTP id af79cd13be357-7953c5dc8bamr214278985a.55.1717743997451; Fri, 07 Jun 2024 00:06:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717743997; cv=pass; d=google.com; s=arc-20160816; b=SOtwMNHtTtDeM5edt8okwtu8Jy+Q+DcrgcBsqYB9/jZ/yYz1wn4x0b13grZnMmsQ3Y NwOAoSdH+rHas5Z40ga2KPCGivtRWkHNMKw3fTxKMF/chCO8vO4VcE/mq3BJ28kU03YX tGz08SyFxhmvYl3N/GTU48mg9X3pBXrCSvq1YLEibCT9a0g4b90Teap2ploFeQmrzYHe Ry8N1UX2/KcQjoTpta1QaGH9d2u0ycsAIl6A/9YxvR8xCnXTKESyngc18ied/Mk0oHrz ghPoyNHGYqGwrFE8AWS2/Yv7mYwRKoX1l/j12JwZ//uE52b4lKS1FxpWWtyMF0a5rtFR t6xA== 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=Trq0tZG6+CjtFvIqf2pIYKAyc6gpPZC0W8KSFjMqnz8=; fh=pdglhcY7hn43FRujNlflNhJmhVsdAI6S//OyMfKpxfg=; b=e52n4SGkQubu+VbcBMrrbmz/dEvbnBKHiAyJAXFtdPvhug2Qjb8JDEmY/HxRzE8Hx3 FLXWEA7MHMvhHHwKqBTwwKmXapffeJ440Qqj/15pfyEQyE0ui0utHiH4Vpy6qHEyFo5Z cdmjwiHtfQvFFZBVOEAHPaery4pXu+ZY9D/NzxXevaWVcv9/g0jlK5a+e3ZtQ9a71koG RF+c438STa28jfhT8Dwpezl+7bUUyfPOmBhR7IhQGOumAqrO+mUTo1zRO5/WHb+xbRCk UMSUGp8TSxIulHv3Wu9wZHIerJ07incjypIfpmneXx4iUfDxJHLwQATzxDbig016A7Vq HW9w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=YTPZwTQF; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=0qD3siSs; 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-205474-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205474-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-44038a6934asi36113421cf.54.2024.06.07.00.06.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 00:06:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205474-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=YTPZwTQF; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=0qD3siSs; 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-205474-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205474-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id E26541C27CE6 for ; Fri, 7 Jun 2024 07:04:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CDA3F154454; Fri, 7 Jun 2024 07:04:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="YTPZwTQF"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="0qD3siSs" 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 9800014F9CE; Fri, 7 Jun 2024 07:04:33 +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=1717743875; cv=none; b=pn4k26HR8BFujtZKkTPul+U8NleyqnceoSma9gXHrD4ommjqo7KFpDj05ynojw0F8bw4V7L8hNwbzTQzmH6sfwdsuZtpoZsnLRViNUNMscEH4lLZMyjmPbHe25C+UtMweBhpenc9X46pzdA5vLyJQzZOW3o7YnqtO/9FWgIPuzo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717743875; c=relaxed/simple; bh=rL+z32yJ/DnaCZexB8chXUJAXOMyL2Zx2vFkJ71eg5w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qa/F53+yCQvW2dALz/3zWMtKfG/+B3vit9FaVMQHqTvmIIM9ncrBUdsHNhPOeJ3hLvoZsesineIBTr+xeE5KFhw9WuruQjtPWpD1/RM5I6a37eEme0LrG5YGREoQhaFQndXIsnWMZsuHjoJ5jRDyhk383GOP8wiq0+nommuwmUM= 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=YTPZwTQF; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=0qD3siSs; 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=1717743871; 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=Trq0tZG6+CjtFvIqf2pIYKAyc6gpPZC0W8KSFjMqnz8=; b=YTPZwTQFykR5A9FhnzcQsYnRLdc8/+51Ccb3trweEkjJ/FTHH6f+LqFjWj4umBSqLYphOe 5pLdsU0pyc9X63HB0VvOJeF2PYIOR5528u2yEOga+XC8M2BRq17Z0lUAbNfbr9J6/TZ8PX WRAfVYlN3PUX0F20zQKH6tDiz/7HJ+8YnJb5TwJxuKGkaYilI2ObzRSI5SNmH/IBxciPCW ZzwfVAjp7ysDbx05r5BtrMMYwuJNKK0fL5ZE7NH0lkcHG0OUR5G3pA1pIlzHiyAa0UwX5h gQwVpR2MWjhOuRH1PgZU0GkVcZFe0kVlUxM6exJYJS88J4mitacYLszsLU8LZA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1717743871; 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=Trq0tZG6+CjtFvIqf2pIYKAyc6gpPZC0W8KSFjMqnz8=; b=0qD3siSshqfwzGJ0p0Muvbs+WmBjmK+4IheA1flXnQSPqLEZrodW7OM8aQ354GhUgx0shS Uystby352+dAdeAQ== To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: "David S. Miller" , Daniel Bristot de Oliveira , 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 v5 net-next 01/15] locking/local_lock: Introduce guard definition for local_lock. Date: Fri, 7 Jun 2024 08:53:04 +0200 Message-ID: <20240607070427.1379327-2-bigeasy@linutronix.de> In-Reply-To: <20240607070427.1379327-1-bigeasy@linutronix.de> References: <20240607070427.1379327-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.45.1