RE: [Intel-wired-lan] [PATCH iwl-net 2/4] igb: introduce raw vfs_lock to igb_adapter
From: Romanowski, Rafal <hidden>
Date: 2025-01-07 10:08:29
Also in:
intel-wired-lan, linux-rt-devel, lkml
quoted hunk ↗ jump to hunk
-----Original Message----- From: Intel-wired-lan <redacted> On Behalf Of Wander Lairson Costa Sent: Wednesday, December 4, 2024 12:42 PM To: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw [off-list ref]; Andrew Lunn [off-list ref]; David S. Miller [off-list ref]; Eric Dumazet [off-list ref]; Jakub Kicinski [off-list ref]; Paolo Abeni [off-list ref]; Sebastian Andrzej Siewior [off-list ref]; Clark Williams [off-list ref]; Steven Rostedt [off-list ref]; Jeff Garzik [off-list ref]; Auke Kok [off-list ref]; moderated list:INTEL ETHERNET DRIVERS [off-list ref]; open list:NETWORKING DRIVERS [off-list ref]; open list <linux- kernel@vger.kernel.org>; open list:Real-time Linux (PREEMPT_RT):Keyword:PREEMPT_RT [off-list ref] Cc: Wander Lairson Costa <redacted>; Clark Williams [off-list ref] Subject: [Intel-wired-lan] [PATCH iwl-net 2/4] igb: introduce raw vfs_lock to igb_adapter This change adds a raw_spinlock for the vfs_lock to the igb_adapter structure, enabling its use in both interrupt and preemptible contexts. This is essential for upcoming modifications to split igb_msg_task() into interrupt-safe and preemptible-safe parts. The motivation for this change stems from the need to modify igb_msix_other() to run in interrupt context under PREEMPT_RT. Currently, igb_msg_task() contains a code path that invokes kcalloc() with the GFP_ATOMIC flag. However, on PREEMPT_RT, GFP_ATOMIC is not honored, making it unsafe to call allocation functions in interrupt context. By introducing this raw spinlock, we can safely acquire the lock in both contexts, paving the way for the necessary restructuring of igb_msg_task(). Signed-off-by: Wander Lairson Costa <redacted> Suggested-by: Clark Williams <redacted> --- drivers/net/ethernet/intel/igb/igb.h | 4 ++ drivers/net/ethernet/intel/igb/igb_main.c | 51 ++++++++++++++++++++--- 2 files changed, 50 insertions(+), 5 deletions(-)diff --git a/drivers/net/ethernet/intel/igb/igb.hb/drivers/net/ethernet/intel/igb/igb.h index 3c2dc7bdebb50..d50c22f09d0f8 100644--- a/drivers/net/ethernet/intel/igb/igb.h +++ b/drivers/net/ethernet/intel/igb/igb.h@@ -666,6 +666,10 @@ struct igb_adapter {
Tested-by: Rafal Romanowski <redacted>