Re: [kvm-unit-tests PATCH v2 2/6] lib: s390x: smp: refactor smp functions to accept indexes

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

 



On Tue, 15 Feb 2022 12:43:15 +0100
Steffen Eiden <seiden@xxxxxxxxxxxxx> wrote:

> On 2/15/22 12:23, Claudio Imbrenda wrote:
> > On Tue, 15 Feb 2022 12:09:53 +0100
> > Steffen Eiden <seiden@xxxxxxxxxxxxx> wrote:
> > 
> > [...]
> >   
> >> What about using the smp wrapper 'smp_sigp(idx, SIGP_RESTART, 0, NULL)'
> >> here as well?  
> > 
> > [...]
> >   
> >> With my nits fixed:  
> > 
> > maybe I should add a comment explaining why I did not use the smp_
> > variants.
> > 
> > the reason is that the smp_ variants check the validity of the CPU
> > index. but in those places, we have already checked (directly or
> > indirectly) that the index is valid, so I save one useless check.  
> > > on the other hand, I don't know if it makes sense to optimize for that,  
> > since it's not a hot path, and one extra check will not kill the
> > performance.
> >  
> I would prefer the use of the smp_ variant. The extra assert won't 
> clutter the output and the code is more consistent.
> However, a short comment is also fine for me if you prefer that.

I guess I'll use the smp_ variant and add a few lines in the patch
description to explain that we're doing some extra checks, but the code
is more readable

> 
> >>
> >> Reviewed-by: Steffen Eiden <seiden@xxxxxxxxxxxxx>  
> >   




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux