Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1388134pxb; Wed, 30 Mar 2022 02:14:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzRpJk25nP/eDjP6ZEcvh9kcgeRix2A6Ho/R4Nob5ZDv+1IxL3IuwKqO3SAsf8Mh3TRY9R X-Received: by 2002:a17:906:c111:b0:6db:cf0e:3146 with SMTP id do17-20020a170906c11100b006dbcf0e3146mr39533010ejc.280.1648631694303; Wed, 30 Mar 2022 02:14:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648631694; cv=none; d=google.com; s=arc-20160816; b=xxcFTmo+yAggrmog/OSu71RQAuCIdt76CbfAqZbE3Li822AV5A93lMhy6g86H/k0XF sj2tN2y17Vj8JaNPWvauZucPphIyHS8xXf4FXdbTedf+4l7ZM38R0uOLnyZCFFOCLoY+ 62gBu0wkk1cJegfRtGbVscslvBxUGff0ehl1W6CT1Y2D3hhiRg8jBRaGM2dZoJP2il2s BCWF2qIGcikZlI7BvHrwd036v3vK3/NhGlmk7Vu+Ek9NCNvR5ANd0gz294CAHc+vzl+A vdBVDNwiQe36PcWsR5JPcRZUMjIckXCR0+bVeMQci8TuG2mgKJRZn7u8aXFB5cFhRxyB h9yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qMHVx+pB9tah50DD606tJEjOnhTtHzPvegXbqsW7veU=; b=iI2UMf+SPYNUh6XuFdNTs4lOwWFmeGPVr1GrPJIUcH2hgW7WLb6WjcASk9z19wvMaA jylhuPqmxn7WFLcpqJ+Zu5enrmHhwjr8w0oJP5plk5+sHYPmFurP//CataIV0/YCa7UU yNyjMC+cWdTFaV/fVwY9TWDR7uuYQ4x7u9/ryu9qMmmFlsL+/Iubbt4H/4D0ViLlk0c8 3fLnvkE+Ol6bXnmDhPxxoTMb/jgDmZPFigy+ofnh6aEq0oekqac5439cIuCTnRIaj/6D HIVx6b6wZNrknsFWgzCwB2Nsud6S+4VwXAmrwC7y3xdCFl1LiQoDQ3Ce9VmbsZhAq4kr j70w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YfBRRlSP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w3-20020a170906480300b006dfbfcb1f69si19380378ejq.458.2022.03.30.02.14.27; Wed, 30 Mar 2022 02:14:54 -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=@redhat.com header.s=mimecast20190719 header.b=YfBRRlSP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241059AbiC2Twp (ORCPT + 99 others); Tue, 29 Mar 2022 15:52:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234769AbiC2Twj (ORCPT ); Tue, 29 Mar 2022 15:52:39 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 53DC618B25D for ; Tue, 29 Mar 2022 12:50:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648583454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=qMHVx+pB9tah50DD606tJEjOnhTtHzPvegXbqsW7veU=; b=YfBRRlSPt9hHeN7mPgu74imovO31o9BMxophFZPgpcezD36/8itdN8ef2JXXOeRvJDjdDn aEg0msnmkc+40Vj83kxk5wT+vJ9VEMTtdCxpvJ4j5Q5YDWszMLeLrpqWkI19km+wOlpIt3 UqwPR4keFgDbPr2wQkfjZbdU0zse7M4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-595-wsmEjG4qMViHPx8jGylg4A-1; Tue, 29 Mar 2022 15:50:50 -0400 X-MC-Unique: wsmEjG4qMViHPx8jGylg4A-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E5DD185A5A8; Tue, 29 Mar 2022 19:50:49 +0000 (UTC) Received: from lorien.usersys.redhat.com (unknown [10.22.8.232]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8B9EC1121314; Tue, 29 Mar 2022 19:50:49 +0000 (UTC) Date: Tue, 29 Mar 2022 15:50:48 -0400 From: Phil Auld To: Dietmar Eggemann Cc: linux-kernel@vger.kernel.org, Catalin Marinas , Will Deacon , Mark Rutland , Peter Zijlstra , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] arch/arm64: Fix topology initialization for core scheduling Message-ID: References: <20220322160304.26229-1-pauld@redhat.com> <1a546197-872b-7762-68ac-d5e6bb6d19aa@arm.com> <5a5381cd-813d-7cef-9948-01c3e5e910ef@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5a5381cd-813d-7cef-9948-01c3e5e910ef@arm.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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 On Tue, Mar 29, 2022 at 08:55:08PM +0200 Dietmar Eggemann wrote: > On 29/03/2022 17:20, Phil Auld wrote: > > On Tue, Mar 29, 2022 at 04:02:22PM +0200 Dietmar Eggemann wrote: > >> On 22/03/2022 17:03, Phil Auld wrote: > > [...] > > >> I assume this is for a machine which relies on MPIDR-based setup > >> (package_id == -1)? I.e. it doesn't have proper ACPI/(DT) data for > >> topology setup. > > > > Yes, that's my understanding. No PPTT. > > > >> > >> Tried on a ThunderX2 by disabling parse_acpi_topology() but then I end > >> up with a machine w/o SMT, so `stress-ng --prctl N` doesn't show this issue. > >> > >> Which machine were you using? > > > > This instance is an HPE Apollo 70 set to smt-4. I believe it's ThunderX2 > > chips. > > > > ARM (CN9980-2200LG4077-Y21-G) > I'm using the same processor just with ACPI/PPTT. > Maybe I'm misinformed about these systems having no PPTT... I'm reclaiming the system. Is there a way I can tell from userspace? > # sudo dmidecode -t 4 | grep "Part Number" > Part Number: CN9980-2200LG4077-21-Y-G > Part Number: CN9980-2200LG4077-21-Y-G > > # cat /sys/devices/system/cpu/cpu0/topology/thread_siblings > 0,32,64,96 > > # cat /sys/kernel/debug/sched/domains/cpu0/domain*/name > SMT > MC > NUMA > > But no matter whether I disable parse_acpi_topology() or just force > `cpu_topology[cpu].package_id = -1` in this function, I always end up with: > > # cat /sys/kernel/debug/sched/domains/cpu0/domain*/name > MC > NUMA > > # cat /sys/devices/system/cpu/cpu0/topology/thread_siblings_list > 0 > > so no SMT sched domain. The MPIDR-based topology fallback code in > store_cpu_topology() forces `cpuid_topo->thread_id = -1`. Right. So since I'm getting SMT it must not have package_id == -1. In which case you should be able to reproduce it because it must be that the call the update_siblings_masks() is required. That appears to only be called from store_cpu_topology() which is after the scheduler has already setup the core pointers. The fix could be the same but I should reword the commit message since it should effect all SMT arm systems I'd think. Or maybe the ACPI topology code should call update_sibling_masks(). > > IMHO this is why on my machine I don't see this issue while running: > > root@oss-apollo7007:~# stress-ng --prctl 256 -t 60 > stress-ng: info: [2388042] dispatching hogs: 256 prctl > > Is there something I miss in my setup to provoke this issue? > Make sure you have a stress-ng that is new enough and built against headers that have the CORE_SCHED prctls defined. BTW, thanks for taking a look. Cheers, Phil > [...] > --