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

Re: [PATCH 20/36] xen/common: introduce buddy required reservation


  • To: Marco Solieri <marco.solieri@xxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 9 Mar 2022 15:45:24 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=S8FjfXobxanBccpWmkWYP1b5RdC8oUZVydx3gvwbpUk=; b=d0hm5wxLZGLjWW4Cd6zvBhPkjiqX8V/tlPZS1hYpHgjbcB4PR96DwuLkRvUVScaF2MYuheI5H5XX46fxN0DlOSUeZ9EwIAuat5aNMy/gwRxxzUs5m70Ww1t1IdriWuSQ7jygQJdfRNCOdNQj6ufYgY2IOAuHHCxeRC580SM9F8zTmAWtaXGN41zCDKw8VgoCdCgEYWIPCHWkt8eFJNFFrXTOwCJo4drcMDaVuCLQVgr4REyiAccLyeBNZBTJwZJ7/nMkGNObc2MYE/VbOSsNuO1vK7UzIIRVaB/Wj0NYDJVwcc9AnzKAP+4BMILwAvmrfSqeFJ1JWc8xWOpBF8bGPw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UtaOlNLMH8ilsewrf2j88xFLE8WaAhKg2mAQo5T04/CVlQQZboPSQa6JkUquI6ki9CLrd9XkusNz0XV7ceYKJCo0OQG1Evds73PMSaV4KjCGL6etuzaWfqrTspQwygVDQ3573vZFZorQ9aWxF/Tm3j6oV1WRM5Fmn9IF1R073ECneno49qcA+1va+GARBjBgMwEQmbcmGpjAp2pvQZknI0m10egbRgCAnsZIUux9CQwJwQBi7hK1CJbqPbwbsHWsLWnXBJIOtBBklu9GINnEClIE5IqKyLmBJiE9DrZqRe6RxLkOHY54+i6ITjlGxXJDHJwyM+vi3oD+BtPiVCUsFg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Marco Solieri <marco.solieri@xxxxxxxxxx>, Andrea Bastoni <andrea.bastoni@xxxxxxxxxxxxxxx>, Luca Miccio <lucmiccio@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 09 Mar 2022 14:45:36 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 04.03.2022 18:46, Marco Solieri wrote:
> --- a/xen/common/page_alloc.c
> +++ b/xen/common/page_alloc.c
> @@ -230,6 +230,13 @@ static bool __read_mostly scrub_debug;
>  #define scrub_debug    false
>  #endif
>  
> +#ifdef CONFIG_COLORING
> +/* Minimum size required for buddy allocator to work with colored one */
> +unsigned long buddy_required_size __read_mostly = MB(64);
> +#else
> +unsigned long buddy_required_size __read_mostly = 0;
> +#endif

Please avoid such redundancy when possible. Here perhaps easiest
by having the value come from Kconfig. By giving that separate
option a prompt, it would even become configurable at build time.

> @@ -678,6 +685,13 @@ static void dump_col_heap(unsigned char key)
>  
>      printk("Total number of pages: %lu\n", total_avail_col_pages);
>  }
> +static int __init parse_buddy_required_size(const char *s)
> +{
> +    buddy_required_size = simple_strtoull(s, &s, 0);
> +
> +    return *s ? -EINVAL : 0;
> +}
> +custom_param("buddy_size", parse_buddy_required_size);

Why not integer_param() or, even better fitting the purpose,
size_param()? Also (I may have said so elsewhere already) please
prefer - over _ in new command line option names. And of course
the name needs to be unambiguous enough for it to be easy to
associate the purpose.

Jan




 


Rackspace

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