Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp2199469pxu; Fri, 9 Oct 2020 10:15:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCUFHMFZqtqQ/wqpkWuG+ja5t+W/MzoO4dV5azwD21HQHdseY2pPEKYvmJDTVTohxWwp50 X-Received: by 2002:aa7:d61a:: with SMTP id c26mr147586edr.303.1602263750193; Fri, 09 Oct 2020 10:15:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602263750; cv=none; d=google.com; s=arc-20160816; b=GuFAwNlcyRgQfrt1tIwIBoHAmFl7UpfHgMWfulPbuGgWOWxiC5QLW4BoETGTU8Rq9J q2Rft0/ZCJC1wWstxEPq93CJxWlmev9mT6fSZiKn7kvl8NbxxymqP9jGDXyOWFkqPZsw rzG95og2rGKGLGfY9TBGtMZBpjKTsJqa42Ohh73aiha7TJphtQ8WBVDFHEL2pi1M0LOc RXpPmkrjgZ0QRt7VE+lHdn72/PKvxeKaqGOadVCdfH7bVaO0qT5d92xEEFDCLo5Ko5VJ b5KrUtsum5Nzh6YluEqLVr2FbfuFCDERtAub8BwTzOSNo+HvB7RnEre8/gfMCqi2OUrV 8l0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=eTSyiUWZ5oQl1uBbbkMfxU9sRHDp/kmy09nBobKLqcY=; b=KBI/cc4tBaH3TUIwKI3rGRXas60wRAafOjfVlMkDQArCuUqaVJxprPmXjUnCfADeEV ZnVXASuqisqGq5qDimEvJSzZMylrlVfw8N/GhxD18yem3TzcePsx2rs91tJ+RLnSxHX9 jykL/vn8iiKgt/DVsrD7M+Asx8jnfOZAM40Nu6U0G0gAi3i+jgZiUMDO/5Zo2r5kNlRc YDWypcWFzXEQw/G8O440+pTXRIGqJcZKgXiVU221LLMau8vQeyXWI+4YX0kETcDRcN3K dMWbbrlcB3/0sXevY9rnc/WtpW7g/sVD80zyaLSJFZIdrlm52Hhf/u/oiRPcVhKleUrK AVIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=RHb4Se19; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i23si6743042edg.229.2020.10.09.10.15.26; Fri, 09 Oct 2020 10:15:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=RHb4Se19; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387581AbgJIKUQ (ORCPT + 99 others); Fri, 9 Oct 2020 06:20:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726357AbgJIKUP (ORCPT ); Fri, 9 Oct 2020 06:20:15 -0400 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6773FC0613D2 for ; Fri, 9 Oct 2020 03:20:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=eTSyiUWZ5oQl1uBbbkMfxU9sRHDp/kmy09nBobKLqcY=; b=RHb4Se19Z5mOyl7JH5QcXPosVV KzRAsOGK1VdWHXSe8q5SSf6VzO+bOSf07HQsVXFQWSRZXyYOhFDbHy27aIGIiaZTCSb6k4VZVxZ/3 9zOywjuxd7o7kdh2ieGONwQk1Mrp64UybafsuFnULBvXtETlraSuSAFfFRMGfRo0ebgFsl24mhFGH uenYiZAEn3hQ5Q5o+5MsglX8/wahyafibXzRrXxegtrGl4vj6AcxXEC4FNTfwr4ftQw6WXM/0Zl2L qtctdUPYUt+CAY9tXP9TTnbnexMPfwxjOCqMDQGCLolF7/HKM2z0+fOI0Qpye9fPD9kCmNESZKUO3 gJqUXsUA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQpVS-00015M-RB; Fri, 09 Oct 2020 10:20:10 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 7E575300B22; Fri, 9 Oct 2020 12:20:09 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 6CB9229AE66E9; Fri, 9 Oct 2020 12:20:09 +0200 (CEST) Date: Fri, 9 Oct 2020 12:20:09 +0200 From: Peter Zijlstra To: Michal Hocko Cc: Thomas Gleixner , Frederic Weisbecker , LKML , Mel Gorman , Ingo Molnar Subject: Re: [RFC PATCH] kernel: allow to configure PREEMPT_NONE, PREEMPT_VOLUNTARY on kernel command line Message-ID: <20201009102009.GK2628@hirez.programming.kicks-ass.net> References: <20201007120401.11200-1-mhocko@kernel.org> <20201007122144.GF2628@hirez.programming.kicks-ass.net> <20201007123553.GK29020@dhcp22.suse.cz> <20201009094741.GH2628@hirez.programming.kicks-ass.net> <20201009101405.GI4967@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201009101405.GI4967@dhcp22.suse.cz> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 09, 2020 at 12:14:05PM +0200, Michal Hocko wrote: > On Fri 09-10-20 11:47:41, Peter Zijlstra wrote: > > That is, work backwards (from PREEMPT back to VOLUNTARY) instead of the > > other way around. > > My original idea was that the config would only define the default > preemption mode. preempt_none parameter would then just act as an > override. That would mean that CONFIG_PREEMPTION would be effectively > gone from the kernel. The reason being that any code outside of the > scheduler shouldn't really care about the preemption mode. I suspect > this will prevent from dubious hacks and provide a more robust code in > the end. Sure; but the way of arriving at that destination might be easier if you work backwards from PREEMPT=y, because while there _should_ not be dependencies outside of the scheduler, we both know there are. This also makes your patches independent of the series that makes CONFIG_PREEMPTION unconditional. It also gives Kconfig space to limit the dynamic thing to archs that have sufficient support (we'll be relying on static_call/static_branch, and not everybody has that implemented in a way that makes it the dynamic change worth-while).