* [PATCH net-next] net: dev: Simplify the conditional of backlog lock functions
@ 2024-06-09 7:20 Yajun Deng
2024-06-10 6:26 ` Sebastian Andrzej Siewior
0 siblings, 1 reply; 2+ messages in thread
From: Yajun Deng @ 2024-06-09 7:20 UTC (permalink / raw)
To: davem, edumazet, kuba, pabeni; +Cc: bigeasy, netdev, linux-kernel, Yajun Deng
The use_backlog_threads() contains the conditional of PREEMPT_RT, so we
don't need to add PREEMPT_RT in the backlog lock.
Remove the conditional of PREEMPT_RT in the backlog lock.
Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
---
net/core/dev.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index e62698c7a0e6..db6b6fc997e6 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -229,7 +229,7 @@ static inline void backlog_lock_irq_save(struct softnet_data *sd,
{
if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads())
spin_lock_irqsave(&sd->input_pkt_queue.lock, *flags);
- else if (!IS_ENABLED(CONFIG_PREEMPT_RT))
+ else
local_irq_save(*flags);
}
@@ -237,7 +237,7 @@ static inline void backlog_lock_irq_disable(struct softnet_data *sd)
{
if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads())
spin_lock_irq(&sd->input_pkt_queue.lock);
- else if (!IS_ENABLED(CONFIG_PREEMPT_RT))
+ else
local_irq_disable();
}
@@ -246,7 +246,7 @@ static inline void backlog_unlock_irq_restore(struct softnet_data *sd,
{
if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads())
spin_unlock_irqrestore(&sd->input_pkt_queue.lock, *flags);
- else if (!IS_ENABLED(CONFIG_PREEMPT_RT))
+ else
local_irq_restore(*flags);
}
@@ -254,7 +254,7 @@ static inline void backlog_unlock_irq_enable(struct softnet_data *sd)
{
if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads())
spin_unlock_irq(&sd->input_pkt_queue.lock);
- else if (!IS_ENABLED(CONFIG_PREEMPT_RT))
+ else
local_irq_enable();
}
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: dev: Simplify the conditional of backlog lock functions
2024-06-09 7:20 [PATCH net-next] net: dev: Simplify the conditional of backlog lock functions Yajun Deng
@ 2024-06-10 6:26 ` Sebastian Andrzej Siewior
0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Andrzej Siewior @ 2024-06-10 6:26 UTC (permalink / raw)
To: Yajun Deng; +Cc: davem, edumazet, kuba, pabeni, netdev, linux-kernel
On 2024-06-09 15:20:22 [+0800], Yajun Deng wrote:
> The use_backlog_threads() contains the conditional of PREEMPT_RT, so we
> don't need to add PREEMPT_RT in the backlog lock.
>
> Remove the conditional of PREEMPT_RT in the backlog lock.
This is part of
https://lore.kernel.org/all/20240607070427.1379327-10-bigeasy@linutronix.de/
> Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
Sebastian
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-06-10 6:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-09 7:20 [PATCH net-next] net: dev: Simplify the conditional of backlog lock functions Yajun Deng
2024-06-10 6:26 ` Sebastian Andrzej Siewior
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).