[PATCH 1/2] util: Separate numactl and stubs into different source files

Martin Kletzander mkletzan at redhat.com
Mon Mar 20 15:12:48 UTC 2023


On Mon, Mar 20, 2023 at 11:50:16AM +0000, Daniel P. Berrangé wrote:
>On Mon, Mar 20, 2023 at 12:39:55PM +0100, Martin Kletzander wrote:
>> Fix the build, mainly with clang's optimizations and demonstrate a
>> separation of function implementations.  This patch does it only for
>> functions that differ in implementation based on WITH_NUMACTL but
>> ideally this would be done for the WITH_NUMAD and __linux__ parts as
>> well.
>
>I don't think we should do this, as it is addressing just one specific
>example that happens to hit us today. We've hit thue same problem a few
>years ago in different functions.
>

I think it is a quite clean solution that still makes sense even in case
GCC starts doing similar "optimization" (quotes because looking at the
assembly in this specific instance there is no speed-up or size change,
it can actually be a bit bigger in size).  And we could eventually end
up with visible separation of mocked functions, but that is not the main
intention of this proposal.

>The problem with interprocedural analysis is a general one that can affect
>any part of the code base. I don't think we want wait to hit the problem
>again in yet another piece of the code in the future, as it is really
>horrible to debug and diagnose.
>

Of course we can still keep the second patch, even though we will not
find out the outliers.

>The use of the -fsemantic-interposition arg gives us a general solution
>to the problem with CLang for the long term, that makes our mocking of
>functions reliable.
>

For this particular problem, yes.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20230320/88806707/attachment.sig>


More information about the libvir-list mailing list