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

Re: [Xen-devel] [PATCH] xen/sched: Remove d->is_pinned



>>> On 01.04.19 at 14:35, <andrew.cooper3@xxxxxxxxxx> wrote:
> On 01/04/2019 13:21, Jan Beulich wrote:
>>>>> On 01.04.19 at 12:09, <andrew.cooper3@xxxxxxxxxx> wrote:
>>> 3) cpumask_weight() is a surprisingly expensive function, and we use it all
>>>    over the place.  It will almost certainly benefit from the use of popcnt.
>> FTR this was something I was meaning to possibly do once the BMI2
>> alternatives patching series would have been accepted. It having
>> got rejected (and also the fsgsbase patching one, but that's moot
>> now anyway due to selection of insn having become dependent on a
>> runtime property), I've stopped all considerations towards further
>> alternatives. While there wouldn't be as many helper functions
>> needed here as they were needed there, our basic disagreement
>> as to whether to use per-register helper functions would continue
>> to exist.
> 
> The Linux way of fixing this is actually very neat.
> 
> Depending on the CPU, there may genuinely be a call to a software
> routine, or a single popcnt instruction.  Therefore, the end result is:
> 
> asm (ALTERNATIVE("call __sw_hweight64",
>                  "popcnt %[in], %[out]", X86_FEATURE_POPCNT)
>                  : [out] "=a" (res),
>                  : [in] "=D" (w));

But that's precisely the reason for our disagreement on the BMI2
series: I dislike taking away all control from the compiler as to
which register to choose.

> etc.  I also note that Linux now has a more optimised sofware version
> for x86 and Arm64, due to the architecture selecting
> CONFIG_ARCH_HAS_FAST_MULTIPLIER

This may indeed be worthwhile to clone.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.