Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp20604581rwd; Thu, 29 Jun 2023 04:49:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5CoyXaFMvVosc+0IhjfpFpwuIZ/za0SVRYv4reYapqrzDMaHneAx3NTXdoiWA7y3wan3aE X-Received: by 2002:a17:90a:118f:b0:262:c3b3:f8fa with SMTP id e15-20020a17090a118f00b00262c3b3f8famr9971779pja.39.1688039382874; Thu, 29 Jun 2023 04:49:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688039382; cv=none; d=google.com; s=arc-20160816; b=FWQFM9ShV1GqzK9uAyAkZSUnw2fke9YO4cXKrPfBQ61Duh/8l8wl8N+IcuG9blLeEi kxxQ30UZaqvVGZxZUySBwZmP/F51tVQzxZeAtf0vstl1EI3IOiObNF7Ld4iPF3Xl4jxK j7O2e4o6bI1bzII/A26n+d9/zOUOUUO4IYkmHOACdAPZuy+GuSETYDucCJX/j+jlSocv 7KvWmRJsX/Jc5Fml8+V/Aq7L7FvuXoA8hdUe7LdnFo1+qEmoaVMdUrYjEzB9YeD6IQR6 QQ8E05eqmz5h0QnfptlhxT9JyUMLB5TD7eIqEOjRu9xr8ADXaf/cgEy+sgohNbhClgk2 bydQ== 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:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=sv/JdQWXY6nWSKNJyVKNtJGaF1eiIkhg3/IJgGGitu0=; fh=KkrcSfOx3SZTY+yC4VQkOXlzFv5840uIde2qNN8iGig=; b=MOTRx8Q1gIhFfWc3kkN1jv+dva0+qRyuxem7atOtZ7T/013c8F/L0omEgNGfPsP/vb fWeGRBbIW2EceHBxpi4wxmPx9EIO1rLyXkMHIe55LJJ3XYxhtF518+nV6YjZCpG62CVC 0/oQEQpnXo1528HZg5TjxRgXE83464kZ/6ykS9Kqz5ETDi1DxpQchV7Gj1/DlBM3omlV PUSvm9jUNUV6kci06YVTh9izGkBCO0AnhhxvkeERZM4ccb0ATe/RWl+PcqjnwVaEaepR r5D5tdZ/iD3S6eX0qw7noZpfeit4Wy03ZxpfqHB7jub2Hzc9OicOLmsUjdP4koYEnUj3 xrHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=JHtvQCEE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bg1-20020a17090b0d8100b00262db07eda9si9040258pjb.120.2023.06.29.04.49.27; Thu, 29 Jun 2023 04:49:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=JHtvQCEE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230353AbjF2LKr (ORCPT + 99 others); Thu, 29 Jun 2023 07:10:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232240AbjF2LKb (ORCPT ); Thu, 29 Jun 2023 07:10:31 -0400 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FECD30C4; Thu, 29 Jun 2023 04:10:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1688037027; bh=sv/JdQWXY6nWSKNJyVKNtJGaF1eiIkhg3/IJgGGitu0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=JHtvQCEEKCFpe536YpnBQY4lzDoxafqWNvDqcJZfV0kdQQ+u0REqsHyuSl1CKrUMy W1LoOm199ryLQ0WjvAzM2VoFXwq9YGq0j16IsN7QYgL3Kbykd67g/EJKefxd/pK8PS PDvxu1qWXbXujyjcooYA8QDRy884V0RZdUTySP7eyhyJ2A0FgBS5ybm/dM5YUb4Cax IEvSrElRkPOB9/F30mXrwhCk9syA1dwcFcFrkPXFENJM6XIXowYKFUpeU/Iu1XnF2N mnVtEWlhUV3H4MshIKtxy/qtt04eqaY56cyMhkiKF7Ta8Wcc26MS5NrmyeH/Vj3Y5K yfVEdWBMV+SuQ== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4QsG2V61t6z4wp1; Thu, 29 Jun 2023 21:10:26 +1000 (AEST) From: Michael Ellerman To: Sachin Sant , Laurent Dufour Cc: linuxppc-dev , linux-arch@vger.kernel.org, dave.hansen@linux.intel.com, open list , Ingo Molnar , bp@alien8.de, npiggin@gmail.com, tglx@linutronix.de Subject: Re: [PATCH v2 0/9] Introduce SMT level and add PowerPC support In-Reply-To: <88E208A6-F4E0-4DE9-8752-C9652B978BC6@linux.ibm.com> References: <20230628100558.43482-1-ldufour@linux.ibm.com> <88E208A6-F4E0-4DE9-8752-C9652B978BC6@linux.ibm.com> Date: Thu, 29 Jun 2023 21:10:25 +1000 Message-ID: <87edluh6ce.fsf@mail.lhotse> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sachin Sant writes: >> On 28-Jun-2023, at 3:35 PM, Laurent Dufour wrote: >>=20 >> I'm taking over the series Michael sent previously [1] which is smartly >> reviewing the initial series I sent [2]. This series is addressing the >> comments sent by Thomas and me on the Michael's one. >>=20 >> Here is a short introduction to the issue this series is addressing: >>=20 >> When a new CPU is added, the kernel is activating all its threads. This >> leads to weird, but functional, result when adding CPU on a SMT 4 system >> for instance. >>=20 >> Here the newly added CPU 1 has 8 threads while the other one has 4 threa= ds >> active (system has been booted with the 'smt-enabled=3D4' kernel option): >>=20 >> ltcden3-lp12:~ # ppc64_cpu --info >> Core 0: 0* 1* 2* 3* 4 5 6 7 >> Core 1: 8* 9* 10* 11* 12* 13* 14* 15* >>=20 >> This mixed SMT level may confused end users and/or some applications. >>=20 > > Thanks for the patches Laurent. > > Is the SMT level retained even when dynamically changing SMT values? > I am observing difference in behaviour with and without smt-enabled > kernel command line option. > > When smt-enabled=3D option is specified SMT level is retained across=20 > cpu core remove and add. > > Without this option but changing SMT level during runtime using > ppc64_cpu =E2=80=94smt=3D, the SMT level is not retained after > cpu core add. That's because ppc64_cpu is not using the sysfs SMT control file, it's just onlining/offlining threads manually. If you run: $ ppc64_cpu --smt=3D4=20 And then also do: $ echo 4 > /sys/devices/system/cpu/smt/control It should work as expected? ppc64_cpu will need to be updated to do that automatically. cheers