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

Re: [Xen-devel] [PATCH 4/7] x86/domain: Remove unused parameters from {hvm, pv}_domain_initialise()



On 13/03/18 12:05, Roger Pau Monné wrote:
> Maybe this could be:
>
> if ( is_idle_domain(d) )
> ...
> else
> {
>     rc = is_hvm_domain(d) ? hvm_domain_initialise(d)
>                           : pv_domain_initialise(d);
>     if ( rc )
>         goto fail;
> }
>
> But that's maybe out of the scope of this patch.

I'd actually like to reconsider our use of this design pattern.

As far as I can tell from some XTF examples, it forces the use of a
function pointer rather than an "if call else call" which in turn
forcibly out-of-lines static inline stubs, and prevents LTO from merging
a cross TU call into its sole caller.

While the code does does look slightly neater as a result, I get the
feeling that

if ( is_hvm_domain(d) )
    rc = hvm_domain_initialise(d);
else
    rc = pv_domain_initialise(d);

is far easier for the compiler to optimise when the opportunities arise.

~Andrew

_______________________________________________
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®.