Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp5785884pxv; Wed, 7 Jul 2021 11:41:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGoWyNbEdMPPo5LVOnjs+R90BbXwwqqSm1OC7dw2lT2pq18Rui70Pvu51Sat+8FZnFBNdf X-Received: by 2002:a17:906:a94:: with SMTP id y20mr2565164ejf.399.1625683287916; Wed, 07 Jul 2021 11:41:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625683287; cv=none; d=google.com; s=arc-20160816; b=nmO4UJ53OjNi0miw0gQN3FeNqxgFz8VFwOeXy6xO2QxW6Mm95W8ToekYzu6zMd8/8V g8cNgujlYaPHiHcZZpwsl0FTndaO73BNBRR1DLo72+NeWrbMfc/3r3puAAcfYMGaaqSK oaU5GBMduCpZZqqwXfM1So+nV743+ZJjRUNbZEF6HAQ7Vaz1+kcx/FbqoCKzSjPkygm4 dZhXgmZb3C2doaZM6KmzOE0nyTr8XUIkw+EdvKt3cyzSZg5YAGlb1wsRjV5bKOUN+3rX W6aJzanW+iHIWO/ixWZBJlBnjy83QKbB7eSRMDEgOiS0uFBenQ5m0+tnHAYL/VCkvwn7 2sFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=gZKK4kVBHRVnF5VPGwiqH11wTaslBg7m9W6VSLTiylY=; b=eMED9C7hzK5ugdJig2dgGZXx/kdMS1RRUblO1Tl5123vrk5n00gbgfO+X6r46ha5QA YbuM+uyOdPxiEDDFoNWWlBCIIIz1+loac36CrxJVeTz5Rc5sk+aghRhzziTgbeiYy83k LbaHRUAs56eCh+PArh7GWO0e++GN6eBKoFOJNpD8dP1BLrqSSVzrqr7AeEUfIN9uT+UB DLKqgJeMRNfYfYMrIcqO+gHekZCpsrJyOgFF1zvuFCAFpuIhtNmiMBUeuLs/R9aLPYh5 xVqzVpKQ1qCQHzqmCwuSf0zG4Gp8EeFu90fpVxW4xPgBFHYh5Z4YVGcXUlj9e1vTvPk2 hmjA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id go32si19509295ejc.7.2021.07.07.11.41.03; Wed, 07 Jul 2021 11:41:27 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232690AbhGGSl7 (ORCPT + 99 others); Wed, 7 Jul 2021 14:41:59 -0400 Received: from foss.arm.com ([217.140.110.172]:42912 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232460AbhGGSlT (ORCPT ); Wed, 7 Jul 2021 14:41:19 -0400 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 E7CE11042; Wed, 7 Jul 2021 11:38:38 -0700 (PDT) Received: from e113632-lin.cambridge.arm.com (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5F5F93F694; Wed, 7 Jul 2021 11:38:37 -0700 (PDT) From: Valentin Schneider To: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Cc: Guenter Roeck , Bharata B Rao , Arnd Bergmann , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Peter Zijlstra , Ingo Molnar , Srikar Dronamraju Subject: [PATCH] powerpc: preempt: Don't touch the idle task's preempt_count during hotplug Date: Wed, 7 Jul 2021 19:38:31 +0100 Message-Id: <20210707183831.2106509-1-valentin.schneider@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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