Re: [PATCH] Drivers: hv: vmbus: Deferring per cpu tasks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 26, 2024 at 12:01:33AM +0000, Dexuan Cui wrote:
> > From: Saurabh Singh Sengar <ssengar@xxxxxxxxxxxxxxxxxxx>
> > 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
> 
> 




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux