diff --git a/homa_impl.h b/homa_impl.h index 5acaf8ae..11aa70ee 100644 --- a/homa_impl.h +++ b/homa_impl.h @@ -1948,7 +1948,7 @@ struct homa { * core for SoftIRQ (deprecated). * HOMA_GRO_NEXT Always use the next core in circular * order for SoftIRQ (deprecated). - * HOMA_GRO_IDLE_NEW Use the new mechanism for selecting an + * HOMA_GRO_GEN2 Use the new mechanism for selecting an * idle core for SoftIRQ. * HOMA_GRO_FAST_GRANTS Pass all grant I can see immediately to * homa_softirq during GRO. @@ -1959,25 +1959,22 @@ struct homa { #define HOMA_GRO_SAME_CORE 2 #define HOMA_GRO_IDLE 4 #define HOMA_GRO_NEXT 8 - #define HOMA_GRO_IDLE_NEW 16 + #define HOMA_GRO_GEN2 16 #define HOMA_GRO_FAST_GRANTS 32 #define HOMA_GRO_SHORT_BYPASS 64 - #define HOMA_GRO_NORMAL (HOMA_GRO_SAME_CORE|HOMA_GRO_IDLE_NEW \ + #define HOMA_GRO_NORMAL (HOMA_GRO_SAME_CORE|HOMA_GRO_GEN2 \ |HOMA_GRO_SHORT_BYPASS) /* - * @gro_busy_usecs: try not to schedule SoftIRQ processing on a core - * if it has handled Homa packets at GRO level in the last - * gro_busy_us microseconds (improve load balancing by avoiding - * hot spots). Set externally via sysctl. + * @busy_usecs: if there has been activity on a core within the + * last @busy_usecs, it is considered to be busy and Homa will + * try to avoid scheduling other activities on the core. Set + * externally via sysctl. */ - int gro_busy_usecs; + int busy_usecs; - /** - * @gro_busy_cycles: Same as gro_busy_usecs, except in units - * of get_cycles(). - */ - int gro_busy_cycles; + /** @busy_cycles: Same as busy_usecs except in get_cycles() units. */ + int busy_cycles; /** * @timer_ticks: number of times that homa_timer has been invoked diff --git a/homa_incoming.c b/homa_incoming.c index ba5fac84..9ff62827 100644 --- a/homa_incoming.c +++ b/homa_incoming.c @@ -1886,9 +1886,9 @@ void homa_incoming_sysctl_changed(struct homa *homa) tmp = (tmp*cpu_khz)/1000; homa->poll_cycles = tmp; - tmp = homa->gro_busy_usecs; + tmp = homa->busy_usecs; tmp = (tmp*cpu_khz)/1000; - homa->gro_busy_cycles = tmp; + homa->busy_cycles = tmp; tmp = homa->bpage_lease_usecs; tmp = (tmp*cpu_khz)/1000; diff --git a/homa_offload.c b/homa_offload.c index 15651b20..fdc9319c 100644 --- a/homa_offload.c +++ b/homa_offload.c @@ -313,7 +313,7 @@ int homa_gro_complete(struct sk_buff *skb, int hoffset) // NAPI_GRO_CB(skb)->count); #define CORES_TO_CHECK 4 - if (homa->gro_policy & HOMA_GRO_IDLE_NEW) { + if (homa->gro_policy & HOMA_GRO_GEN2) { /* Pick a specific core to handle SoftIRQ processing for this * group of packets. This policy scans the next several cores * in order after this, trying to find one that is not @@ -333,7 +333,7 @@ int homa_gro_complete(struct sk_buff *skb, int hoffset) core = homa_cores[candidate]; if (atomic_read(&core->softirq_backlog) > 0) continue; - if ((core->last_gro + homa->gro_busy_cycles) > now) + if ((core->last_gro + homa->busy_cycles) > now) continue; tt_record3("homa_gro_complete chose core %d for id %d " "offset %d with IDLE_NEW policy", diff --git a/homa_plumbing.c b/homa_plumbing.c index e4197054..37ca1964 100644 --- a/homa_plumbing.c +++ b/homa_plumbing.c @@ -268,7 +268,7 @@ static struct ctl_table homa_ctl_table[] = { }, { .procname = "gro_busy_us", - .data = &homa_data.gro_busy_usecs, + .data = &homa_data.busy_usecs, .maxlen = sizeof(int), .mode = 0644, .proc_handler = homa_dointvec diff --git a/homa_utils.c b/homa_utils.c index 1bcba3f3..17e35b6f 100644 --- a/homa_utils.c +++ b/homa_utils.c @@ -148,7 +148,7 @@ int homa_init(struct homa *homa) homa->max_gro_skbs = 20; homa->gso_force_software = 0; homa->gro_policy = HOMA_GRO_NORMAL; - homa->gro_busy_usecs = 10; + homa->busy_usecs = 10; homa->timer_ticks = 0; spin_lock_init(&homa->metrics_lock); homa->metrics = NULL; diff --git a/test/unit_homa_offload.c b/test/unit_homa_offload.c index 497215f0..93347fdd 100644 --- a/test/unit_homa_offload.c +++ b/test/unit_homa_offload.c @@ -302,9 +302,9 @@ TEST_F(homa_offload, homa_gro_receive__max_gro_skbs) TEST_F(homa_offload, homa_gro_complete__GRO_IDLE_NEW) { - homa->gro_policy = HOMA_GRO_IDLE_NEW; + homa->gro_policy = HOMA_GRO_GEN2; mock_cycles = 1000; - homa->gro_busy_cycles = 100; + homa->busy_cycles = 100; cpu_number = 5; atomic_set(&homa_cores[6]->softirq_backlog, 1); homa_cores[6]->last_gro = 0;