Subject: Re: [PATCH] net: rps: fix data stall after hotplug

From: [email-masked]
Date: Tue, 31 Mar 2015 22:02:03 -0000

> Listen, I would rather disable RPS on your arch, instead of messing with
> it.
>
> Reset NAPI state as you did is in direct violation of the rules.
>
> Only cpu owning the bit is allowed to reset it.
>

Perhaps my understanding of the code in dev_cpu_callback() is incorrect?
Please correct me if I am wrong.

The poll list is copied from an offline cpu to an online cpu.
Specifically for process_backlog, I was under the impression that
the online cpu tries to reset the state of NAPI of the offline cpu.
The process and input queues are then always copied to the
online cpu.

while (!list_empty(&oldsd->poll_list)) {
	struct napi_struct *napi = list_first_entry(&oldsd->poll_list,
						    struct napi_struct,
							     poll_list);

	list_del_init(&napi->poll_list);
	if (napi->poll == process_backlog)
		napi->state = 0;
	else
		____napi_schedule(sd, napi);
}

My request was to know why it would be incorrect to clear the offline cpu
backlog NAPI state unconditionally.