From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753306AbdEPNOT (ORCPT ); Tue, 16 May 2017 09:14:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:40510 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750970AbdEPNOO (ORCPT ); Tue, 16 May 2017 09:14:14 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 93010239BA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Tue, 16 May 2017 09:14:12 -0400 From: Steven Rostedt To: Thomas Gleixner Cc: Peter Zijlstra , LKML , Ingo Molnar , Mark Rutland Subject: Re: [patch 17/18] sched: Enable might_sleep() checks early Message-ID: <20170516091412.77987500@gandalf.local.home> In-Reply-To: References: <20170514182716.347236777@linutronix.de> <20170514183613.836520655@linutronix.de> <20170515111008.1215e489@gandalf.local.home> <20170516071442.h3hapwksk2fwgqkb@hirez.programming.kicks-ass.net> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 16 May 2017 09:33:52 +0200 (CEST) Thomas Gleixner wrote: > Darn, forgot about PREEMPT_VOLUNTARY and that excellent changelog does not > mention it either. > > > So if we schedule to the kernel_init() task before we set kthreadd_task > > we'll try and spawn kthreads and OOPS. > > So back to Stevens question. No, we can't set the state earlier than right > before schedule() simply because with PREEMPT preemption _is_ actually > disabled and kernel_kthread() will trigger might_sleep() splats. So a comment in the code mentioning PREEMPT_VOLUNTARY might be advantageous. > > What a mess. Indeed. -- Steve