Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7215777ybp; Wed, 16 Oct 2019 05:37:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqwWaRKFprLIpuHbQmVSHvJibRjIb5ndpIu32latFa+5aSbzk59ZUOdDrX03O6kHw3PfqOsE X-Received: by 2002:a17:906:1f44:: with SMTP id d4mr38930927ejk.16.1571229438153; Wed, 16 Oct 2019 05:37:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571229438; cv=none; d=google.com; s=arc-20160816; b=1Bw8Gmq4GbSQFp0XVn6YkYpe7ZcWwJchtkOoU1auddjxURegszqBz1LF+Icu6Af/gE RFlkbDE1/E5sf4QuRy1acNnEmNPn4BL3ThCG+s/eXnBc9EzzJSY0ixX71mrw+Y5Fv9x8 jKK/pMe8B2EgvgDXL3V5MTKfgqGzCnXDtfZosfbyUiw07xR4hlSkpOdOOzrQEYm5w+HF IQWhKjgBjWUdbcvw/NfstnSsSQ8pT40p7+bLr0cxjhKDnmQihrFLCmyBGuEResn6lZv1 bw8azMOIgpfkiBdsamFDwFHc2LrxTI4gY11KK2Gljo8TLkNwpwE4JqnUk9RAxRXnLj9k Bnvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=n3kNLwFCyEvGgASFZG55WxdLAFgl0EbkY4vVRAX4JhA=; b=v94e9rvVt5MzOwA4j6Xf8eUuoS1O5HBoJnwxkm9toX9/cWPMmrvnogLgAR2GDnUudQ OmolZYvCPWHVNcylFR44wMMPHpYo4NefB0fKw+43TMXG7ehbW3O+AO/RztHjQtr5NNf9 AYZ62ZcZZap8WAZpS6wwU5YKUOKcZOiXVgp4WVJoLhUUeLV43FZR4vx3ynzWQTvIko6s 4ouwJfKqx5JifXwPPTvSlWeFb3lLUio4Kea3SLN5mJU70KKLWpWDYWUaP5wi/JQentgr B6v76bTFGpa4zxvVelmR7v1KrkJ5Stvsmv6FnDngZZqfJ9BsyBpVHxdb7pXdnRgWiPtE PHhA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k2si17154955ede.311.2019.10.16.05.36.54; Wed, 16 Oct 2019 05:37:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391308AbfJPHsr convert rfc822-to-8bit (ORCPT + 99 others); Wed, 16 Oct 2019 03:48:47 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:48532 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726872AbfJPHsr (ORCPT ); Wed, 16 Oct 2019 03:48:47 -0400 Received: from bigeasy by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1iKe31-0007jH-2v; Wed, 16 Oct 2019 09:48:43 +0200 Date: Wed, 16 Oct 2019 09:48:43 +0200 From: Sebastian Andrzej Siewior To: Christophe Leroy Cc: linux-kernel@vger.kernel.org, Paul Mackerras , tglx@linutronix.de, linuxppc-dev@lists.ozlabs.org, Benjamin Herrenschmidt , Michael Ellerman Subject: Re: [PATCH 03/34] powerpc: Use CONFIG_PREEMPTION Message-ID: <20191016074842.6acrlzbmgb5bx4pm@linutronix.de> References: <20191015191821.11479-1-bigeasy@linutronix.de> <20191015191821.11479-4-bigeasy@linutronix.de> <156db456-af80-1f5e-6234-2e78283569b6@c-s.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: <156db456-af80-1f5e-6234-2e78283569b6@c-s.fr> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-10-16 06:57:48 [+0200], Christophe Leroy wrote: > > > Le 15/10/2019 à 21:17, Sebastian Andrzej Siewior a écrit : > > From: Thomas Gleixner > > > > CONFIG_PREEMPTION is selected by CONFIG_PREEMPT and by CONFIG_PREEMPT_RT. > > Both PREEMPT and PREEMPT_RT require the same functionality which today > > depends on CONFIG_PREEMPT. > > > > Switch the entry code over to use CONFIG_PREEMPTION. Add PREEMPT_RT > > output in __die(). > > powerpc doesn't select ARCH_SUPPORTS_RT, so this change is useless as > CONFIG_PREEMPT_RT cannot be selected. No it is not. It makes it possible for PowerPC to select it one day and I have patches for it today. Also, if other ARCH copies code from PowerPC it will copy the correct thing (as in distinguish between the flavour PREEMPT and the functionality PREEMPTION). > > diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c > > index 82f43535e6867..23d2f20be4f2e 100644 > > --- a/arch/powerpc/kernel/traps.c > > +++ b/arch/powerpc/kernel/traps.c > > @@ -252,14 +252,19 @@ NOKPROBE_SYMBOL(oops_end); > > static int __die(const char *str, struct pt_regs *regs, long err) > > { > > + const char *pr = ""; > > + > > Please follow the same approach as already existing. Don't add a local var > for that. I would leave it to the maintainer to comment on that and decide which one they want. My eyes find it more readable and the compiles does not create more code. > > printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter); > > + if (IS_ENABLED(CONFIG_PREEMPTION)) > > + pr = IS_ENABLED(CONFIG_PREEMPT_RT) ? " PREEMPT_RT" : " PREEMPT"; > > + > > drop > > > printk("%s PAGE_SIZE=%luK%s%s%s%s%s%s%s %s\n", > > Add one %s > > > IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN) ? "LE" : "BE", > > PAGE_SIZE / 1024, > > early_radix_enabled() ? " MMU=Radix" : "", > > early_mmu_has_feature(MMU_FTR_HPTE_TABLE) ? " MMU=Hash" : "", > > - IS_ENABLED(CONFIG_PREEMPT) ? " PREEMPT" : "", > > Replace by: IS_ENABLED(CONFIG_PREEMPTION) ? " PREEMPT" : "" > > > + pr, > > add something like: IS_ENABLED(CONFIG_PREEMPT_RT) ? "_RT" : "" this on the other hand will create more code which is not strictly required. > > IS_ENABLED(CONFIG_SMP) ? " SMP" : "", > > IS_ENABLED(CONFIG_SMP) ? (" NR_CPUS=" __stringify(NR_CPUS)) : "", > > debug_pagealloc_enabled() ? " DEBUG_PAGEALLOC" : "", > > > > Christophe Sebastian