From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH 7/7] preempt: Take away preempt_enable_no_resched() from modules Date: Wed, 20 Nov 2013 20:18:41 +0100 Message-ID: <20131120191841.GY16796@laptop.programming.kicks-ass.net> References: <20131120160450.072555619@infradead.org> <20131120162736.760865926@infradead.org> <20131120105457.04f6e51e@ultegra> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from merlin.infradead.org ([205.233.59.134]:52547 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754428Ab3KTTSu (ORCPT ); Wed, 20 Nov 2013 14:18:50 -0500 Content-Disposition: inline In-Reply-To: <20131120105457.04f6e51e@ultegra> Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: Jacob Pan Cc: Arjan van de Ven , lenb@kernel.org, rjw@rjwysocki.net, Eliezer Tamir , Chris Leech , David Miller , rui.zhang@intel.com, Mike Galbraith , Ingo Molnar , hpa@zytor.com, Thomas Gleixner , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Rusty Russell On Wed, Nov 20, 2013 at 10:54:57AM -0800, Jacob Pan wrote: > run into a couple of compile issues. >=20 > 1) > include/linux/rcupdate.h: In function =E2=80=98rcu_read_unlock_sched_= notrace=E2=80=99: > include/linux/rcupdate.h:889:2: error: implicit declaration of functi= on > =E2=80=98preempt_enable_no_resched_notrace=E2=80=99 [-Werror=3Dimplic= it-function-declaration] >=20 > 2) > In file included from drivers/cpufreq/acpi-cpufreq.c:41:0: > include/linux/uaccess.h: In function =E2=80=98pagefault_enable=E2=80=99= : > include/linux/uaccess.h:34:2: error: implicit declaration of function > =E2=80=98preempt_check_resched=E2=80=99 [-Werror=3Dimplicit-function-= declaration] >=20 > 1) happens when CONFIG_PREEMPT is not set, perhaps add a dummy functi= on? > 2) I am not sure if we should take pagefault_enable away from modules I think the below will cure both -- will fold in the proper patches tomorrow, need to get away from the computer noaw. --- include/linux/preempt.h | 6 +++++- include/linux/uaccess.h | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/linux/preempt.h b/include/linux/preempt.h index a3d9dc8c2c00..41bc3fc4cdc5 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -93,7 +93,11 @@ do { \ __preempt_schedule_context(); \ } while (0) #else -#define preempt_enable_notrace() preempt_enable_no_resched_notrace() +#define preempt_enable_notrace() \ +do { \ + barrier(); \ + __preempt_count_dec(); \ +} while (0) #endif =20 #else /* !CONFIG_PREEMPT_COUNT */ diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h index 9d8cf056e661..ecd3319dac33 100644 --- a/include/linux/uaccess.h +++ b/include/linux/uaccess.h @@ -25,13 +25,16 @@ static inline void pagefault_disable(void) =20 static inline void pagefault_enable(void) { +#ifndef CONFIG_PREEMPT /* * make sure to issue those last loads/stores before enabling * the pagefault handler again. */ barrier(); preempt_count_dec(); - preempt_check_resched(); +#else + preempt_enable(); +#endif } =20 #ifndef ARCH_HAS_NOCACHE_UACCESS