From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752418AbcF1Jrn (ORCPT ); Tue, 28 Jun 2016 05:47:43 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:42666 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752261AbcF1Jrl (ORCPT ); Tue, 28 Jun 2016 05:47:41 -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 17:47:07 +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: Heiko Carstens , 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, Martin Schwidefsky , Christian Borntraeger 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> <20160628070013.GC3784@osiris> In-Reply-To: <20160628070013.GC3784@osiris> 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: 16062809-0052-0000-0000-000001A7F505 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16062809-0053-0000-0000-0000064617FF Message-Id: <5772479B.9000600@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-06-28_07:,, 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-1606280090 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016年06月28日 15:00, Heiko Carstens 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... >> >> Also, please Cc the virt list so that other interested parties can >> comment, and maybe also the s390 folks. > > The s390 implementation would be to simply use cpu_is_preempted() from > arch/s390/lib/spinlock.c. that's great. > It's nice that there will be a common code function for this! >