[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240726052651.GA28809@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>
Date: Thu, 25 Jul 2024 22:26:51 -0700
From: Saurabh Singh Sengar <ssengar@...ux.microsoft.com>
To: Dexuan Cui <decui@...rosoft.com>
Cc: Nuno Das Neves <nunodasneves@...ux.microsoft.com>,
KY Srinivasan <kys@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
"wei.liu@...nel.org" <wei.liu@...nel.org>,
"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Saurabh Singh Sengar <ssengar@...rosoft.com>,
"srivatsa@...il.mit.edu" <srivatsa@...il.mit.edu>
Subject: Re: [PATCH] Drivers: hv: vmbus: Deferring per cpu tasks
On Fri, Jul 26, 2024 at 12:01:33AM +0000, Dexuan Cui wrote:
> > From: Saurabh Singh Sengar <ssengar@...ux.microsoft.com>
> > Sent: Thursday, July 25, 2024 8:35 AM
> > Subject: Re: [PATCH] Drivers: hv: vmbus: Deferring per cpu tasks
>
> Without the patch, I think the current CPU uses IPIs to let the other
> CPUs, one by one, run the function calls, and synchronously waits
> for the function calls to finish.
>
> IMO the patch is not "Deferring per cpu tasks". "Defer" means "let it
> happen later". Here it schedules work items to different CPUs, and
> the work items immediately start to run on these CPUs.
>
> I would suggest a more accurate subject:
> Drivers: hv: vmbus: Run hv_synic_init() concurrently
Agree, this explains the change better.
>
> > - ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN,
> > "hyperv/vmbus:online",
> > - hv_synic_init, hv_synic_cleanup);
> > + cpus_read_lock();
> > + for_each_online_cpu(cpu) {
> > + struct work_struct *work = per_cpu_ptr(works, cpu);
> > +
> > + INIT_WORK(work, vmbus_percpu_work);
> > + schedule_work_on(cpu, work);
> > + }
> > +
> > + for_each_online_cpu(cpu)
> > + flush_work(per_cpu_ptr(works, cpu));
> > +
>
> Can you please add a comment to explain we need this for CPU online/offline'ing:
ok
> > + ret = __cpuhp_setup_state_cpuslocked(CPUHP_AP_ONLINE_DYN,
> > "hyperv/vmbus:online", false,
> > + hv_synic_init, hv_synic_cleanup,
> > false);
> > + cpus_read_unlock();
>
> Add an empty line here to make it slightly more readable? :-)
My personal preference was to have empty line as well here, but then I looked the
other places in this file where we used cpus_read_unlock, hence I maintained that
style consistent.
Please let me know if you have strong opinion about this empty line, I can add in V2.
- Saurabh
> > + free_percpu(works);
> > if (ret < 0)
> > goto err_alloc;
>
> Thanks,
> Dexuan
>
>
Powered by blists - more mailing lists