Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp8290126rwl; Tue, 10 Jan 2023 11:22:59 -0800 (PST) X-Google-Smtp-Source: AMrXdXuIB2+g/j6Q4YV49flUrJPAMTRWhSd5boELcKcOJNHwNzIRQBicQZ45Up89D/HyjUg2QQ+n X-Received: by 2002:a17:903:1d0:b0:192:4f32:3ba7 with SMTP id e16-20020a17090301d000b001924f323ba7mr87625758plh.18.1673378578945; Tue, 10 Jan 2023 11:22:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673378578; cv=none; d=google.com; s=arc-20160816; b=GnP09M253ytRcPj5bFPk0l87BaBBzpXQQk4LsFsmiEJZrv2gTbWYxz7mv8lpCwiblZ 6n4m3icbfTCnfN/xPRIa1AuV5u7liEYTPF+hJq6Ze5SlC/6PBoXcPaDy7C9PDiMsC0Am cT0c+soWlW+3H+9pEzphQMoQmpVK46ZsJBoef/10vnCnIgFgO9w1gMwjjdFUXcXp/Te7 PA8r7A/DZtBSklxbtHME5ueOd12TP6IVU/bMbOc8dUxsM8oe5B2VvY0SC6OUkiUKYv4x 3rSos586VmmufqmkUOLGsHs74mkn0yqek8WKyP1k2yxn1DEMDOxfReKtkB3u2yO+oRMq eRNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=jZ+feJ2m4yA2ArXeG0OVBpYB1BtZroDRB1kQQe7pS8k=; b=lwQGDg5kEQ6LZJQNbifP9uSCC1Hg8El7B32Y5c5OstSdNDmfrxYVNGqLzdmhpB8yek r8vzmRDWRWuCRS8YN4mCJOLSGebuxqff63XanVZvrTDpGe1HvFuV0VxJzo6dpRbMj46Q 4cNXtaeOuy9oUoiZgNhjAlbmqMh0JwTQPEq4bgMONkbCZ15Z1CEIaszuJtDw6kIcOvWN WOxBD4u4C0x6LBsDLzbMxLheppKzDr08/wMaNhyWUTNCJfx8xi0w8QCGFR/0gUo3Klas OwBu7RGPudRiswEvk1KawO5Cw0ighYBvUSrRwpdb7Fmj2BVj8qsn8uzNviWTfaMDJblB v32A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jFbsPqEz; 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 b6-20020a170903228600b001897a8b5367si13725979plh.56.2023.01.10.11.22.52; Tue, 10 Jan 2023 11:22:58 -0800 (PST) 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=jFbsPqEz; 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 S239446AbjAJTSw (ORCPT + 53 others); Tue, 10 Jan 2023 14:18:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234608AbjAJTSp (ORCPT ); Tue, 10 Jan 2023 14:18:45 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E78924BD49 for ; Tue, 10 Jan 2023 11:17:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673378277; 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=jZ+feJ2m4yA2ArXeG0OVBpYB1BtZroDRB1kQQe7pS8k=; b=jFbsPqEzDFyMDnt/PzhOtazi/ABRUfy4U8HtaLLAEqf6i4wjrKFxQjNVu0qQrMQ67y/eWz vHxt5iixHi4c8fF3RWLVsoYcQ4P1eMTZ9Virrus4DwbSZGQwtAq3RC+oN9rs2xYbBhqArY cNpfnYNZ10eR81B49cAQfIhUd7nPOSw= Received: from mail-vs1-f71.google.com (mail-vs1-f71.google.com [209.85.217.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-32-oVecO06kPhCycvbITSDLnw-1; Tue, 10 Jan 2023 14:17:56 -0500 X-MC-Unique: oVecO06kPhCycvbITSDLnw-1 Received: by mail-vs1-f71.google.com with SMTP id i189-20020a6722c6000000b003c51e0f417bso3068818vsi.4 for ; Tue, 10 Jan 2023 11:17:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jZ+feJ2m4yA2ArXeG0OVBpYB1BtZroDRB1kQQe7pS8k=; b=Lr6+gCyKIJaULZvsYnH51Ti70LAKLMLaMHX7RVJxov/epPU3sFOMl5pe7Vh0s/cgwB iDYslsr1a2+15DRzvXTkbOVFOc8leSsMDxEIxQD8SchWIfg38Mekd8yCfYzJZd8+v1Kl nTmuquMuA1JKO9wHoURUGz6DZM12glPLQ5lRGS56WvkFVWucqfBRXvmnVv6l7ltkuWHO GRofME2xQ6PhRXoKoY5ZxrEPoDsqS8NHCE/A9TbFNNCN1cG+Is24CHJvfEIEjfgA7uJd XmbcRi1yuhdPn3YtUn7IV9m+eqXILTiUnkcyxz7kxpBopvZ6uTtJEzp5BKbgHgh6eziC wtjw== X-Gm-Message-State: AFqh2kpzw4OOaOGcE/ColLfo+alBnwFlXcWRgTcnhtU2AIYgVUHb+BhT I6XzHtxA5Rt/Fb0kiERTdTK5MMOBbnSEDc2fooedrEgO4lwJOdUwkhMWlKy37yWabvaBTGjFuLV CSej2PPe68hYtXGRST7o2Dby/ X-Received: by 2002:a05:6102:3e14:b0:3ce:c94b:6d51 with SMTP id j20-20020a0561023e1400b003cec94b6d51mr12742931vsv.12.1673378275958; Tue, 10 Jan 2023 11:17:55 -0800 (PST) X-Received: by 2002:a05:6102:3e14:b0:3ce:c94b:6d51 with SMTP id j20-20020a0561023e1400b003cec94b6d51mr12742903vsv.12.1673378275703; Tue, 10 Jan 2023 11:17:55 -0800 (PST) Received: from vschneid.remote.csb ([154.57.232.159]) by smtp.gmail.com with ESMTPSA id x4-20020a05620a258400b006fca1691425sm7672197qko.63.2023.01.10.11.17.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 11:17:55 -0800 (PST) From: Valentin Schneider To: Ricardo Neri Cc: Ionela Voinescu , "Peter Zijlstra (Intel)" , Juri Lelli , Vincent Guittot , Ricardo Neri , "Ravi V. Shankar" , Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Len Brown , Mel Gorman , "Rafael J. Wysocki" , Srinivas Pandruvada , Steven Rostedt , Tim Chen , x86@kernel.org, linux-kernel@vger.kernel.org, "Tim C . Chen" Subject: Re: [PATCH v2 5/7] x86/sched: Remove SD_ASYM_PACKING from the "SMT" domain In-Reply-To: <20221229190249.GA14462@ranerica-svr.sc.intel.com> References: <20221122203532.15013-1-ricardo.neri-calderon@linux.intel.com> <20221122203532.15013-6-ricardo.neri-calderon@linux.intel.com> <20221214165900.GA972@ranerica-svr.sc.intel.com> <20221220004238.GB23844@ranerica-svr.sc.intel.com> <20221229190249.GA14462@ranerica-svr.sc.intel.com> Date: Tue, 10 Jan 2023 19:17:51 +0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 29/12/22 11:02, Ricardo Neri wrote: > On Thu, Dec 22, 2022 at 04:56:51PM +0000, Valentin Schneider wrote: >> diff --git a/include/linux/sched/sd_flags.h b/include/linux/sched/sd_flags.h >> index 57bde66d95f7a..8dc16942135b4 100644 >> --- a/include/linux/sched/sd_flags.h >> +++ b/include/linux/sched/sd_flags.h >> @@ -132,12 +132,12 @@ SD_FLAG(SD_SERIALIZE, SDF_SHARED_PARENT | SDF_NEEDS_GROUPS) >> /* >> * Place busy tasks earlier in the domain >> * >> - * SHARED_CHILD: Usually set on the SMT level. Technically could be set further >> - * up, but currently assumed to be set from the base domain >> - * upwards (see update_top_cache_domain()). >> + * SHARED_PARENT: Usually set on the SMT level. Can be set further up if all >> + * siblings of an SMT core are identical, but SMT cores themselves >> + * have different priorites. >> * NEEDS_GROUPS: Load balancing flag. >> */ >> -SD_FLAG(SD_ASYM_PACKING, SDF_SHARED_CHILD | SDF_NEEDS_GROUPS) >> +SD_FLAG(SD_ASYM_PACKING, SDF_SHARED_PARENT | SDF_NEEDS_GROUPS) > > But this would not work for Power7. It only has SD_ASYM_PACKING in the SMT > sched domain. Must it have either of these flags? > It's not mandatory, but making sure SD flags conform to either of them means the topology debugging infra can help spot misshapen topologies... > In Power7 SMT siblings have the different priority but, IIUC, physical > cores are identical. > ...But you're right, this doesn't work with Power7 as it would need SD_ASYM_PACKING all the way up the topology to conform with SDF_SHARED_PARENT, which clearly doesn't work with how Power7 uses asym_packing. > It seems to me that asym_packing is specific to a domain. > For Power7 it is, since the asymmetry is only between siblings of a given core. For other systems where the asymmetry is between cores, that could theoretically affect several levels. Consider: DIE [ ] MC [ ][ ] SMT [ ][ ][ ][ ] CPU 0 1 2 3 4 5 6 7 prio 3 3 2 2 1 1 0 0 As done in your patch, here asym_packing doesn't make sense for SMT, but it does for MC and DIE. Anywho, I think what this means if we should drop the SDF_SHARED_* metaflag for SD_ASYM_PACKING, unless we can think of a nice way to programmatically describe how SD_ASYM_PACKING should be set. > Thanks and BR, > Ricardo