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

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


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Fri, 29 Nov 2024 11:14:19 +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=KzvttSIp3RkzvLTwE9pq+/CshgN20eq43EVAtb5tpVQ=; b=TlmqpaosRYmD1K/Fkrkx+pp9L5Gspn0dHH2+ZFgbT7YKlId+xinxNWq3Rt5x7xFiKEI1tnXOaqQeEVTzHqKQBgh9UHeiFGRssUct0N7z7aCIxkgOR3kR21PhJrm8bdcaFT1mOas9eYHOFTZ/3kGjGKjCKnERqG8uKZm9MakGGkrl75qlwmRgEqnA+8fIbTCnlYWAr/5bHlJrdWkCPp74Bo8Bf+rGWFlaAPY49cC7heb3t1uWzr6GM5GEccl6s4r/ic9upCyP+It4dKRChPkte6VjnnOHzV+JvdEoPvuD0iQ0FOdUheOrnMYDcJGnlLyFk2wuipyZeUAdMxA+XrAXoQ==
  • 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=KzvttSIp3RkzvLTwE9pq+/CshgN20eq43EVAtb5tpVQ=; b=LKMd+KmY4FFcJpKnHienVbt6l7dMZ+ig3EOcOsRsWOMjPKOHA4QAQ/59yJdy7ls/HmY03r9e15C1MaQVO3AV8z6UEzy19nZtTIIxg82641SEDE8bUXseAhhP89P2xsEoQ3xBRboNk3jVO+DY/Tb0CMdkWKyl5A6NC9c0Z5oNTlgIGsnoWOHRS4zYOkVT2Gdaope2rJw8SRcA5LYGvwor3bKgUiOKNtYqN5WpGY2Bthtx5dN837OkuIIcyDekfhGPFcAfXHnB1gsYA+JcOF+treT46xpZupFLxAAKWp+VkTypMeq8JGhhMej7sNuK/4c1c6LdSujngVButAekxTwltA==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=E6wKuT5hK2PbYx3ltyCu7T1QdsavpTD63Fb2jWjZ0tU2ynjP24Z44OFgt2mZW4VFv8l5xAstkiz7LKR9ZU+wxFOlhwWoEQ1rKlMcDZ+BjMPA4J7BU/ppQLtJquuF/KSfJz4LS9jaFStz1sK1MT/1+rapjnOJEpQ7VBbRqWnxUNpU3Z4uAMfNW4yKi25RkRMcKhREca2zUqQTLEL3bVuHy8xjmITuQkDXgiiWay+reRy13fgaKLXYk/bT0XaIxKn0D6ejur2v8M2s1bshRTGzTZotigjqhfACBJzHZBbSlEUJf2JOs2snTPp7YEc2WwLtkmYelJzk6jV3K2gjVZ2QgQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=C0hDL2j9Z4t101KGZt2TyZx8+B9KGC1lMgdfb/wor001YJcJfUwJ+FBD5oOxtP4rvGVNAvyMQYpA+pCM8T3GFRDE61A/eThu3tZOosqnzhliInnWCJOtvBr5ImwxOkn5/KoLHJKMZBA8E4UumfPsvdI1ogeHJFQgegTEMdW223pDdLt4yZWeuD9vIM5LTLDuY2+/LPs/0nVU8xrMkW5AqJ83KzLbXyQNFQrdbN3jVOS7sH7gY6tIzKT6KQvj+ltwDEWdDSraTTy64/e215gynRd+tM/jZx/83CjCthELQySUp39lFq167paacPfZq0MVZgCP/JRH1kG6MV9oYfzl6Q==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 29 Nov 2024 11:14:49 +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: AQHbQj8EJeBBpea3PECsMrqs79+q+7LOGRaAgAAB8gA=
  • Thread-topic: [PATCH v3 1/5] common/vmap: Fall back to simple allocator when !HAS_VMAP

Hi Jan,

> On 29 Nov 2024, at 11:06, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> On 29.11.2024 10:12, Luca Fancellu wrote:
>> --- 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)))))
>> 
>> +#ifdef 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 /* !CONFIG_HAS_VMAP */
>> +
>> +static inline void xvfree(void *va)
>> +{
>> +    xfree(va);
>> +}
>> +
>> +static inline void *_xvmalloc(size_t size, unsigned int align)
>> +{
>> +    return _xmalloc(size, align);
>> +}
>> +
>> +static inline void *_xvzalloc(size_t size, unsigned int align)
>> +{
>> +    return _xzalloc(size, align);
>> +}
>> +
>> +static inline void *_xvrealloc(void *va, size_t size, unsigned int align)
>> +{
>> +    return _xrealloc(va, size, align);
>> +}
> 
> Just to double check: Was it at least considered to use simple #define-s
> to effect the aliasing? Wrapper functions like the above ones have the
> downside of needing touching (easy to miss) when the wrapped function
> types change in whichever minor way. (And yes, I do understand that we
> generally aim at using inline functions in preference to macros.)

Yes, I think I tried and I didn’t have issues using #define-s, I asked here
https://patchwork.kernel.org/project/xen-devel/patch/20241115105036.218418-2-luca.fancellu@xxxxxxx/#26123448
about a preferred approach, but I didn’t have any reply, so I went for what
I believed was preferred as you said, static inline-s instead of macros.

Cheers,
Luca


 


Rackspace

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