Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c82c8a5b authored by Ravi Gummadidala's avatar Ravi Gummadidala Committed by Sivan Reinstein
Browse files

msm: ipa: aggregate the trigger to replenish free pool



Queueing the trigger per frame can result in more overhead
for the queueing worker and cause the replenish worker to
be run for short durations with higher scheduling overhead.
This commit causes the trigger to be sent per N frames where
N is a function of the pool size (N = 0.25 * pool size).

Change-Id: I138ea45165e6e0d737aaf6bb9ee4f60c0ef4b029
Signed-off-by: default avatarRavi Gummadidala <rgummadi@codeaurora.org>
parent 5bccce36
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1778,12 +1778,14 @@ static void ipa_fast_replenish_rx_cache(struct ipa_sys_context *sys)
			break;
		}
		rx_len_cached = ++sys->len;
		sys->repl_trig_cnt++;
		curr = (curr + 1) % sys->repl.capacity;
		/* ensure write is done before setting head index */
		mb();
		atomic_set(&sys->repl.head_idx, curr);
	}

	if (sys->repl_trig_cnt % sys->repl_trig_thresh == 0)
		queue_work(sys->repl_wq, &sys->repl_work);

	if (rx_len_cached <= sys->ep->rx_replenish_threshold) {
@@ -2679,6 +2681,7 @@ static int ipa_assign_policy(struct ipa_sys_connect_params *in,
						IPA_GENERIC_AGGR_PKT_LIMIT;
					}
				}
				sys->repl_trig_thresh = sys->rx_pool_sz / 4;
				if (nr_cpu_ids > 1)
					sys->repl_hdlr =
						ipa_fast_replenish_rx_cache;
+2 −0
Original line number Diff line number Diff line
@@ -579,6 +579,8 @@ struct ipa_sys_context {
	struct work_struct repl_work;
	void (*repl_hdlr)(struct ipa_sys_context *sys);
	struct ipa_repl_ctx repl;
	unsigned int repl_trig_cnt;
	unsigned int repl_trig_thresh;

	/* ordering is important - mutable fields go above */
	struct ipa_ep_context *ep;