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

Re: [PATCH 1/5] common/vmap: Fall back to simple allocator when !HAS_VMAP


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Fri, 15 Nov 2024 12:12:57 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ka+6tg+d0UjMzOGfzNZxhXIIG8Kxi6GwB/TwiHXq1oo=; b=bx6KaU2cAIJTupiDWI3UgRBkHwsHjKILMCR41qbQ7vHKjR519dtTbRURdzKDWPMaDCoA+Y8aJ64IyEnsQ5XSAnXuo55StjZZ++6oqd7kdpB4FUWhf6+TS/5qsYd192uo3Z+KsMtUN727FAV3gzR2gsld1E1GhE97K2/mtxN2MXiG4HpODOZ1ccQLchzgXwziFZoeFrqU0sfUiCS1zVPNT7lpCaoukVDxYSrzIlL6MkpEcpZUdjLGaHO474lVgGu6WgCj/turSvhlS2jJDoSkO++pIrT3brACI1uDxX8zjg5LOHZxjdXxZe57mHPFZJo+Ejn1XSHGz8yi7A1+dCODeA==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ka+6tg+d0UjMzOGfzNZxhXIIG8Kxi6GwB/TwiHXq1oo=; b=vSGJ4pyrawQq0bdtBx8OD/xRbkIVK8r5eOR6bXy+cfjV/DIWUTtEymkG4GnaIKuRoznlvgWRLDTMagCRKoq58ymtx/EqkF10VR3wu/95QSf2+vOyQBM8g4OTrHIV2yxj/6dafUYeXvSoV0A9hktoC+Hela/znr55VCIfGSV3H3ezdkO0PmQDFR8Dogr2mAmwm0fH5ZwQQhQa2GvoiIZj0O+DM2aPpPVUmCgVYAglvQvD1Dihcr2H4sjcPjQxiwUIXGBlgOP+8AHd7+8NtskxsrwbVtzpLA4oCN2g4dl20bARZUloFb22VQ5TJyeWmJqYVmxGFqHAxs7Dd1Uy1h7ViQ==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=CiMW0lhiCeCLdvSZ3jNNM6dGTnIHqCwpb49bb+B1ZBK8ZXyBnt286Y8dvCDsgZdDKvKtympFe+jlZHLOKmK2bs1GoMkYG2lnH0vKZfm3sea+1Fx4crHuQSn/oRTdyT+eOYVeIgxNiTDZjHwcVeN3qVs1B3FYh3qmPdZJCCEOCdq1Ptul+B0YKR3tqaKSIxz9r/EY69jgtCEp4Ql8y5CU0k4VcWaUbeCLWuVIDjOxNNnVDTK+524UD9HiwakRHio2TE5FK0i4q0EKJhnq0n5AvTCOP2Nr0RBFTM8YMuY/sBDXAFQRMOsUitCWssiFYzPDa/lPPpzVHCcGJMNtyMh9AQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=SdT4CKUcJhzC3C0kNbhV3oYyq4j1BAERdJQEBF+cx+R97sbctmwa5BRfcZP3thS3opNS8hg06Bb/jGr7ZFjKwAMHtbmAQzqlMW3qzrqiBJDKPlviEYqS/sFfYu33idF0VzoMki73vAnCeb/tc2G2d+hPrj2/rDJpDiYUttPqEAv+DJyGzY/+k4Qu0mCEhNtxIJFa0kucajJUJqkYJb2955LDYV82cNjScKiLGiJ8LucCcTJisxucPIDFexcWTkMJW5YanCbHownn4tDDxrf6IKVpUM/17Lk8vOOVHNsREAkLtr56FMr03noMETtzNxim2jRz658aVj3EvldaGGRu3Q==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Fri, 15 Nov 2024 12:13:23 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHbN0xEMVIvN3HbzEuhbXugN/BCZLK4PUmAgAADYgA=
  • Thread-topic: [PATCH 1/5] common/vmap: Fall back to simple allocator when !HAS_VMAP


> On 15 Nov 2024, at 12:00, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
> 
> On 15/11/2024 10:50 am, Luca Fancellu wrote:
>> diff --git a/xen/include/xen/xvmalloc.h b/xen/include/xen/xvmalloc.h
>> index 440d85a284bb..802be6687085 100644
>> --- a/xen/include/xen/xvmalloc.h
>> +++ b/xen/include/xen/xvmalloc.h
>> @@ -40,20 +40,46 @@
>>     ((typeof(ptr))_xvrealloc(ptr, offsetof(typeof(*(ptr)), field[nr]), \
>>                              __alignof__(typeof(*(ptr)))))
>> 
>> +#if defined(CONFIG_HAS_VMAP)
>> +
>> /* Free any of the above. */
>> void xvfree(void *va);
>> 
>> +/* Underlying functions */
>> +void *_xvmalloc(size_t size, unsigned int align);
>> +void *_xvzalloc(size_t size, unsigned int align);
>> +void *_xvrealloc(void *va, size_t size, unsigned int align);
>> +
>> +#else
>> +
>> +static inline void xvfree(void *va)
>> +{
>> +    xfree(va);
>> +}
>> +
>> +void *_xvmalloc(size_t size, unsigned int align)
>> +{
>> +    return _xmalloc(size, align);
>> +}
>> +
>> +void *_xvzalloc(size_t size, unsigned int align)
>> +{
>> +    return _xzalloc(size, align);
>> +}
>> +
>> +void *_xvrealloc(void *va, size_t size, unsigned int align)
>> +{
>> +    return _xrealloc(va, size, align);
>> +}
>> +
>> +#endif
> 
> Does this really compile with the wrappers not being static inline ?

wow, yes it is compiling and I’m surprised about that, this was clearly a 
mistake, I’ll fix

> 
> That aside, could we not do this using conditional aliases, rather than
> wrapping the functions?  It would certainly be shorter, code wise.

I’ll ping you to understand better what you mean here


> 
> ~Andrew


 


Rackspace

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