From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9CFC5C433F5 for ; Mon, 22 Nov 2021 16:45:08 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4HyY6C1DDzz3cCw for ; Tue, 23 Nov 2021 03:45:07 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=arm.com (client-ip=217.140.110.172; helo=foss.arm.com; envelope-from=valentin.schneider@arm.com; receiver=) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lists.ozlabs.org (Postfix) with ESMTP id 4HyY5l1RXWz2yn9 for ; Tue, 23 Nov 2021 03:44:42 +1100 (AEDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8491EED1; Mon, 22 Nov 2021 08:44:40 -0800 (PST) Received: from e113632-lin (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 85E503F66F; Mon, 22 Nov 2021 08:44:38 -0800 (PST) From: Valentin Schneider To: Christophe Leroy , linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linuxppc-dev@lists.ozlabs.org, linux-kbuild@vger.kernel.org Subject: Re: [PATCH v2 3/5] powerpc: Use preemption model accessors In-Reply-To: <431fb6da-fe21-c5a6-bfb3-4e26bdc153b4@csgroup.eu> References: <20211110202448.4054153-1-valentin.schneider@arm.com> <20211110202448.4054153-4-valentin.schneider@arm.com> <431fb6da-fe21-c5a6-bfb3-4e26bdc153b4@csgroup.eu> Date: Mon, 22 Nov 2021 16:44:36 +0000 Message-ID: <87v90kcf7v.mognet@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marco Elver , Michal Marek , Peter Zijlstra , Frederic Weisbecker , Mike Galbraith , Nick Desaulniers , Steven Rostedt , Ingo Molnar , Paul Mackerras , Masahiro Yamada , Dmitry Vyukov Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 16/11/21 14:41, Christophe Leroy wrote: > Le 10/11/2021 =C3=A0 21:24, Valentin Schneider a =C3=A9crit=C2=A0: >> Per PREEMPT_DYNAMIC, checking CONFIG_PREEMPT doesn't tell you the actual >> preemption model of the live kernel. Use the newly-introduced accessors >> instead. > > Is that change worth it for now ? As far as I can see powerpc doesn't > have DYNAMIC PREEMPT, a lot of work needs to be done before being able > to use it: > - Implement GENERIC_ENTRY > - Implement STATIC_CALLS (already done on PPC32, to be done on PPC64) > You're right, I ditched this patch for v3 - AFAICT the change wasn't even valid as the preempt_schedule_irq() call needs to be replaced with irqentry_exit_cond_resched() (IOW this needs to make use of the generic entry code). >> >> sched_init() -> preempt_dynamic_init() happens way before IRQs are set u= p, >> so this should be fine. > > It looks like you are mixing up interrupts and IRQs (also known as > "external interrupts"). > > ISI (Instruction Storage Interrupt) and DSI (Data Storage Interrupt) for > instance are also interrupts. They happen everytime there is a page > fault so may happen pretty early. > > Traps generated by WARN_ON() are also interrupts that may happen at any > time. > Michael pointed this out and indeed triggering a WARN_ON() there is not super smart. Thanks for teaching me a bit of what I'm putting my grubby hands in :)