Browse Source

qcacld-3.0: Affine refill thread to performance cluster

Currently refill thread is not getting chance to update
refill buffer pool, which is causing the increase in
rx thread time.
To fix issue move refill thread to performace cluster.

Change-Id: I839352ff09da692f801e97f7938a67ab8f09742b
CRs-Fixed: 3138081
Amit Mehta 3 years ago
parent
commit
22de5a5cf9
3 changed files with 38 additions and 0 deletions
  1. 1 0
      Kbuild
  2. 2 0
      configs/default_defconfig
  3. 35 0
      core/dp/txrx3.0/dp_rx_thread.c

+ 1 - 0
Kbuild

@@ -4263,6 +4263,7 @@ cppflags-$(CONFIG_DEVICE_FORCE_WAKE_ENABLE) += -DDEVICE_FORCE_WAKE_ENABLE
 cppflags-$(CONFIG_WINDOW_REG_PLD_LOCK_ENABLE) += -DWINDOW_REG_PLD_LOCK_ENABLE
 cppflags-$(CONFIG_DUMP_REO_QUEUE_INFO_IN_DDR) += -DDUMP_REO_QUEUE_INFO_IN_DDR
 cppflags-$(CONFIG_WLAN_FEATURE_REDUCE_RX_THREADS) += -DWLAN_FEATURE_REDUCE_RX_THREADS
+cppflags-$(CONFIG_DP_RX_REFILL_CPU_PERF_AFFINE_MASK) += -DDP_RX_REFILL_CPU_PERF_AFFINE_MASK
 
 ifdef CONFIG_MAX_CLIENTS_ALLOWED
 ccflags-y += -DWLAN_MAX_CLIENTS_ALLOWED=$(CONFIG_MAX_CLIENTS_ALLOWED)

+ 2 - 0
configs/default_defconfig

@@ -1276,6 +1276,7 @@ ifeq (y,$(filter y,$(CONFIG_LITHIUM) $(CONFIG_BERYLLIUM)))
 		CONFIG_REO_QDESC_HISTORY := y
 		CONFIG_DP_TX_HW_DESC_HISTORY := y
 		CONFIG_QDF_NBUF_HISTORY_SIZE := 8192
+		CONFIG_DP_RX_REFILL_CPU_PERF_AFFINE_MASK := y
 	endif
 	ifeq ($(CONFIG_CNSS2_DEBUG), y)
 		CONFIG_HIF_CE_DEBUG_DATA_BUF := y
@@ -1286,6 +1287,7 @@ ifeq (y,$(filter y,$(CONFIG_LITHIUM) $(CONFIG_BERYLLIUM)))
 		CONFIG_REO_QDESC_HISTORY := y
 		CONFIG_DP_TX_HW_DESC_HISTORY := y
 		CONFIG_QDF_NBUF_HISTORY_SIZE := 8192
+		CONFIG_DP_RX_REFILL_CPU_PERF_AFFINE_MASK := y
 	endif
 	CONFIG_WLAN_FEATURE_DP_EVENT_HISTORY := y
 	CONFIG_ALLOW_PKT_DROPPING := y

+ 35 - 0
core/dp/txrx3.0/dp_rx_thread.c

@@ -64,6 +64,39 @@ static inline void dp_rx_tm_walk_skb_list(qdf_nbuf_t nbuf_list)
 { }
 #endif /* DP_RX_TM_DEBUG */
 
+#ifdef DP_RX_REFILL_CPU_PERF_AFFINE_MASK
+/**
+ * dp_rx_refill_thread_set_affinity - Affine Rx refill threads
+ * @refill_thread: Contains over all rx refill thread info
+ *
+ * Return: None
+ */
+static void
+dp_rx_refill_thread_set_affinity(struct dp_rx_refill_thread *refill_thread)
+{
+	unsigned int cpus;
+	char new_mask_str[10];
+	qdf_cpu_mask new_mask;
+
+	qdf_cpumask_clear(&new_mask);
+	qdf_for_each_online_cpu(cpus) {
+		if (qdf_topology_physical_package_id(cpus) ==
+		    CPU_CLUSTER_TYPE_PERF) {
+			qdf_cpumask_set_cpu(cpus, &new_mask);
+		}
+	}
+
+	qdf_thread_set_cpus_allowed_mask(refill_thread->task, &new_mask);
+
+	cpumap_print_to_pagebuf(false, new_mask_str, &new_mask);
+	dp_debug("Refill Thread CPU mask  %s", new_mask_str);
+}
+#else
+static void
+dp_rx_refill_thread_set_affinity(struct dp_rx_refill_thread *refill_thread)
+{
+}
+#endif
 /**
  * dp_rx_tm_get_soc_handle() - get soc handle from struct dp_rx_tm_handle_cmn
  * @rx_tm_handle_cmn - rx thread manager cmn handle
@@ -867,6 +900,8 @@ QDF_STATUS dp_rx_refill_thread_init(struct dp_rx_refill_thread *refill_thread)
 		return QDF_STATUS_E_FAILURE;
 	}
 
+	dp_rx_refill_thread_set_affinity(refill_thread);
+
 	refill_thread->state = DP_RX_REFILL_THREAD_RUNNING;
 	return QDF_STATUS_SUCCESS;
 }