Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752592AbbEGGX7 (ORCPT ); Thu, 7 May 2015 02:23:59 -0400 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:44914 "EHLO e06smtp16.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752570AbbEGGXy (ORCPT ); Thu, 7 May 2015 02:23:54 -0400 Date: Thu, 7 May 2015 08:23:46 +0200 From: David Hildenbrand To: Andrew Morton Cc: linux-kernel@vger.kernel.org, mingo@redhat.com, peterz@infradead.org, yang.shi@windriver.com, bigeasy@linutronix.de, benh@kernel.crashing.org, paulus@samba.org, heiko.carstens@de.ibm.com, schwidefsky@de.ibm.com, borntraeger@de.ibm.com, mst@redhat.com, tglx@linutronix.de, David.Laight@ACULAB.COM, hughd@google.com, hocko@suse.cz, ralf@linux-mips.org, herbert@gondor.apana.org.au, linux@arm.linux.org.uk, airlied@linux.ie, daniel.vetter@intel.com, linux-mm@kvack.org, linux-arch@vger.kernel.org Subject: Re: [PATCH RFC 00/15] decouple pagefault_disable() from preempt_disable() Message-ID: <20150507082346.3e8e045e@thinkpad-w530> In-Reply-To: <20150506150158.0a927470007e8ea5f3278956@linux-foundation.org> References: <1430934639-2131-1-git-send-email-dahi@linux.vnet.ibm.com> <20150506150158.0a927470007e8ea5f3278956@linux-foundation.org> Organization: IBM Deutschland GmbH X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.27; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15050706-0025-0000-0000-000005068100 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1153 Lines: 35 > > This series therefore does 2 things: > > > > > > 1. Decouple pagefault_disable() from preempt_enable() > > > > ... > > > > 2. Reenable might_sleep() checks for might_fault() > > All seems sensible to me. pagefault_disabled has to go into the > task_struct (rather than being per-cpu) because > pagefault_disabled_inc() doesn't disable preemption, yes? > Right, we can now get scheduled while in pagefault_disable() (if preemption hasn't been disabled manually). So we have to store it per task/thread not per cpu. Actually even the preempt disable counter is only per-cpu for x86 and lives in thread_info for all other archs (which is also not 100% clean but doesn't matter at that point). I had that pagefault disable counter in thread_info before, but that required messing with asm-offsets of some arch (I had a proper version but this one feels cleaner). Thanks for having a look! David -- 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/