Am Donnerstag, 15. November 2007 schrieb Laurent Vivier: > To be annoying, it should be clearer to write this like: > > if ( (p->flags & PF_VCPU) && > !(hardirq_count() - hardirq_offset) && > !softirq_count() ) > { > account_guest_time(p, cputime); > return; > } [...] > But I agree with your patch. > > Laurent
Yes, that would have the same result. I think its a matter of taste, if we want to have a not-so-obvious one line if, or a multi-line-if. I dont mind which version use, here is your variant as an alternative: Ingo, you decide :-) From: Christian Borntraeger <[EMAIL PROTECTED]> From: Laurent Vivier <[EMAIL PROTECTED]> Signed-off-by: Christian Borntraeger <[EMAIL PROTECTED]> --- kernel/sched.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Index: kvm/kernel/sched.c =================================================================== --- kvm.orig/kernel/sched.c +++ kvm/kernel/sched.c @@ -3395,7 +3395,9 @@ void account_system_time(struct task_str struct rq *rq = this_rq(); cputime64_t tmp; - if (p->flags & PF_VCPU) { + if ( (p->flags & PF_VCPU) && + !(hardirq_count() - hardirq_offset) && + !softirq_count() ) { account_guest_time(p, cputime); return; } ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel