xen: sched: removal of redundant check in Credit
PATCH v2 1/1 xen: sched: removal of redundant check in Credit
The patch gets rid of a redundant check in csched_vcpu_acct. In fact, the function is only called from csched_tick, which already checks that current is not the idle vcpu. The patch also adds an ASSERT to the same effect, in order to make assumption ( i.e., no calling this on idle vcpus) even more clear and as a guard for future mis-use.
---
Changed since v1:
* Changelog updated as per the comment.
v2:
xen/common/sched_credit.c +0 -0
@@ -941,6 +941,7 @@ csched_vcpu_acct(struct csched_private *prv,
unsigned int cpu)
ASSERT( current->processor == cpu );
ASSERT( svc->sdom != NULL );
+ ASSERT( !is_idle_vcpu(svc->vcpu) );
/*
* If this VCPU's priority was boosted when it last awoke, reset it.
@@ -957,8 +958,7 @@ csched_vcpu_acct(struct csched_private *prv, unsigned int cpu)
/*
* Update credits
*/
- if ( !is_idle_vcpu(svc->vcpu) )
- burn_credits(svc, NOW());
+ burn_credits(svc, NOW());
/*
* Put this VCPU and domain back on the active list if it was
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 8 lines · Praveen Kumar
The patch gets rid of a redundant check in
csched_vcpu_acct. In fact, the function is only called fromcsched_tick, which already checks that current is not the idle vcpu. The patch also adds an ASSERT to the same effect, in order to make assumption ( i.e., no calling this on idle vcpus) even more clear and as a guard for future mis-use.Signed-off-by Praveen Kumar <[email protected]>
This is all good and can have my:
_HOWEVER_ when I tried to apply the patch directly from this email I get this:
(Stripping trailing CRs from patch; use --binary to disable.) checking file xen/common/sched_credit.c
patch: **** malformed patch at line 6: unsigned int cpu)
Which I think means that the patch has been corrupted, most likely by the email program.
This is a common issue, and although it is possible to paste patches in an email client and teach it not to mangle them, I would say:
1) it's a very boring thing to do, it does not scale, it's not practical when sending patch series and it's not reliable;
2) I've only done a couple of times at the beginning of my OS contribution history, and would not be able to help on how to make that happen.
For this reason, I encourage you to look at and learn alternative ways of submitting patches, like git-send-email. Personally, I use StGit for development, and it has its own sending patches machinery too.
I think you should send a v3, by using one of these methods (or, in general, not in a mangled state). When doing that (and if you don't change anything), you can stick my 'Acked-by:' tag right below your own 'Signed-off-by:'
Thanks and Regards,
Dario
Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel