Revert "Revert "ANDROID: softirq: defer softirq processing to ksoftirqd if CPU is busy with RT""
This reverts commit 28768780d4, as the
merge conflicts have been resolved.
Bug: 168521633
Change-Id: I9828d641e92e40a798e899b60aba83dbc59675bb
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
[satyap@codeaurora.org: trivial merge conflict resolution.]
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
[elavila: Port to mainline, squash with bugfix]
Signed-off-by: J. Avila <elavila@google.com>
[ashayj@codeaurora.org: trivial merge conflict resolution.]
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
This commit is contained in:
committed by
Todd Kjos
parent
027f8bd863
commit
f5b90ccf9c
+19
-3
@@ -522,6 +522,17 @@ static inline bool lockdep_softirq_start(void) { return false; }
|
||||
static inline void lockdep_softirq_end(bool in_hardirq) { }
|
||||
#endif
|
||||
|
||||
static inline __u32 softirq_deferred_for_rt(__u32 *pending)
|
||||
{
|
||||
__u32 deferred = 0;
|
||||
|
||||
if (cpupri_check_rt()) {
|
||||
deferred = *pending & LONG_SOFTIRQ_MASK;
|
||||
*pending &= ~LONG_SOFTIRQ_MASK;
|
||||
}
|
||||
return deferred;
|
||||
}
|
||||
|
||||
asmlinkage __visible void __softirq_entry __do_softirq(void)
|
||||
{
|
||||
unsigned long end = jiffies + MAX_SOFTIRQ_TIME;
|
||||
@@ -529,6 +540,7 @@ asmlinkage __visible void __softirq_entry __do_softirq(void)
|
||||
int max_restart = MAX_SOFTIRQ_RESTART;
|
||||
struct softirq_action *h;
|
||||
bool in_hardirq;
|
||||
__u32 deferred;
|
||||
__u32 pending;
|
||||
int softirq_bit;
|
||||
|
||||
@@ -541,13 +553,14 @@ asmlinkage __visible void __softirq_entry __do_softirq(void)
|
||||
|
||||
pending = local_softirq_pending();
|
||||
|
||||
deferred = softirq_deferred_for_rt(&pending);
|
||||
softirq_handle_begin();
|
||||
in_hardirq = lockdep_softirq_start();
|
||||
account_softirq_enter(current);
|
||||
|
||||
restart:
|
||||
/* Reset the pending bitmask before enabling irqs */
|
||||
set_softirq_pending(0);
|
||||
set_softirq_pending(deferred);
|
||||
__this_cpu_write(active_softirqs, pending);
|
||||
|
||||
local_irq_enable();
|
||||
@@ -586,14 +599,17 @@ restart:
|
||||
local_irq_disable();
|
||||
|
||||
pending = local_softirq_pending();
|
||||
deferred = softirq_deferred_for_rt(&pending);
|
||||
|
||||
if (pending) {
|
||||
if (time_before(jiffies, end) && !need_resched() &&
|
||||
--max_restart)
|
||||
goto restart;
|
||||
|
||||
wakeup_softirqd();
|
||||
}
|
||||
|
||||
if (pending | deferred)
|
||||
wakeup_softirqd();
|
||||
|
||||
account_softirq_exit(current);
|
||||
lockdep_softirq_end(in_hardirq);
|
||||
softirq_handle_end();
|
||||
|
||||
Reference in New Issue
Block a user