Questions tagged [softirq]

Softirqs are software interrupts, which does not interrupt the processor like normal irqs.

Softirqs are software interrupts, used often by device drivers to do further processing of something outside of the hardware interrupt handler, which needs to run as fast as possible so interrupts can be re-enabled.

Related tags:

36 questions
24
votes
4 answers

Difference between SoftIRQs and Tasklets

While studying Linux interrupt handling I found that Tasklets and SoftIRQs are two different methods of performing "bottom half" (lesser priority work). I understand this (quite genuine need). Difference being, SoftIRQs are re-entarant while a…
ultimate cause
  • 2,264
  • 4
  • 27
  • 44
17
votes
3 answers

Which context are softirq and tasklet in?

I know that there are process context and interrupt context but I don't understand when executing softirq or tasklet, which context is it run under. I have seen some people use the term "bottom-halves context", if there's such term, what's the…
kai
  • 1,141
  • 3
  • 15
  • 25
16
votes
1 answer

Why softirq is used for highly threaded and high frequency uses?

What makes the softirq so special that we use it for high frequency uses., like in network drivers and block drivers.
9
votes
1 answer

Is there any way to make a call to linux kernel with my own softirq

Similar to how system call works on int 0x80, is it possible to implement my own ISR inside kernel so that on softirq assume int 0x120 or with any other softirq Program Counter can jump from user space to kernel space? Is entering kernel in…
Samrat Das
  • 1,781
  • 1
  • 21
  • 33
7
votes
2 answers

How to define and trigger my own new softirq in linux kernel?

I would like to create my own softirq in linux kernel. Is it the right way to do that: In the init of the module I would like to trigger the softirq from I'll add a call to: 394 void open_softirq(int nr, void (*action)(struct softirq_action *)) 395…
0x90
  • 39,472
  • 36
  • 165
  • 245
5
votes
2 answers

local_bh_disable, preempt_disable, local_irq_disable

local_bh_disable disables the processing of bottom halves (softirqs). Softirqs are processed on either, interrupt return path, or by the ksoftirqd-(per cpu)-thread that will be woken up if the system suffers of heavy softirq-load. preempt_disable…
user2950911
  • 873
  • 3
  • 12
  • 19
5
votes
1 answer

Sharing data between softirq and process context

I am developing a kernel module that shares data structures between a softirq (netfilter pre-routing hook) and a user context (within an ioctl call). After reading this link, I know I need to disable the software interrupts in the user context when…
Mr. Beer
  • 255
  • 1
  • 5
4
votes
0 answers

Containers: high cpu usage in %soft (soft IRQ) for network-intensive workloads

I'm trying to debug some performance issues on a RHEL8.3 server. The server is actually a Kubernetes worker nodes and hosts several Redis containers (PODs). These containers are doing a lot of network I/O (iptraf-ng reports about 500 kPPS and…
3
votes
2 answers

RISC-V - Software Interrupts

I'm trying to implement a simple interrupt controller for my RV32I core. I believe I understand how an interrupt should be handled in RISC-V, and the role of the CSR registers in the process. RISC-V defines three sources of interrupts: External,…
zeke
  • 155
  • 3
  • 8
3
votes
1 answer

Can the SoftIRQ prempt currently running the same SoftIRQ with Linux kernel?

I am working on a performance improvement of a driver and should consider the possibility of deadlock. In a SoftIRQ context, spin_lock will be held and protect some variable. In this case, should I use spin_lock or spin_lock_bh? spin_lock_bh sounds…
Owen Kwon
  • 33
  • 2
3
votes
1 answer

How to pin a interrupt to a CPU in driver

Is it possible to pin a softirq, or any other bottom half to a processor. I have a doubt that this could be done from within a softirq code. But then inside a driver is it possible to pin a particular IRQ to a core.
2
votes
1 answer

The linux softirq cpu usage looks strange

I am running a simple program in a client, it continue sending udp packet to a server. The interface of server is a multi-queue netcard, but I set its rx-flow-hash of udp4 to sd. So all packet will be produced in one CPU. When I receive…
inszva
  • 31
  • 1
  • 4
2
votes
0 answers

why can you not enable bottom halves when irqs are disabled?

In __local_bh_enable, we have a WARN_ON_ONCE(!irqs_disabled()); I'm wondering what the purpose of this warning is -- I would imagine you would want to be able to renable bottomhalves when in say spinlock_irq protected code... (note: I'm looking…
John
  • 3,400
  • 3
  • 31
  • 47
1
vote
0 answers

Reducing Timer Softirq and local interrupts

I would like to know what exactly are the TIMER softirqs in /proc/softirqs are doing, so I can reduce their frequency. I believe the local timer interrupts generated by the local APIC give rise to these TIMER softirqs. So is changing the frequency…
1
vote
0 answers

hardirq and softirq run on the same core/processor?

Assume I have RSS and interrupt affinity correctly set up. Is it guaranteed by the Linux kernel that a softirq is executed on the same CPU/core where hardware interrupt handler has been triggered? I understand that interrupt handler would schedule a…
Mark
  • 6,052
  • 8
  • 61
  • 129
1
2 3