From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 1/1 v2] KVM: Reduce mmu_lock contention during dirty logging by cond_resched() Date: Sun, 29 Apr 2012 18:20:37 +0300 Message-ID: <4F9D5C45.3070801@redhat.com> References: <20120428190544.7dc2bfd281054c1fcac5a14e@gmail.com> <20120428190754.5c27325da5663e5d8c9b9be1@gmail.com> <4F9D25A2.7020303@redhat.com> <20120429211759.0265df80d7193048344ff35b@gmail.com> <4F9D3B26.7090602@redhat.com> <20120429232407.684da454a0862f121754a126@gmail.com> <4F9D52A7.8020105@redhat.com> <20120429235550.856ff62eff954caf9ea739b5@gmail.com> <4F9D5773.4090505@redhat.com> <20120430001330.00ae231245771e482ec9977a@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: mtosatti@redhat.com, kvm@vger.kernel.org, yoshikawa.takuya@oss.ntt.co.jp To: Takuya Yoshikawa Return-path: Received: from mx1.redhat.com ([209.132.183.28]:21609 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752867Ab2D2PUm (ORCPT ); Sun, 29 Apr 2012 11:20:42 -0400 In-Reply-To: <20120430001330.00ae231245771e482ec9977a@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On 04/29/2012 06:13 PM, Takuya Yoshikawa wrote: > On Sun, 29 Apr 2012 18:00:03 +0300 > Avi Kivity wrote: > > > > After your work, 8192 in my patch may better be lowered a bit. > > > > > > > Why not remove it altogether? Just change it to cond_resched_lock(). > > Two concerns: > > - too many checks may slow down GET_DIRTY_LOG. Yes. My expectation is that it's okay. If there is no contention, then the lock cache line will be local, and the check is cheap. If there is contention, then we need to drop it. > - cond_resched_lock() uses spin_needbreak(), and I am not sure if > this still does rescheduling for alleviating mmu_lock contention > without CONFIG_PREEMPT. IMO that's a feature. If kernel policy is not to lockbreak when !CONFIG_PREEMPT, then we should follow it, whether it's the right thing or not. If it's the wrong thing, change it in the kernel proper. > I need to read the code a bit more. > while (1) need_to_read_the_code_a_bit_more(); unfortunately. I keep finding new things in there, including stuff I wrote myself. -- error compiling committee.c: too many arguments to function