Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1052418lqt; Fri, 7 Jun 2024 06:55:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUIuR9ZVC3bOLM0z00e7dqQ+iXCTY5ma+wZDN9cccbyZzaXIZCGRDDmWYkXgizTMwpTphBQSGHzktyaAcMr5HIrh2Oqrex3rt2DIyq8UA== X-Google-Smtp-Source: AGHT+IGo1cPw+tBQFCrfFBYau8otBXIB7jeRfYjBKvCoVmN52OmBEe3vHrNZrbg6aSaT+hjjQw8j X-Received: by 2002:a50:d5db:0:b0:578:5d8a:cd91 with SMTP id 4fb4d7f45d1cf-57c5098fd26mr1595556a12.41.1717768547633; Fri, 07 Jun 2024 06:55:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717768547; cv=pass; d=google.com; s=arc-20160816; b=N2E0ogeHELQHAxTL683LBAhZAB8LSuONoGMTsYdB/3R2ztBaZOm0OVXs1Zdd+Ky5Y3 ASjA4IGmz8GWI0egvnOYxPaftmLWYSpsUY0LLJ+cI1m/GVNPAl+H+Fv+IMKet697akHJ sQ78zLo1Tf0yrVUhopCs0JWSDSB/2DaYyXAdgteFMNaUiJjW+E1ITN4rcrkcmUUEU9dE 25G4fPT8N9bnUnXcrTQyWTqF0Xq5r7h9E8P12aI1vvWv0HDaZ0hKalvkvX9FmuOly+CQ dDNEbNDWHRJNmTK3CWzdap++DzxxV+zdyfoM6YltfIPrWRUP2bbdIvhhMThZT7Hn+Hwq FgoQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=a5RPpDEDYqykL90Q0KRHEPbEGICF5nDt6M3cCtmcnaY=; fh=pYTUp3ay4qn0zXaJBh9lFZD7LjCQPOGUidusMmT9Q4Y=; b=Ft5P1yBXtvcKSrFcDvIagiSuY3Xu8yBqiuU7tTzP6g20pNEaSnSDhvt7GY6ge0foXJ H11rUFfg7uSV8BQP3pfOcsu8Lr2O2RhFntnERHdAunp+La8cvTF/oTEx3ZnvRLUd+Wma 8y4X3FPCFJloxupJhVbN4YvYEta4AJO6d6OLeuYvC+IQfFzz8WOh1dm9AR8XHY1dlRjx vCG8CpHPdHWjI7NoNwfG87MAs8k8bLZGGt6rb0ZAd63AlzIcBhOcEtc1yejDL5+6uYna ow25UQHyLDLz9ToFbpOBeU5fZ9NDns7/oPkiMVNHAmmg5US441ro3pjpMWW23uL83QWb yZ8A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Q8IQAxHn; 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-206207-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206207-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 4fb4d7f45d1cf-57aae0f7cd9si1871982a12.167.2024.06.07.06.55.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 06:55:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206207-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=Q8IQAxHn; 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-206207-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206207-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 5A39B1F226A9 for ; Fri, 7 Jun 2024 13:55:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 39780196446; Fri, 7 Jun 2024 13:55:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Q8IQAxHn"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="QF//ukp2" 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 0A505188CAD; Fri, 7 Jun 2024 13:55:26 +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=1717768527; cv=none; b=pdu+TzwjRVwQmUhyRyCW43Q5V5I4clScrQhLJ110f2yC1TvtFtqHzxcxAF5IV/0dlZ+H+kUS5xtQSQ6D3/P0bP171mGR+HAXZ2A0HJ/OWiOkkVa6G0TdScU8xEqj2O6cpFIxQsELXYjE+hEkru5EmWISAl+C+aPPidzyxkutQno= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717768527; c=relaxed/simple; bh=a5RPpDEDYqykL90Q0KRHEPbEGICF5nDt6M3cCtmcnaY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=FhGBtiyQi25B93jDz2KC+69XjAVwxcamjlBCQ2TEkeV13S1vRT0dl0J7/WZfh0ntH3hoA5kkznUQHS0sphpoquxeUHYlZJFBDHSdKXXa3FrYVsEAXvs8TuJWzPEUE0Vdi0mqETEb3d3ZEUqL8BX8rjREnZxjD9eU9K++U4KGZPY= 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=Q8IQAxHn; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=QF//ukp2; 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: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1717768522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=a5RPpDEDYqykL90Q0KRHEPbEGICF5nDt6M3cCtmcnaY=; b=Q8IQAxHn7DMqFrh0hvQfeKRZaMUqSN1If8x3sORFSXrge9/hTeMEEDB/gI/IV8bYdcltAG 6W2N95y3Tko6x0c6XPEIhNMtrByEfQciuTzFMY/xlNO2gZF7jTGAFo/Bc3k+VtTqhJ1vd5 MqwD+caiQlMtRMmTZxHum2xFGZWRcBJb0Vjia3urjQ3vvZc3tKa+F9+W2Qhssi2KVsjFS4 eDIk6cRd6nCgjlJncdupvjNGHKCOzb5BsVtjj+f3QBrBdSFkzm3hc2WtsXp8iR23B5vO85 JxNu4YCuOq597GLcTHwpOC1wOUGQPrzyGP2pTLDZdRJHWPU/DRt3gfsoUT1vzg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1717768522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=a5RPpDEDYqykL90Q0KRHEPbEGICF5nDt6M3cCtmcnaY=; b=QF//ukp2I1yuRI/6E1AHBKDFFwrGftMYR11tF9Ny3Qf9B2Or5wH53GZw4ptWBjBSWUNVNC tEOgSjZ4Zk0f+LAw== To: Sebastian Andrzej Siewior , 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 , Waiman Long , Will Deacon , Sebastian Andrzej Siewior Subject: Re: [PATCH v5 net-next 02/15] locking/local_lock: Add local nested BH locking infrastructure. In-Reply-To: <20240607070427.1379327-3-bigeasy@linutronix.de> References: <20240607070427.1379327-1-bigeasy@linutronix.de> <20240607070427.1379327-3-bigeasy@linutronix.de> Date: Fri, 07 Jun 2024 15:55:22 +0200 Message-ID: <875xuk26yd.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Fri, Jun 07 2024 at 08:53, Sebastian Andrzej Siewior wrote: > Add local_lock_nested_bh() locking. It is based on local_lock_t and the > naming follows the preempt_disable_nested() example. > > For !PREEMPT_RT + !LOCKDEP it is a per-CPU annotation for locking > assumptions based on local_bh_disable(). The macro is optimized away > during compilation. > For !PREEMPT_RT + LOCKDEP the local_lock_nested_bh() is reduced to > the usual lock-acquire plus lockdep_assert_in_softirq() - ensuring that > BH is disabled. > > For PREEMPT_RT local_lock_nested_bh() acquires the specified per-CPU > lock. It does not disable CPU migration because it relies on > local_bh_disable() disabling CPU migration. > With LOCKDEP it performans the usual lockdep checks as with !PREEMPT_RT. > Due to include hell the softirq check has been moved spinlock.c. > > The intention is to use this locking in places where locking of a per-CPU > variable relies on BH being disabled. Instead of treating disabled > bottom halves as a big per-CPU lock, PREEMPT_RT can use this to reduce > the locking scope to what actually needs protecting. > A side effect is that it also documents the protection scope of the > per-CPU variables. > > Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Thomas Gleixner