Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp5868304pxv; Wed, 7 Jul 2021 13:42:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxB/LQatxNWo0MWO2XTYhYVKR77C6d93xRVNsGaaVRPGDqfBylxF0B7cpm1/2Ego/tdBiKt X-Received: by 2002:a6b:dc08:: with SMTP id s8mr10476379ioc.7.1625690548051; Wed, 07 Jul 2021 13:42:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625690548; cv=none; d=google.com; s=arc-20160816; b=HoeON3dfEf5oVDno6j9omBI2QMkHuf37PnS2XQkTscP/MIWQ/Bly13ptxvPZBuHmFk uGLgZ1XOxMvUG7zNSIdBQI8nv/YEnRSCDvAXzUwmYlMmtAOW8CAfYtunBiSCqwjHDkuu z//gC7ePiQR3dyLP3sWHpBguflExoQQzMivt78Rg6FgBk1Kq1+ZTZEDhWt9V2KwDFPon nc2HK870aGloOR66mR8iKO5Me0hO7ef3G++SPcNdRVx+dIKQ4h0IgTqJ1lHzWt+9ek0n yBC97AztamESqYKzPmw6L4f4qlsbmNKfeE/xjfigZeR4Pu6le0MPmbfkWVGTIYJNChhk r6hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:sender:dkim-signature; bh=Y7Q51/7FLsCms66glLj41BP5mqecTdjNWpQEsIZ8maA=; b=nsu2bLEGjmriGBNATh5gJFs+11xVIbgYCCHnCs/fUDhF6viopd1AfQN2kJO5dIXE4f fNJlDxFRHJcK4FONstgm/XpFl/mBtmi9insJZS1mxLNl/AMuQkwUBNDNax7lA1GnHcPa X6M2io7D8tJl/Xs4vSzFCza7x4AxZaCgkSBAiS/QopXO8zgHT2+hCuoxXuTqngZSuMdU wDWfocFo743dfqjOP8cff8Whl1qn2mQffAhVlki6mEc9/HLPoPPb/bFseXf+Kgx/Yzoz tqSpfidPKRwNiBKQKaW80yzC7T6RU45D1O6qFLvcnywCT8ZP4CxynuMnOlUgmR/ZsYRq opNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GhGgdo1u; 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 v9si179252ilu.9.2021.07.07.13.42.15; Wed, 07 Jul 2021 13:42:28 -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=@gmail.com header.s=20161025 header.b=GhGgdo1u; 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 S230437AbhGGTUv (ORCPT + 99 others); Wed, 7 Jul 2021 15:20:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229987AbhGGTUu (ORCPT ); Wed, 7 Jul 2021 15:20:50 -0400 Received: from mail-oo1-xc35.google.com (mail-oo1-xc35.google.com [IPv6:2607:f8b0:4864:20::c35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C2FFC061574 for ; Wed, 7 Jul 2021 12:18:09 -0700 (PDT) Received: by mail-oo1-xc35.google.com with SMTP id 128-20020a4a11860000b029024b19a4d98eso767266ooc.5 for ; Wed, 07 Jul 2021 12:18:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=Y7Q51/7FLsCms66glLj41BP5mqecTdjNWpQEsIZ8maA=; b=GhGgdo1uZFPwlJDhrxzSSKETzBZEfVoXMQ3Ml4ZKUlafAZUF4OHN0xRl5PnsgDfxFq 1jGcfEat3uGzVNqztVDKGxfT5VJXWYgroBb86qiN71d63McvKGeGGaBTphuvzI9JRRVT +zkEuUnlZz9XlhMPlhTuA5lOC0NIxmRfNTd4MjWU7osgUy6IjX9ihL6S77qRBnzlkN23 0O4qjM/uhD+wxl4nKCLRGkT2MUyCA/tgWdiUSbCYNTPfNdUfaFO/+Y8IZxC4cisUn2BU FJIwsnKM8W5jUkSiT7Vc8QZzWNg/BygY0M64pesU7o+j2b3HeBqmmV0Im1uw6z/6n69e M3xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mime-version:content-disposition; bh=Y7Q51/7FLsCms66glLj41BP5mqecTdjNWpQEsIZ8maA=; b=XwvIrQ32grrXr1mxZkciTmgWxGJ1bGaDEt0YyNYECAf61SiL7kSSSoWrcKZuUdqU4n TRrLKfM3jifgVAIA/otJO64wp0aJlo17NtJoy5e4m3cdUbLjaNi3nWFDLxfspfejbUu6 5xpcCtaBchA4KJtwY6jMkCwj6/oIfIwfEiVTMXksU8BCmI1e0Btt/FdiMEGjUoE+rtB5 oNogyZA8CFk7ADS48/9+FQ8LYwnHstcR+XNQprr3T8UrfC4ZsF0fBYUPHvBPayQwwaRo YtFiVt19N+Yj23y4jkl2grPvHvWj1nX1eVsFNyv4pYwLpzx6kUWdybtDXWfojHHrFgSE VJkw== X-Gm-Message-State: AOAM530mmaWpHg2nbQuAyIK++Ga4iM//O6GZBd2Hmj9HfsToKhGR16Ja CtjzllLtnYHhh5PSKwbUvdg= X-Received: by 2002:a4a:8687:: with SMTP id x7mr19627528ooh.46.1625685488815; Wed, 07 Jul 2021 12:18:08 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id h25sm990890oop.15.2021.07.07.12.18.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 12:18:08 -0700 (PDT) Sender: Guenter Roeck Date: Wed, 7 Jul 2021 12:18:06 -0700 From: Guenter Roeck To: Valentin Schneider Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Bharata B Rao , Arnd Bergmann , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Peter Zijlstra , Ingo Molnar , Srikar Dronamraju Subject: Re: [PATCH] powerpc: preempt: Don't touch the idle task's preempt_count during hotplug Message-ID: <20210707191806.GA2205122@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 07, 2021 at 07:38:31PM +0100, Valentin Schneider wrote: > Powerpc currently resets a CPU's idle task preempt_count to 0 before said > task starts executing the secondary startup routine (and becomes an idle > task proper). > > This conflicts with commit > > f1a0a376ca0c ("sched/core: Initialize the idle task with preemption disabled") > > which initializes all of the idle tasks' preempt_count to PREEMPT_DISABLED > during smp_init(). Note that this was superfluous before said commit, as > back then the hotplug machinery would invoke init_idle() via > idle_thread_get(), which would have already reset the CPU's idle task's > preempt_count to PREEMPT_ENABLED. > > Get rid of this preempt_count write. > > Cc: Guenter Roeck > Fixes: f1a0a376ca0c ("sched/core: Initialize the idle task with preemption disabled") > Reported-by: Bharata B Rao > Signed-off-by: Valentin Schneider Tested-by: Guenter Roeck > --- > arch/powerpc/platforms/cell/smp.c | 3 --- > arch/powerpc/platforms/pseries/smp.c | 5 +---- > 2 files changed, 1 insertion(+), 7 deletions(-) > > diff --git a/arch/powerpc/platforms/cell/smp.c b/arch/powerpc/platforms/cell/smp.c > index c855a0aeb49c..d7ab868aab54 100644 > --- a/arch/powerpc/platforms/cell/smp.c > +++ b/arch/powerpc/platforms/cell/smp.c > @@ -78,9 +78,6 @@ static inline int smp_startup_cpu(unsigned int lcpu) > > pcpu = get_hard_smp_processor_id(lcpu); > > - /* Fixup atomic count: it exited inside IRQ handler. */ > - task_thread_info(paca_ptrs[lcpu]->__current)->preempt_count = 0; > - > /* > * If the RTAS start-cpu token does not exist then presume the > * cpu is already spinning. > diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c > index 096629f54576..7ebf3382816a 100644 > --- a/arch/powerpc/platforms/pseries/smp.c > +++ b/arch/powerpc/platforms/pseries/smp.c > @@ -105,10 +105,7 @@ static inline int smp_startup_cpu(unsigned int lcpu) > return 1; > } > > - /* Fixup atomic count: it exited inside IRQ handler. */ > - task_thread_info(paca_ptrs[lcpu]->__current)->preempt_count = 0; > - > - /* > + /* > * If the RTAS start-cpu token does not exist then presume the > * cpu is already spinning. > */ > -- > 2.25.1 >