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

Re: [Xen-devel] [PATCH v3 2/5] build: Hook the schedulers into Kconfig

Juergen Gross writes:

> On 08/01/16 17:02, Jonathan Creekmore wrote:
>> Andrew Cooper writes:
>>> On 08/01/16 15:47, Konrad Rzeszutek Wilk wrote:
>>>> On Thu, Jan 07, 2016 at 11:29:18AM -0600, Jonathan Creekmore wrote:
>>>>> Allow the schedulers to be independently enabled or disabled at
>>>>> compile-time. To match existing behavior, all four schedulers are
>>>>> compiled in by default, although the Credit2, RTDS, and ARINC653 are
>>>>> marked EXPERIMENTAL to match their not currently supported status.
>>>> By unmarking all of them in sequence I was able to get this:
>>>> #
>>>> # Schedulers
>>>> #
>>>> # CONFIG_SCHED_CREDIT is not set
>>>> # CONFIG_SCHED_CREDIT2 is not set
>>>> # CONFIG_SCHED_RTDS is not set
>>>> # CONFIG_SCHED_ARINC653 is not set
>>>> # CONFIG_SCHED_ARINC653_DEFAULT is not set
>>>> And the hypervisor did build with:
>>>> [konrad@char xen]$ nm --defined xen-syms |grep schedulers
>>>> ffff82d080290d58 D __end_schedulers_array
>>>> ffff82d080290d58 D __start_schedulers_array
>>>> :-)
>>>> Not exactly sure if there is some way to make us _not_ shoot
>>>> ourselves in the foot by mistake.
>>>> Perhaps the build should complain if the size of the
>>>> __schedulers_array is zero?
>>> Hmm yes - an ASSERT() at the bottom of the linker file would be a very
>>> good defensive measure.
>>> A hypervisor without any schedulers compiled in will be rather sad.
>> I can definitely add that in.
> I think there should be an ASSERT (or some other measure) to
> ensure the default scheduler is available.

So, in a normal configuration case, that should not be able to
happen. The way the Kconfig is set up, the default will only give you an
option to choose schedulers that are enabled in the build.

1) "normal" (non-expert) configuration --- the user never sees that
schedulers are available for configuration, so all of them are compiled
in and the credit scheduler is chosen by the default.

2) "expert" configuration --- the user can select which schedulers are
available in the build and can choose which one is the default. If a
scheduler is not selected to be part of the build, it is not available
in the default selection dialog.

3) "pathological" configuration --- the user disabled all of the
schedulers, but due to a quirk with hiding the scheduler menu for the
non-expert case, it fell back to the "credit" scheduler for the

So, based on the Kconfig setup and the linker ASSERT, there should be no
way to have a default scheduler that is not in the build. I wish Kconfig
allowed you to state that you must have at least one option selected or
up to all of the options selected (so I could require 1-4 schedulers
compiled in, but not 0). Unfortunately, the only way that seems allowed
is if you compile code in as modules, which Xen does not (with a choice
block, you can select multiple items as M, but only 1 as Y, but at least
1 must be present --- since we only support Y, the choice block wouldn't
work for the schedulers).

Xen-devel mailing list



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