From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] Code clean up for percpu_xxx() functions Date: Wed, 19 Oct 2011 11:26:42 +0200 Message-ID: <4E9E97D2.1040807@redhat.com> References: <1318237851.27949.190.camel@debian> <1318324774.27949.693.camel@debian> <1318382964.27949.782.camel@debian> <1318428673.29699.13.camel@debian> <1318908091.23426.52.camel@debian> <1319016218.23426.104.camel@debian> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Christoph Lameter , "tj@kernel.org" , "linux-kernel@vger.kernel.org" , "eric.dumazet@gmail.com" , "Huang, Ying" , tglx@linutronix.de, mingo@redhat.com, "akpm@linux-foundation.org" , davem@davemloft.net, kaber@trash.net, a.p.zijlstra@chello.nl, kvm@vger.kernel.org, jeremy@xensource.com To: "Alex,Shi" Return-path: In-Reply-To: <1319016218.23426.104.camel@debian> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 10/19/2011 11:23 AM, Alex,Shi wrote: > > Well do the obvious (where you can see that interrupts or preemption are > > disabled in the function or in a calling function). Leave the rest as is > > and provide separate patches for them? > > Thanks for comments! I initialized the patch as following accordingly, > And cc to more maintainers for review. I checked all code except xen/kvm > part, totally a idiot for them. > > > > ========== > > Since percpu_xxx() serial functions are duplicate with this_cpu_xxx(). > Removing percpu_xxx() definition and replacing them by this_cpu_xxx() in > code. > > And further more, as Christoph Lameter's requirement, I try to use > __this_cpu_xx to replace this_cpu_xxx if it is in preempt safe scenario. > The preempt safe scenarios include: > 1, in irq/softirq/nmi handler > 2, protected by preempt_disable > 3, protected by spin_lock > 4, if the code context imply that it is preempt safe, like the code is > follows or be followed a preempt safe code. > > I left the xen/kvm part code unchanged, since no any idea of them. > > All of the kvm usage is in preemption disabled contexts. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.