From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751986AbcF0OBK (ORCPT ); Mon, 27 Jun 2016 10:01:10 -0400 Received: from merlin.infradead.org ([205.233.59.134]:53280 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751878AbcF0OBJ (ORCPT ); Mon, 27 Jun 2016 10:01:09 -0400 Date: Mon, 27 Jun 2016 16:00:43 +0200 From: Peter Zijlstra To: Pan Xinhui 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 Message-ID: <20160627140043.GO30921@twins.programming.kicks-ass.net> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1467049290-32359-2-git-send-email-xinhui.pan@linux.vnet.ibm.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.