Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp761452lqb; Wed, 29 May 2024 09:43:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXquYqwEHCKfZXkNXSuCPSV9QRjURaXlncLiIxXxLo8XIAnMKOfI6m42I35wIp+lnure8tCpwK74FXJuAr1fd8y3qnb68xLYNmDhUf8Bw== X-Google-Smtp-Source: AGHT+IEL9+SXY4e3cvjWfNuGb93V7VImOy4s3Z9n725UGxDUC8RNhFLplfA0dm8ECb5ZfoDnLv+P X-Received: by 2002:a05:6a20:5650:b0:1b0:2af5:f183 with SMTP id adf61e73a8af0-1b212d0f73cmr14342641637.23.1717001004508; Wed, 29 May 2024 09:43:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717001004; cv=pass; d=google.com; s=arc-20160816; b=0rvIrF28DkStY9l52auTf7Tc+XkZ2GlDN9B4T1jyS3NZLWZ6AakHEjE0oije9M0CeR fNcJv+erKqfrpxNxqo+ytEHEw6TTvJwJKwhLsZL9OZSvz6oCtosbrm04tzwFyTfD9T0L NhIWAfe86BFc2mHYpUxDGgFXWFqY3Idl5GZlp5P1PwyziHA9a7Ma+zp7mfha4JOrS6KE UiVl594uv19j6ypy8rDUjKQPJyxdtts/2rPnQCfNJYVdF+aWc4BPVxwC/aGZaPR9IHtw mkrU/LTfsm5dQbfuZ4SV5xGq1opDtc6vGVXg/i5hPojMTkaFPf9tzR29r5b92YyfmSEJ AOuw== 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=mRMHo6FEBd+e0N/0wwmt9BaEcwCnNTE8npQn9DDRWX4=; b=GNrkLz4OjFfwtuRf8t0oAWyF9dND6NmB7ct+7x7M5xv/N6zVsNglpn+pf045nyZ76C twy0wXqXtkO/qnyIq9WMNcJJ5S+SwRX/07YRk6lVh4ekkqOxtlgZQq8Kfel9fx5K6/eS uL1hkOvmJ3fGiqduKQa6ztBGs2hYn0imOP37/ihe6CpsqneYFsbVVgMZ4ePEUCJt3400 V1119dTG6D1Skx3cgtamNmNljZwHguMuLR+M4d7icqLFubGoQnHH8LdhRmg+jhPvkKB0 XoTB+I41MH5ywJt48Hs5sa6FzvYF5RnRpaqZzsWcEWlnVmfN6520kJ02pr6x9GS+aP6Y ghow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=F46TjbSi; 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-194446-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194446-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f8fd4da7ebsi10759171b3a.285.2024.05.29.09.43.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 09:43:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-194446-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=@linutronix.de header.s=2020 header.b=F46TjbSi; 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-194446-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194446-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 283F3B23523 for ; Wed, 29 May 2024 16:29:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 45A2418733B; Wed, 29 May 2024 16:29:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="F46TjbSi"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="xSP2sZgF" 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 0AFBD184114; Wed, 29 May 2024 16:29:34 +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=1717000176; cv=none; b=JL0Lwv4ay6ga98EF/4k4QBXwlJs92JBSa0c0RMKSMRokNGGN8o8sDgtEqOL1SWPZYbA8XqjrflVaHUSci7JKqBe5gnwflxigi0CFB+SjDFbMU1YNb06Ps9ejuG372uYr7DCQ+nisdZA1IGombMbtVhsp9haCMhNq6so20HOwWYY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717000176; c=relaxed/simple; bh=rL+z32yJ/DnaCZexB8chXUJAXOMyL2Zx2vFkJ71eg5w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RzFGSJTjW0PN6lhy5RHrlSbvnDPuNwOanBFKBWcj5SVwwXgGZF9KbNNamh5qW8muhuQ/D4nkYg9pROsKsQRZl4xTRdhzrR9GqaIqaCs3qsQQauduPANo+SrsT/BNdDlrzIJUqO88MKstnfLjCW6JLPYihmmVVRPH9Z1GJZP0KiA= 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=F46TjbSi; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=xSP2sZgF; 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=1717000173; 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=F46TjbSiydq7v27gjH8lDaxgMBDdInroZVg8P8gEOFiKZOGlsKjj60gl04WVfmKClb8Pzm EqqQPjYTAAhjqGHT8RrFN0cY1BcQk66Z1IyA8AFjyUxA48iiXpeRGKoyIoK3oy5rfZi2ER jPCK55xlHpAekZjeMFS914Ti7p0Emmy5+feWd6vPeiphteR8xIge5LzuWqXobWmSuwdv8g oh/+cLQ2qmuGV0J/dDHkaw95p3puWXTAy4r1bemv18mSCotu/KdJM4MM8QdtltTQHmTwuB djaCktk4GmUgyYyBcFAb3GVi/CGx+ljnTSTABJmJVwg2vGQNxNGb2HgfWhvMOA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1717000173; 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=xSP2sZgFJ/5/9QZscb9SvZI4aSEhFfPBnd6a6z99iqoaxlWFN22bY3jRKO/OfbxorUEPDK HpmEduc1zmuUsxAA== 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 v3 net-next 01/15] locking/local_lock: Introduce guard definition for local_lock. Date: Wed, 29 May 2024 18:02:24 +0200 Message-ID: <20240529162927.403425-2-bigeasy@linutronix.de> In-Reply-To: <20240529162927.403425-1-bigeasy@linutronix.de> References: <20240529162927.403425-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