From: dmukhin@ford.com
To: Jan Beulich <jbeulich@suse.com>
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech,
julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
sstabellini@kernel.org, dmukhin@ford.com,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v5 5/6] xen/console: update conring memory allocation
Date: Fri, 8 May 2026 14:45:52 -0700 [thread overview]
Message-ID: <af5ZkFyE+LO63BYh@kraken> (raw)
In-Reply-To: <b5c89f74-cdaf-40a7-b32b-6c54610a5d9c@suse.com>
On Mon, Feb 09, 2026 at 06:02:52PM +0100, Jan Beulich wrote:
> On 05.02.2026 02:36, dmukhin@xen.org wrote:
> > --- a/xen/drivers/char/console.c
> > +++ b/xen/drivers/char/console.c
> > @@ -463,20 +463,34 @@ static void cf_check conring_dump_keyhandler(unsigned char key)
> > void __init console_init_ring(void)
> > {
> > char *ring;
> > - unsigned int start, size, chunk, order, memflags;
> > + unsigned int start, size, chunk;
> > unsigned long flags;
> >
> > if ( !opt_conring_size )
> > return;
> >
> > - order = get_order_from_bytes(max(opt_conring_size, conring_size));
> > - memflags = MEMF_bits(crashinfo_maxaddr_bits);
> > - while ( (ring = alloc_xenheap_pages(order, memflags)) == NULL )
> > + opt_conring_size = max(opt_conring_size, conring_size);
> > + size = ROUNDDOWN(opt_conring_size, PAGE_SIZE);
> > + if ( size != opt_conring_size )
> > {
> > - BUG_ON(order == 0);
> > - order--;
> > + opt_conring_size = size;
> > + printk(XENLOG_WARNING "Rounding down console ring size to multiple of %lu KiB.\n",
> > + PAGE_SIZE >> 10);
> > }
> > - opt_conring_size = PAGE_SIZE << order;
> > + if ( opt_conring_size >= GB(2) )
> > + {
> > + opt_conring_size = GB(2);
> > + printk(XENLOG_WARNING "Limiting user-configured console ring size.\n");
> > + }
> > + else if ( opt_conring_size < _CONRING_SIZE )
> > + {
> > + opt_conring_size = _CONRING_SIZE;
> > + printk(XENLOG_WARNING "Using compile-time console ring size.\n");
> > + }
> > +
> > + /* Contiguous buffer; does not need to be naturally aligned. */
> > + ring = xmalloc_bytes(opt_conring_size);
>
> I'm sorry, but I'm going to veto any new uses of xmalloc_bytes(). As per the
> comment at the top of xvmalloc.h, the family of functions there should be used
> in new code. That family deliberately doesn't include a counterpart of
> xmalloc_bytes(). You're wanting a multiple of page size anyway, so perhaps it
> is warranted here to actually use vmalloc() directly.
Thanks for taking a look at the series!
Sorry it's been a while, I am getting back to the series only now :-/
Turns out that vmalloc() is not available on MPU systems (*-mpu jobs in CI):
CONFIG_HAS_VMAP is disabled.
I will switch to xvmalloc-backed allocation, if that's OK.
--
Denis
next prev parent reply other threads:[~2026-05-08 21:46 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-05 1:36 [PATCH v5 0/6] xen/console: configurable conring size dmukhin
2026-02-05 1:36 ` [PATCH v5 1/6] xen/console: group conring code together dmukhin
2026-02-09 16:38 ` Jan Beulich
2026-02-11 19:47 ` dmukhin
2026-02-05 1:36 ` [PATCH v5 2/6] xen/console: make console buffer size configurable dmukhin
2026-02-05 8:43 ` Jan Beulich
2026-02-06 1:52 ` dmukhin
2026-02-05 1:36 ` [PATCH v5 3/6] xen/console: promote conring{,_size} to __ro_after_init dmukhin
2026-02-09 16:40 ` Jan Beulich
2026-02-11 19:47 ` dmukhin
2026-02-05 1:36 ` [PATCH v5 4/6] xen/console: use memcpy() in console_init_ring() dmukhin
2026-02-09 16:56 ` Jan Beulich
2026-02-05 1:36 ` [PATCH v5 5/6] xen/console: update conring memory allocation dmukhin
2026-02-09 17:02 ` Jan Beulich
2026-05-08 21:45 ` dmukhin [this message]
2026-02-10 15:08 ` Jan Beulich
2026-02-05 1:36 ` [PATCH v5 6/6] xen/console: add conring buffer size alignment setting dmukhin
2026-02-10 15:10 ` Jan Beulich
2026-05-08 21:46 ` dmukhin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=af5ZkFyE+LO63BYh@kraken \
--to=dmukhin@ford.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.