From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB8D1C433EF for ; Wed, 30 Mar 2022 15:53:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348437AbiC3Pyt (ORCPT ); Wed, 30 Mar 2022 11:54:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240354AbiC3Pyr (ORCPT ); Wed, 30 Mar 2022 11:54:47 -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 7E02C15A3C for ; Wed, 30 Mar 2022 08:53:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648655579; 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=ZRt0fYElWKBsepHrM3MRiQ4/6V3/GF/vihxx1/IMZuI=; b=Iovs83YgMQ6ZCH9skhZWFiGyHE22xAXGlgYyaZFdU9fJl7y/h/P3yDEREDxfVkUSMC3qC0 opMcCXD+s9hjPF2YLPqSAxSzANAEYPt2IvtYMZxDcisarLcBRrU0vfNUrFPBkYedp3ncof YlXWzqYTr/tGgScpatf9FBkD+TEUY6U= 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-633-B7dl6ijSN1-JB2dOlxhw7g-1; Wed, 30 Mar 2022 11:52:56 -0400 X-MC-Unique: B7dl6ijSN1-JB2dOlxhw7g-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 819A9899EC5; Wed, 30 Mar 2022 15:52:55 +0000 (UTC) Received: from lorien.usersys.redhat.com (unknown [10.39.192.128]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 26BBF401473; Wed, 30 Mar 2022 15:52:52 +0000 (UTC) Date: Wed, 30 Mar 2022 11:52:49 -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> <5dc3a40e-f071-3ac8-4bf0-f555b9d94ff1@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5dc3a40e-f071-3ac8-4bf0-f555b9d94ff1@arm.com> X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 30, 2022 at 05:48:34PM +0200 Dietmar Eggemann wrote: > On 29/03/2022 21:50, Phil Auld wrote: > > 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: > > [...] > > >>> 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? > > # cat /sys/firmware/acpi/tables/PPTT > pptt.dat > # iasl -d pptt.dat > # vim pptt.dsl > Thanks, I'll git that a try. I suspect these are the same as yours though and I was just mistaken :) > [...] > > >> 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. > > Ah, I was using a pretty old version 0.11.07. Now I switched to 0.13.12 > which includes: > > 9038e442b92d - stress-prctl: add Linux 5.14 PR_SCHED_CORE prctl > > To get SCHED_CORE activated in stress-prctl.c, as a quick hack, I had to > add the definitions of PR_SCHED_CORE, PR_SCHED_CORE_GET, etc. to this file. > > Now the issue you described triggers on this machine immediately. > Great! I'll repost the patch with a more accurate commit message then. And if you come up with something different that works for me too. Let me know and I'll test it here. Cheers, Phil -- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6F358C433F5 for ; Wed, 30 Mar 2022 16:01:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yu3HeENXIQ+MT9pfrSPWPuG66VuBXEZiDaavwZK/X1c=; b=a/5tWvZ2YvNQ9b HaWWDsnjkyZU/DqwUxtlfMSl/neU5movJOmSpE0o21cEwfC/DTvO8z2HtU0iu3xos3yFdmC2I6568 w7YbuKwkrhyNv/8FeDywy80T93Rrw+E1pvE+NNiVnQrynSAVE2fChjo7xN3YAS2uzxLVdrmrr0MgJ jMJlU2EZ/uPwJQPFarMrRi7+LOLKAE5JNeZbSzj5wUBqPbXANA2iMgmg2/dHD7yfzRqf4YZBNM5hs pUVLBRiP+bbcvQjMTlD/s39hRJGpqVs6a6Tb0c9z3O7Gn2ZIl7ogbZe6EtBM+EkyfU0/2U7wg1MmB aSBy5EMBZK38VbGeIYEQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nZak9-00Gj0A-Pf; Wed, 30 Mar 2022 16:00:22 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nZad7-00Gg17-4J for linux-arm-kernel@lists.infradead.org; Wed, 30 Mar 2022 15:53:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648655582; 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=ZRt0fYElWKBsepHrM3MRiQ4/6V3/GF/vihxx1/IMZuI=; b=bcoWbDTSApQvZkenfT3K/bXkOiLYHWU1N9OHqAftBT4ys/ZCkLPP+SPcnomPJNuHeVGf5c pL49ST6Zjuk3o0Z2+I/ZwlJdowjOQtGsgaSG4OJUjwwI+oER1sJ9a/Q7g6ltUCzYv/lAfv rn3T6WYxV0FiIEKxGvehpel4UtNhZ+c= 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-633-B7dl6ijSN1-JB2dOlxhw7g-1; Wed, 30 Mar 2022 11:52:56 -0400 X-MC-Unique: B7dl6ijSN1-JB2dOlxhw7g-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 819A9899EC5; Wed, 30 Mar 2022 15:52:55 +0000 (UTC) Received: from lorien.usersys.redhat.com (unknown [10.39.192.128]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 26BBF401473; Wed, 30 Mar 2022 15:52:52 +0000 (UTC) Date: Wed, 30 Mar 2022 11:52:49 -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> <5dc3a40e-f071-3ac8-4bf0-f555b9d94ff1@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5dc3a40e-f071-3ac8-4bf0-f555b9d94ff1@arm.com> X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220330_085305_280260_C5FAA054 X-CRM114-Status: GOOD ( 33.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Mar 30, 2022 at 05:48:34PM +0200 Dietmar Eggemann wrote: > On 29/03/2022 21:50, Phil Auld wrote: > > 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: > > [...] > > >>> 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? > > # cat /sys/firmware/acpi/tables/PPTT > pptt.dat > # iasl -d pptt.dat > # vim pptt.dsl > Thanks, I'll git that a try. I suspect these are the same as yours though and I was just mistaken :) > [...] > > >> 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. > > Ah, I was using a pretty old version 0.11.07. Now I switched to 0.13.12 > which includes: > > 9038e442b92d - stress-prctl: add Linux 5.14 PR_SCHED_CORE prctl > > To get SCHED_CORE activated in stress-prctl.c, as a quick hack, I had to > add the definitions of PR_SCHED_CORE, PR_SCHED_CORE_GET, etc. to this file. > > Now the issue you described triggers on this machine immediately. > Great! I'll repost the patch with a more accurate commit message then. And if you come up with something different that works for me too. Let me know and I'll test it here. Cheers, Phil -- _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel