From b28dc141266f2894a7fc4329c790eb0d0343de83 Mon Sep 17 00:00:00 2001 From: Yun Park Date: Tue, 14 Nov 2017 10:45:16 -0800 Subject: [PATCH] qcacld-3.0: Set PF_WAKE_UP_IDLE flag in the IPA Rx exception callback Prevent CPU bottleneck caused by scheduling the user process running on the same CPU with IPA worker thread. Set PF_WAKE_UP_IDLE flag in the IPA Rx exception callback, to wake user task to idle CPU. Change-Id: Ifd5b917c46fff39febd7e98f4761c9e80000ea35 CRs-Fixed: 2131917 --- core/hdd/src/wlan_hdd_ipa.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c index 6d547dda12d0..7e5fa03e849f 100644 --- a/core/hdd/src/wlan_hdd_ipa.c +++ b/core/hdd/src/wlan_hdd_ipa.c @@ -4125,6 +4125,7 @@ static void hdd_ipa_send_skb_to_network(qdf_nbuf_t skb, int result; struct hdd_ipa_priv *hdd_ipa = ghdd_ipa; unsigned int cpu_index; + uint32_t enabled; if (!adapter || adapter->magic != WLAN_HDD_ADAPTER_MAGIC) { HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, "Invalid adapter: 0x%pK", @@ -4140,6 +4141,14 @@ static void hdd_ipa_send_skb_to_network(qdf_nbuf_t skb, return; } + /* + * Set PF_WAKE_UP_IDLE flag in the task structure + * This task and any task woken by this will be waken to idle CPU + */ + enabled = sched_get_wake_up_idle(current); + if (!enabled) + sched_set_wake_up_idle(current, true); + skb->destructor = hdd_ipa_uc_rt_debug_destructor; skb->dev = adapter->dev; skb->protocol = eth_type_trans(skb, skb->dev); @@ -4155,6 +4164,12 @@ static void hdd_ipa_send_skb_to_network(qdf_nbuf_t skb, ++adapter->hdd_stats.tx_rx_stats.rx_refused[cpu_index]; hdd_ipa->ipa_rx_net_send_count++; + + /* + * Restore PF_WAKE_UP_IDLE flag in the task structure + */ + if (!enabled) + sched_set_wake_up_idle(current, false); } /**