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