From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751968AbbEGRcd (ORCPT ); Thu, 7 May 2015 13:32:33 -0400 Received: from cdptpa-outbound-snat.email.rr.com ([107.14.166.229]:2637 "EHLO cdptpa-oedge-vip.email.rr.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751945AbbEGRcc (ORCPT ); Thu, 7 May 2015 13:32:32 -0400 Date: Thu, 7 May 2015 13:32:28 -0400 From: Steven Rostedt To: Konstantin Khlebnikov Cc: kpreempt-tech@lists.sourceforge.net, Peter Zijlstra , Robert Love , x86@kernel.org, linux-kernel@vger.kernel.org, Ingo Molnar Subject: Re: [PATCH] sched/preempt: fix cond_resched_lock() and cond_resched_softirq() Message-ID: <20150507173228.GA28383@home.goodmis.org> References: <20150507170647.14403.30477.stgit@buzz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150507170647.14403.30477.stgit@buzz> User-Agent: Mutt/1.5.23 (2014-03-12) X-RR-Connecting-IP: 107.14.168.130:25 X-Cloudmark-Score: 0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 07, 2015 at 08:06:47PM +0300, Konstantin Khlebnikov wrote: > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index fe22f7510bce..087bf36ecd46 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -4223,7 +4223,7 @@ SYSCALL_DEFINE0(sched_yield) > > int __sched _cond_resched(void) > { > - if (should_resched()) { > + if (should_resched(0)) { > preempt_schedule_common(); > return 1; > } > @@ -4241,7 +4241,7 @@ EXPORT_SYMBOL(_cond_resched); > */ > int __cond_resched_lock(spinlock_t *lock) > { > - int resched = should_resched(); > + int resched = should_resched(PREEMPT_LOCK_OFFSET); Hmm, yeah, the current code would have should_resched() always return false. > int ret = 0; > > lockdep_assert_held(lock); > @@ -4263,7 +4263,7 @@ int __sched __cond_resched_softirq(void) > { > BUG_ON(!in_softirq()); > > - if (should_resched()) { > + if (should_resched(SOFTIRQ_DISABLE_OFFSET)) { Here too. -- Steve > local_bh_enable(); > preempt_schedule_common(); > local_bh_disable(); > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/