From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3rdrXj2zQvzDqFD for ; Tue, 28 Jun 2016 13:15:33 +1000 (AEST) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u5S3EIQO015273 for ; Mon, 27 Jun 2016 23:15:30 -0400 Received: from e23smtp08.au.ibm.com (e23smtp08.au.ibm.com [202.81.31.141]) by mx0b-001b2d01.pphosted.com with ESMTP id 23sp50myhw-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 27 Jun 2016 23:15:30 -0400 Received: from localhost by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 28 Jun 2016 13:15:27 +1000 Received: from d23relay06.au.ibm.com (d23relay06.au.ibm.com [9.185.63.219]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id 496652BB0055 for ; Tue, 28 Jun 2016 13:15:24 +1000 (EST) Received: from d23av05.au.ibm.com (d23av05.au.ibm.com [9.190.234.119]) by d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u5S3FO8O12845382 for ; Tue, 28 Jun 2016 13:15:24 +1000 Received: from d23av05.au.ibm.com (localhost [127.0.0.1]) by d23av05.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u5S3FMlk019650 for ; Tue, 28 Jun 2016 13:15:24 +1000 Date: Tue, 28 Jun 2016 11:14:56 +0800 From: xinhui MIME-Version: 1.0 To: Peter Zijlstra CC: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, paulmck@linux.vnet.ibm.com, mingo@redhat.com, mpe@ellerman.id.au, paulus@samba.org, benh@kernel.crashing.org, Waiman.Long@hpe.com, boqun.feng@gmail.com, will.deacon@arm.com, dave@stgolabs.net Subject: Re: [PATCH 1/3] kernel/sched: introduce vcpu preempted check interface References: <1467049290-32359-1-git-send-email-xinhui.pan@linux.vnet.ibm.com> <1467049290-32359-2-git-send-email-xinhui.pan@linux.vnet.ibm.com> <20160627140043.GO30921@twins.programming.kicks-ass.net> <20160627140255.GB30927@twins.programming.kicks-ass.net> In-Reply-To: <20160627140255.GB30927@twins.programming.kicks-ass.net> Content-Type: text/plain; charset=UTF-8; format=flowed Message-Id: <5771EBB0.8080209@linux.vnet.ibm.com> List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 2016年06月27日 22:02, Peter Zijlstra wrote: > On Mon, Jun 27, 2016 at 04:00:43PM +0200, Peter Zijlstra wrote: >> On Mon, Jun 27, 2016 at 01:41:28PM -0400, Pan Xinhui wrote: >>> +++ b/include/linux/sched.h >>> @@ -3293,6 +3293,15 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu) >>> >>> #endif /* CONFIG_SMP */ >>> >>> +#ifdef arch_vcpu_is_preempted >>> +static inline bool vcpu_is_preempted(int cpu) >>> +{ >>> + return arch_vcpu_is_preempted(cpu); >>> +} >>> +#else >>> +#define vcpu_is_preempted(cpu) false >>> +#endif >> >> #ifndef vcpu_is_preempted >> #define vcpu_is_preempted(cpu) (false) >> #endif >> >> Is so much simpler... >> fair enough. >> Also, please Cc the virt list so that other interested parties can >> comment, and maybe also the s390 folks. > oh. I forgot that. maybe we need cc more. root@ltcalpine2-lp13:~/linux# find ./arch -name kvm ./arch/arm/kvm ./arch/arm64/kvm ./arch/mips/kvm ./arch/powerpc/kvm ./arch/s390/kvm ./arch/tile/kvm ./arch/x86/kvm > And before you hurry off to post again, add a patch doing > mutex_spin_on_owner() and rwsem_spin_in_owner(). > will do that. thanks for your suggestion. :)