Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp5868371pxv; Wed, 7 Jul 2021 13:42:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZ0H+RbMEz1tnXxCDejGvwiMp2VwFziTSXRje+4QBMFNidQzvEUkkO8nhLQ1tA+6IkJ7WC X-Received: by 2002:a92:ddd1:: with SMTP id d17mr18699628ilr.46.1625690555327; Wed, 07 Jul 2021 13:42:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625690555; cv=none; d=google.com; s=arc-20160816; b=fL6E5/xqotJGmqWdQef9iJwxjqvzybbRwYUenJ9W4YdmYdxO3D79Dfwt2GCKfBuJ1w D//Rm0v/lT0HsW0aV920SaPTBl05wj/Wl5szfgmcG4Mj/20ko9cNj+LrFS9021MAOW6C ZX1GKiQHJHnbeE4Jv53VHehy1e1SXu2VkjJtmSHPwCPWclYzU+6xSCvKIbgW2pl0nGFo A/6cBBmLqabFwRUyE7BQYUgSqUR94kTFigRdp2PfL95YLbdATXKOM3XSmtSo9V4GNL8R VsjqAQzytKvnuA32xyB97z2RNH6Ad1Kj3tbQiFUeq3eT6449JU7GB30PKvxyJnh+MEoX tByA== 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=86K7g6xk1w1rzYS0KSqb5hgP7+OyClopI7gZPdUQgbI=; b=y2LF5TQDYWPxDarOzwb0sRyDCiW5NePGBo9Bvc9xi6TZUI2U0qSQ7NTaIxMz/ROQ/f +hPbvQ6+BRA/4JI0dfpJMfFdcHUICR+tI7ANUVGFevXm4in1/ue7oXUqXL7cMmc4Mqix icPcT4pW9RMN8/GXXvitds1A1PXH/aT9kujy9F+MrI/c8hZtROwfz5kHAENcwfA4rRuz c8y6S+NZjSxxkcam1boVuAGb+rUX7jecAdAnGbBhNEAv4GWp7xvbZw3YBD1lSFDp1imU 1Uj+p5O2KIRv/7SzPP7JTGq6jxP/SOZeI8fX46hrCtxww6UL2DhUEDFOCTadO/2WcW96 WtTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PMWxYxFk; 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 d16si94349ilf.112.2021.07.07.13.42.23; Wed, 07 Jul 2021 13:42:35 -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=PMWxYxFk; 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 S232514AbhGGTpQ (ORCPT + 99 others); Wed, 7 Jul 2021 15:45:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230388AbhGGTpP (ORCPT ); Wed, 7 Jul 2021 15:45:15 -0400 Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AE2AC061574; Wed, 7 Jul 2021 12:42:33 -0700 (PDT) Received: by mail-ot1-x334.google.com with SMTP id t24-20020a9d7f980000b029046f4a1a5ec4so3428895otp.1; Wed, 07 Jul 2021 12:42:33 -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=86K7g6xk1w1rzYS0KSqb5hgP7+OyClopI7gZPdUQgbI=; b=PMWxYxFk4kMyuAJ9tresyY9N/+YWoX+ChH8bdDXlNe8+7VtNxuhhhPnb+mDUq+0O79 OvWhR5kTRH5djowXPdZ7hzprz5EFURsT4M7nUv7SXenjjpUyzdL7XrqvloPMlPK8PFTl CGju4ZoO6IDrsGYtejKRYBpnHbJBevm7DZiWvpepJLWFCApaK+WGB37VCeUAoZn+1nmW 2WEIg44ZadrGBNX8cO/1KY2l98VMKT3EKN4gJyzqkvsLxrgQK2vtSHr1AAiFTlh7pNZM PWqzUD3Qs453iSGxkiDnYEWc1qoe63sTuKNX6el6d3aAf/CNxUPMebyGzE7C4MMgXsfW gifg== 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=86K7g6xk1w1rzYS0KSqb5hgP7+OyClopI7gZPdUQgbI=; b=YwFBhIFK533F5uwnL8thCMFm8EbiGAv0tM2kCPFlC32oTRcA5AM75l5PHDhTLcQVhu t5oCUu/AaS9QAHlldI5Z+g2hi7g3En0AvZZNBnPS2F8EbD0N8gGrXyEQNkxb9VdgZgRK kNunIN5jtJmBIfAW92DlX0ZRWMv5tyh2h8GZ+e45za0Xh1C4AukgzTpsjx/zQWDsCi8G lbGIIxt7crJh9kh58itzlrGt6Cfits3TVypaligx/56aGMiDW00JJLpXEJEgiM016Bxu ASqqH2ZyhV0Ywx/gpQDeKRjp/hiPKZfO2Vw3GvVwEEbn9QAudSu9eSzRMQXz9iJBMlBP 7cSQ== X-Gm-Message-State: AOAM530mWVxJHZ4JZT7fWR1NQvbXh1IYdi6iS45sY9oWLbb2JlkIsZsA xv21EwpTCqiX6MexYrgwJbE= X-Received: by 2002:a9d:2aa5:: with SMTP id e34mr13122111otb.366.1625686952982; Wed, 07 Jul 2021 12:42:32 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id k67sm6849oia.8.2021.07.07.12.42.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 12:42:28 -0700 (PDT) Sender: Guenter Roeck Date: Wed, 7 Jul 2021 12:42:26 -0700 From: Guenter Roeck To: Valentin Schneider Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Frederic Weisbecker , Alexey Kardashevskiy , Peter Zijlstra , Ingo Molnar Subject: Re: [PATCH] s390: preempt: Fix preempt_count initialization Message-ID: <20210707194226.GA2318012@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 05:33:38PM +0100, Valentin Schneider wrote: > S390's init_idle_preempt_count(p, cpu) doesn't actually let us initialize the > preempt_count of the requested CPU's idle task: it unconditionally writes > to the current CPU's. This clearly conflicts with idle_threads_init(), > which intends to initialize *all* the idle tasks, including their > preempt_count (or their CPU's, if the arch uses a per-CPU preempt_count). > > Unfortunately, it seems the way s390 does things doesn't let us initialize > every possible CPU's preempt_count early on, as the pages where this > resides are only allocated when a CPU is brought up and are freed when it > is brought down. > > Let the arch-specific code set a CPU's preempt_count when its lowcore is > allocated, and turn init_idle_preempt_count() into an empty stub. > > Fixes: f1a0a376ca0c ("sched/core: Initialize the idle task with preemption disabled") > Reported-by: Guenter Roeck > Signed-off-by: Valentin Schneider Tested-by: Guenter Roeck Guenter