From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751980AbcF1DPd (ORCPT ); Mon, 27 Jun 2016 23:15:33 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:41467 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751673AbcF1DPc (ORCPT ); Mon, 27 Jun 2016 23:15:32 -0400 X-IBM-Helo: d23dlp03.au.ibm.com X-IBM-MailFrom: xinhui.pan@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org Date: Tue, 28 Jun 2016 11:14:56 +0800 From: xinhui User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 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 Content-Transfer-Encoding: 8bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16062803-0004-0000-0000-00000173AAFB X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16062803-0005-0000-0000-00000829B5DD Message-Id: <5771EBB0.8080209@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-06-28_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1606280029 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. :)