From patchwork Thu Jun 20 13:21:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 13705499 X-Patchwork-Delegate: kuba@kernel.org 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 79ADC1AD3E2; Thu, 20 Jun 2024 13:27:31 +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=1718890052; cv=none; b=QLDNXsfY9CG3VdA5u6hnXFHLgK+C7O2tfTSM5czZ82jpe1w6ZUR0LkfCTTVTrEpfzt+4I447PDD4ydU09VnpR0OL7IrAamVpgRwbkCk8SXuK3l1EcKnkISzzqtxs9BYVWNvEEnUkGYREMXH9peUpVOO3kk2qKp17VifztL0ATuc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718890052; c=relaxed/simple; bh=JY6ydblJxV3mkgvucOoAjw6D4clChvFMAFGtZ6EWhAg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NBmJkE8Me8OtrHnW6K0RhnFc8Ia1FGx90bqUKTVdoBkZx5DDAVUX/3UMTyd2UsVR0SGKbQCoUzPQj4PtYRxLoqlfsRW9jG3ZrniTdvd3xnMg/VvN/VP9b8oOZXXAbsLSAfJTswVSwcIXWnLoJ3E8xsr+KwjoJXN5Mr4MLmuRePU= 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=4fse2EfH; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ixLvrWo1; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="4fse2EfH"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ixLvrWo1" From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1718890049; 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=D7uoLiV1k+rI19wogyKAy82/pJLM3IfKwwDbBRQvfd8=; b=4fse2EfH/ZiC7gqmniED7unbyR3Gh1eHLp7RFF4LjG7UYPU2GGyCyLC2C0P9j8uLZy0trX AG6GOHZhywBWZbP82+UPBAgJjcjQcbOWLCNl2Y+zRSPu9t9sW6VLMt/dKU3SNGXbJ0zJl7 iXBLOPFliK3IX++ku5jTLUrmQjycbQI0pS3U0HCevAPUUp5RzZtrU4eSYkKozsfHj71n6R E+115AcDG84TuUzk6/NTLqWH28WMTvDHddd5Bi9J8/eZJhvdk5re2ijdu+3n0qbpwkcQvT bgDxscomc9ME0bjtIU3syOzsS5CX57e8jC+JpZFa2SQkuctLUeAumHYdxTx+Dg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1718890049; 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=D7uoLiV1k+rI19wogyKAy82/pJLM3IfKwwDbBRQvfd8=; b=ixLvrWo15lUA5oIKJLvFcWtdtGsjlU+jt+E4wPiXd7OszQAkFzYYoljbE4f42G8qLC90C4 fWdD1/TGUNGP3oBg== 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 v9 net-next 01/15] locking/local_lock: Introduce guard definition for local_lock. Date: Thu, 20 Jun 2024 15:21:51 +0200 Message-ID: <20240620132727.660738-2-bigeasy@linutronix.de> In-Reply-To: <20240620132727.660738-1-bigeasy@linutronix.de> References: <20240620132727.660738-1-bigeasy@linutronix.de> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Introduce lock guard definition for local_lock_t. There are no users yet. Acked-by: Peter Zijlstra (Intel) Reviewed-by: Thomas Gleixner 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) +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