[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH RFC v2 1/4] xen: add real time scheduler rt
- To: Meng Xu <xumengpanda@xxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxxxxx>
- From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Date: Mon, 4 Aug 2014 11:23:20 +0100
- Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>, Sisu Xi <xisisu@xxxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxx>, Meng Xu <mengxu@xxxxxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Chong Li <lichong659@xxxxxxxxx>, Dagaen Golomb <dgolomb@xxxxxxxxxxxxxx>
- Delivery-date: Mon, 04 Aug 2014 10:23:38 +0000
- List-id: Xen developer discussion <xen-devel.lists.xen.org>
On 02/08/14 16:31, Meng Xu wrote:
It means that anyone else who peaks at ops->sched_data will see a
partially constructed rt_private object. This can be a source of
subtle bugs, so it is better to code appropriately, rather than
relying on an assumption that noone would go peaking before this
function returns.
In C, all pointers are implicitly castable to/from void*. This is
not the case in C++. (which suggests to me that George learnt C++
before C, or is at least more familiar with C++?)
The act of using type punning means that you are trying to do
something which the C type system doesn't like. This in turn
requires more thought from people reading the code to work out
whether it is actually safe or not. As a result, we strive for as
few type overrides as possible.
Please don't fall into the trap of assuming the credit2 code, or
indeed any of the other code in Xen, is perfect. None of it is,
although most of it is good.
unsigned i = 0;
list_for_each( iter, &sdom->vcpu )
{
ÂÂÂ xen_domctl_sched_rt_params_t local_sched;
ÂÂÂ if ( i >= op->u.rt.nr_vcpus )
ÂÂÂÂÂÂÂ break;
ÂÂÂ /* Fill local_sched */
ÂÂÂ if ( copy_to_guest_offset(op->u.rt.vcpu, i, &local_sched,
1) )
ÂÂÂ {
ÂÂÂ Â Â ret = -EFAULT;
ÂÂÂÂ ÂÂ break;
ÂÂÂ }
}
Reusing the rt.c infrastructure is fine, but something other than DS
will necessarily be a different scheduler as far as the tools are
concerned. The user should expect to have to change their
parameters if they want to use a new scheduler. The other point of
view is that the user should expect their scheduler not to change
under their feet if they continue using the same parameters as
before.
If you make its size a multiple of 8, then Xen doesn't need a compat
shim for converting hypercalls from 32bit guests.
~Andrew
|
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|