Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752793Ab3EBH2M (ORCPT ); Thu, 2 May 2013 03:28:12 -0400 Received: from 173-166-109-252-newengland.hfc.comcastbusiness.net ([173.166.109.252]:39689 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750769Ab3EBH2K (ORCPT ); Thu, 2 May 2013 03:28:10 -0400 Date: Thu, 2 May 2013 09:26:24 +0200 From: Peter Zijlstra To: Julian Anastasov Cc: Simon Horman , Eric Dumazet , Ingo Molnar , "Paul E. McKenney" , lvs-devel@vger.kernel.org, netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, linux-kernel@vger.kernel.org, Pablo Neira Ayuso , Dipankar Sarma Subject: Re: [PATCH v2 1/2] sched: Add cond_resched_rcu_lock() helper Message-ID: <20130502072623.GE7521@dyad.programming.kicks-ass.net> References: <1367290378-29224-1-git-send-email-horms@verge.net.au> <1367290378-29224-2-git-send-email-horms@verge.net.au> <20130430072944.GA13959@verge.net.au> <20130501091012.GB28253@dyad.programming.kicks-ass.net> <20130501155501.GB7521@dyad.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 847 Lines: 28 On Wed, May 01, 2013 at 09:22:08PM +0300, Julian Anastasov wrote: > > +extern int __cond_resched_rcu(void); > > + > > +#define cond_resched_rcu() ({ \ > > + __might_sleep(__FILE__, __LINE__, 0); \ > > I see your goal. But digging into __might_sleep() > I see that rcu_sleep_check() will scream for the non-preempt > case because we are under rcu_read_lock. #ifdef CONFIG_PREEMPT_RCU #define PREEMPT_RCU_OFFSET 0 #else #define PREEMPT_RCU_OFFSET 1 #endif #define cond_resched_rcu() ({ \ __might_sleep(__FILE__, __LINE__, PREEMPT_RCU_OFFSET); \ __cond_resched_rcu(); \ }) Should work I think.. -- 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/