I would like to respond to the following question since
the zones team worked with Sasha on this part of his
proposal.
James Carson wrote:
> I'm confused by 'rctl zone.cpu-cap' versus 'capped-cpu ncpus' in
> zonecfg.
>
> They appear to be specifying the same thing. Why would an
> administrator need two different ways to specify the same thing? What
> happens if both are set?
>
> It doesn't look to me like 2006/496 has been delivered yet (it's only
> in snv_56), so there's still time to change things and no need at all
> to keep compatibility -- if that's the concern.
These are two different things. We discussed this is in the 2006/496
case but let me try to recap here. This is not a compatibility issue.
zone.cpu-cap is a resource control (rctl). The 2006/496 case introduced
some new zonecfg resources named 'capped-memory' and 'dedicated-cpu'.
Although zonecfg calls these 'resources' these have nothing to do with
resources in the rctl sense. They are just a property grouping
within zonecfg.
As part of 2006/496 we discussed the idea of adding new zonecfg resources
to simplify the way that zonecfg can configure resource management.
Sasha's proposal is the next step here. We want to add a new zonecfg
resource named 'capped-cpu'. Within that resource is one property named
'ncpus'. That property is an rctl alias for the zone.cpu-cap rctl and will
configure that rctl, similar to the way that the other rctl aliases
work. Again, there are more details in 2006/496. With this new scheme,
the simple and preferred way to set up rctls in zonecfg is via these
rctl alias. Thus, a user would now 'add capped-cpu' within zonecfg
and then set 'ncpus' in order to set up the zone.cpu-cap rctl. The ncpus
name is chosen to be consistent with the way we already added the
'dedicated-cpu'
resource within zonecfg. We also normalize the units, again to be
consistent. Thus, it is possible to set the zone.cpu-cap rctl in
two different ways within zonecfg but that is already true for all of
the rctls since the introduction of 2006/496 where we added the rctl
alias mechanism. Here is the picture of where we are headed with these
new zonecfg resources:
| dedicated | capped
---------------------------------
cpu | temporary | cpu-cap
| processor | rctl*
| set |
---------------------------------
memory | temporary | rcapd, swap
| memory | and locked
| set* | rctl
2006/496 added 'dedicated-cpu' and 'capped-memory'. This case is proposing
to add a 'capped-cpu' resource and eventually we'll add a 'dedicated-memory'
resource.
Although it may seem silly to have a resource with only a single property
in it, we already have other resources in zonecfg that do this and we (the
zones team) are starting to think about additional, optional properties
that we might want to add under the 'capped-cpu' resource.
Please let me know if you have any questions about this or the way I explained
it.
Thanks,
Jerry