Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp587782lqp; Wed, 12 Jun 2024 10:04:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUWxjVyVHoPBt8/cjibQbxZ0ehEXneFfbCQxHwcDndnps7uYbjezr4GacXF0Nz8HJTaaJh5Y80twsyWTpzMApBfMZAPkcxRLR0FXANwUw== X-Google-Smtp-Source: AGHT+IGqRDyFOBrvEvV1Un5Vyko9D0gGHnny7vUGZ0relKYbQN5Gdd3CuMgQt0BjvWg1WAS1VwLM X-Received: by 2002:a17:906:b2d5:b0:a6f:27e2:812c with SMTP id a640c23a62f3a-a6f47d524abmr141250666b.22.1718211851942; Wed, 12 Jun 2024 10:04:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718211851; cv=pass; d=google.com; s=arc-20160816; b=KW1PUMshHD037KfgUSFltKTQ2pPX6WUnb53gNtPiFw2P/FZUnJAFldysIfVYaRG8Sn tdAobahDMo/hBUly8lWCSs25832kBhLPUp2IOEAhJLvbvFTLSN0l9lPgF+lm/BlTvLqY PGqn+/iUHd9bKiSuiDKt+mzjxq0lnl5NLrWSbNskG84WNuhIxMaAn3QTf8LyhlUf0Vk1 9cqcx06rWvpxYEeYIfHDKhnlI2/dIZRTIa7J0FvZHDuznoYESS2jfVYv6f7agTGNLD6v fnpuxTT+NWpW2JcuUxTxC2ssYsbS3xqIYFPNnc8s37NeikuHAsGMDJqFKrtWBDBXtkhz O4Lg== 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=kfcLU4Oh9EtlRdw/XpgHY5VtGHocSkPfsZwBs/Vxtx4=; fh=pdglhcY7hn43FRujNlflNhJmhVsdAI6S//OyMfKpxfg=; b=CAGHarwCqaY15760brDwwGF7qruWIJIwtHo3oAn8uY219RauaJqz+fFmh/wYAFpKD/ en3JSnxpw6serPwXJJKHTj/pcjsX+/AvZIC161vr9yjIf0y5vomKKGPcCzTTV2A3UZRJ z6xLWsnaqGanxPRjcGsG1W/IqatFEYDvlwiHOf26J6D3tPKszIPxscanzRfAqHBdvMoC 65Wp8/IjmRZ4r/o/oKKrXMgZLYjV2Ja+KHn7RKHhdRSUSk/qMS1TmfORR7NpXlnrW8F/ yAD48EnOTPaP5fwpYW8zG7pOBSWaq3KB7AH89kS9JKp/oEnzq9xA/zx6aqlrlPs3AllX +XlA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=IaJ75bH+; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=fTBFBk2z; 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-211964-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211964-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f09ac085dsi487737766b.190.2024.06.12.10.04.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 10:04:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211964-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=IaJ75bH+; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=fTBFBk2z; 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-211964-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211964-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 am.mirrors.kernel.org (Postfix) with ESMTPS id A24CA1F22431 for ; Wed, 12 Jun 2024 17:04:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C3680183085; Wed, 12 Jun 2024 17:03:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="IaJ75bH+"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="fTBFBk2z" 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 211D0250EC; Wed, 12 Jun 2024 17:03:20 +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=1718211804; cv=none; b=lOy563Ww6fa7rxBL8WLJXJPTpF7tTv24y4QryweJjQ2w0k2UbRRvpahaZt2VayALfgwQZG7zE3M9EfWC5TPaB6LTCJjePL58OyN/yBkzXViJiwWMEP42YMKO7XAdjkPb3LDeJJCbVbfgv0IGIGgKT3/CdUZT+37FiasK/9jHy/0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718211804; c=relaxed/simple; bh=g9DAnp4ACdmRClsuM2C1EE+m73Pze6Bb8H+1qFd5Hz4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YbRfXhla88SUHtNVcHXfIvYJmXWLcDJtcVWIDnsR7b6hS7RG5oYYE46Bux/IPOdVOQFlh3EnYWBoDmCr4hz03/WysvMgIuDg3ffs15L4mINTXmEyL2tmOtlEoOK3bRoAevuLgd7MDPw1zARe4WfSgO95E+ZDJwb2Nr92wSMfamQ= 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=IaJ75bH+; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=fTBFBk2z; 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=1718211793; 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=kfcLU4Oh9EtlRdw/XpgHY5VtGHocSkPfsZwBs/Vxtx4=; b=IaJ75bH+NsKUwzE/hAavXNfobVQXH/VoiQEPj3lDAbdUJFwYctb076fm/YlOHZJZK+DokE byGLOxYXBU103kajUampMHGfNerVjMX5lCi4CMuwQUIncb5g8yhXCRoYx+iTOsUBN+o/7p fFVaiiDs4qjCc9rYhxUYcFBPOZ6F3rgk1BkFmGhBKvrLuvJrdvXeZ+ywCKbX31RAkkpybL PFnPGx/HxEX3g20ol3uzyOj4WaRPCfdyDNFMdTjyFQqnhSyy73msUdAyfim6iydmbdm76L 1kGprlQNo/CwwnL3V9JMefeVT0bLSpp+VVf1FKhpGTpRkVSqMnmbACRlbhXsjQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1718211793; 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=kfcLU4Oh9EtlRdw/XpgHY5VtGHocSkPfsZwBs/Vxtx4=; b=fTBFBk2zj9xfr2fZHLjozEnrqcKH6MuWn6vcNyD50CvIqFlQNKPHeDI9uFIyuBly2RNKvr rqnk9lyIyfv8CSCg== 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 v6 net-next 01/15] locking/local_lock: Introduce guard definition for local_lock. Date: Wed, 12 Jun 2024 18:44:27 +0200 Message-ID: <20240612170303.3896084-2-bigeasy@linutronix.de> In-Reply-To: <20240612170303.3896084-1-bigeasy@linutronix.de> References: <20240612170303.3896084-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. 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) =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