Re: [PATCH] vt: configurable number of console devices

From: Theodore Ts'o
Date: Wed May 29 2019 - 19:36:04 EST


On Wed, May 29, 2019 at 03:09:11PM -0700, Trevor Bourget wrote:
> Sorry, I hadn't registered that was uapi. You are right, as a
> configuration setting it's an odd thing to expose there.
> That define won't really be any use to user space except for type
> range validation, and as such it would actually be unhelpful for it to
> be other than 63.
>
> I will add if defined(__KERNEL__) to improve that, so that it will be
> constant for uapi.

It's by design that MAX_NR_CONSOLES is defined in a uapi header.
There are userspace programs that rely on this value (they use it to
declare arrays, so the version that we export to userspace MUST be
largest value that any kernel might support).

That being said, I've done an eyeball inspection to see how manytes
might be saved if we were to shirnk MAX_NR_CONSOLES, and... I don't
see that many bytes. Maybe 24 bytes per console, so that maximum
savings would less than 1.5k? Am I missing something?

Yes, we should all worry about kernel bloat; but it's not clear to me
this is a great place to start. :-)

- Ted