From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755445AbbESHXS (ORCPT ); Tue, 19 May 2015 03:23:18 -0400 Received: from terminus.zytor.com ([198.137.202.10]:60512 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755427AbbESHXO (ORCPT ); Tue, 19 May 2015 03:23:14 -0400 Date: Tue, 19 May 2015 00:22:40 -0700 From: tip-bot for David Hildenbrand Message-ID: Cc: tglx@linutronix.de, peterz@infradead.org, hpa@zytor.com, mingo@kernel.org, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, dahi@linux.vnet.ibm.com Reply-To: hpa@zytor.com, mingo@kernel.org, linux-kernel@vger.kernel.org, dahi@linux.vnet.ibm.com, torvalds@linux-foundation.org, peterz@infradead.org, tglx@linutronix.de In-Reply-To: <1431359540-32227-16-git-send-email-dahi@linux.vnet.ibm.com> References: <1431359540-32227-16-git-send-email-dahi@linux.vnet.ibm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] sched/preempt, mm/fault: Decouple preemption from the page fault logic Git-Commit-ID: 8222dbe21e79338de92d5e1956cd1e3994cc9f93 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 8222dbe21e79338de92d5e1956cd1e3994cc9f93 Gitweb: http://git.kernel.org/tip/8222dbe21e79338de92d5e1956cd1e3994cc9f93 Author: David Hildenbrand AuthorDate: Mon, 11 May 2015 17:52:20 +0200 Committer: Ingo Molnar CommitDate: Tue, 19 May 2015 08:39:18 +0200 sched/preempt, mm/fault: Decouple preemption from the page fault logic As the fault handlers now all rely on the pagefault_disabled() checks and implicit preempt_disable() calls by pagefault_disable() have been made explicit, we can completely rely on the pagefault_disableD counter. So let's no longer touch the preempt count when disabling/enabling pagefaults. After a call to pagefault_disable(), pagefault_disabled() will return true, but in_atomic() won't. Reviewed-and-tested-by: Thomas Gleixner Signed-off-by: David Hildenbrand Signed-off-by: Peter Zijlstra (Intel) Cc: David.Laight@ACULAB.COM Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: airlied@linux.ie Cc: akpm@linux-foundation.org Cc: benh@kernel.crashing.org Cc: bigeasy@linutronix.de Cc: borntraeger@de.ibm.com Cc: daniel.vetter@intel.com Cc: heiko.carstens@de.ibm.com Cc: herbert@gondor.apana.org.au Cc: hocko@suse.cz Cc: hughd@google.com Cc: mst@redhat.com Cc: paulus@samba.org Cc: ralf@linux-mips.org Cc: schwidefsky@de.ibm.com Cc: yang.shi@windriver.com Link: http://lkml.kernel.org/r/1431359540-32227-16-git-send-email-dahi@linux.vnet.ibm.com Signed-off-by: Ingo Molnar --- include/linux/uaccess.h | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h index 90786d2..ae572c1 100644 --- a/include/linux/uaccess.h +++ b/include/linux/uaccess.h @@ -1,7 +1,6 @@ #ifndef __LINUX_UACCESS_H__ #define __LINUX_UACCESS_H__ -#include #include #include @@ -20,17 +19,11 @@ static __always_inline void pagefault_disabled_dec(void) * These routines enable/disable the pagefault handler. If disabled, it will * not take any locks and go straight to the fixup table. * - * We increase the preempt and the pagefault count, to be able to distinguish - * whether we run in simple atomic context or in a real pagefault_disable() - * context. - * - * For now, after pagefault_disabled() has been called, we run in atomic - * context. User access methods will not sleep. - * + * User access methods will not sleep when called from a pagefault_disabled() + * environment. */ static inline void pagefault_disable(void) { - preempt_count_inc(); pagefault_disabled_inc(); /* * make sure to have issued the store before a pagefault @@ -47,11 +40,6 @@ static inline void pagefault_enable(void) */ barrier(); pagefault_disabled_dec(); -#ifndef CONFIG_PREEMPT - preempt_count_dec(); -#else - preempt_enable(); -#endif } /*