|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 1/4] xen: credit2: implement utilization cap
On 12/06/2017 14:19, Dario Faggioli wrote: Hey, "domain have credit" ? the statement is if the "vcpus of domain have credit".Budget is burned by the domain's vCPUs, in a similar way to how credits are. When a domain runs out of budget, its vCPUs can't run any longer.if the vcpus of a domain have credit and if budget has run out, will the vcpus won't be scheduled.Is this a question? Assuming it is, what do you mean with "domain have credit"? Domains always have credits, and they never run out of them. There's no such thing as a domain not being runnable because it does not have credits. About budget, a domain with <= 0 budget means all its vcpus are not runnable, and hence won't be scheduler, no matter their credits. You answered the question here. what I want to ask is that if the budget of the domain is replenished, but credit for the vcpus of that domain is not available, then what happens. I believe, vcpus won't be scheduled (even if they have budget_quota) till they get their credit replenished. why you can't be sure. Scheduler know the domain budget, number of vcpus per domain and we can calculate the budget_quota and translate it into cpu slot duration. Similarly , the value of rate limit is also known. We can compare and give a warning to the user if the budget_quota is less than rate limit.budget is finished but not vcpu has not reached the rate limit boundary ?Budget takes precedence over ratelimiting. This is important to keep cap working "regularly", rather then in some kind of permanent "trying- to-keep-up-with-overruns-in-previous-periods" state. And, ideally, a vcpu cap and ratelimiting should be set in such a way that they don't step on each other toe (or do that only rarely). I can see about trying to print a warning when I detect potential tricky values (but it's not easy, considering budget is per-domain, so I can't be sure about how much each vcpu will actually get, and whether or not This is very important for the user to know, if wrongly chosen, it can adversely affect the system's performance with frequent context switches. (the problem we are aware of). that will reveal to be significantly less than ratelimiting the most of the times).+ * - when a budget replenishment occurs, if there are vCPUs that had been + * blocked because of lack of budget, they'll be unblocked, and they will + * (potentially) be able to run again. + * + * Finally, some even more implementation related detail: + * + * - budget is stored in a domain-wide pool. vCPUs of the domain that want + * to run go to such pool, and grub some. When they do so, the amount + * they grabbed is _immediately_ removed from the pool. This happens in + * vcpu_try_to_get_budget(); + * + * - when vCPUs stop running, if they've not consumed all the budget they + * took, the leftover is put back in the pool. This happens in + * vcpu_give_budget_back();200% budget, 4 vcpus to run on 4 pcpus each allowed only 50% of budget. This is a static allocation .Err... again, are you telling or asking? giving an example to prove its a static allocation. for eg. 2 vcpus running on 2 pvpus at 20% budgeted time, if vcpu3 wants to execute some cpu intensive task, then it won't be allowed to allowed to use more than 50% of the pcpus.With what parameters? You mean with these ones you cite here (i.e., a 200% budget)? If the VM has 200%, and vcpu1 and vcpu2 consumes 20%+20%=40%, there's 160% free for vcpu3 and vcpu4.I checked the implenation below and I believe we can allow for these type of dynamic budget_quota allocation per vcpu. Not for initial version, but certainly we can consider it for future versions.But... it's already totally dynamic.
csched2_dom_cntl()
{
svc->budget_quota = max(sdom->tot_budget / sdom->nr_vcpus,
CSCHED2_MIN_TIMER);
}
If domain->tot_budge = 200
nr_cpus is 4, then each cpu gets 50%.
How this is dynamic allocation ? We are not considering vcpu utilization
of other vcpus of domain before allocating budget_quota for some vcpu.
Let me know if my understanding is wrong. Just shared a thought as I experienced the confusion while I was reading the code for the first time. If you don't agree, its fine.
From what I understand, I considered it to be a very likely event. It's not a super big deal, though, and I can get rid of it, if people don't like/are not convinced about it. :-) yes, its fine, we can leave it for now.
Yeah, got it in third patch. :) Yes, got your point, but then the call for vcpu_try_to_get_budet should move to the code block in runq_candidate that return scurr other wise the condition looks incomplete and makes the logic ambiguous. We call runq_candidate to find the next runnable candidate. If we want to return scurr as the current runnable candidate then it should have gone through all the checks including budget_quota and all these checks should be at one place. Thanks and Regards, Dario Anshul _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |