Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 351340
b: refs/heads/master
c: c10d736
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Jan 10, 2013
1 parent 2ee764b commit 7cc22a5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1def9238d4aa2146924994aa4b7dc861f03b9362
refs/heads/master: c10d73671ad30f54692f7f69f0e09e75d3a8926a
17 changes: 9 additions & 8 deletions trunk/kernel/softirq.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,21 +195,21 @@ void local_bh_enable_ip(unsigned long ip)
EXPORT_SYMBOL(local_bh_enable_ip);

/*
* We restart softirq processing MAX_SOFTIRQ_RESTART times,
* and we fall back to softirqd after that.
* We restart softirq processing for at most 2 ms,
* and if need_resched() is not set.
*
* This number has been established via experimentation.
* These limits have been established via experimentation.
* The two things to balance is latency against fairness -
* we want to handle softirqs as soon as possible, but they
* should not be able to lock up the box.
*/
#define MAX_SOFTIRQ_RESTART 10
#define MAX_SOFTIRQ_TIME msecs_to_jiffies(2)

asmlinkage void __do_softirq(void)
{
struct softirq_action *h;
__u32 pending;
int max_restart = MAX_SOFTIRQ_RESTART;
unsigned long end = jiffies + MAX_SOFTIRQ_TIME;
int cpu;
unsigned long old_flags = current->flags;

Expand Down Expand Up @@ -264,11 +264,12 @@ asmlinkage void __do_softirq(void)
local_irq_disable();

pending = local_softirq_pending();
if (pending && --max_restart)
goto restart;
if (pending) {
if (time_before(jiffies, end) && !need_resched())
goto restart;

if (pending)
wakeup_softirqd();
}

lockdep_softirq_exit();

Expand Down

0 comments on commit 7cc22a5

Please sign in to comment.