Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2683417rwd; Wed, 17 May 2023 12:59:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ59jA1pUT9qK98cdJXsB+glcsaVTFs/T4JfZusoDStA8xlqJgt6X+PBASar4/bAOadGP2zv X-Received: by 2002:a17:903:22c4:b0:1a5:167f:620f with SMTP id y4-20020a17090322c400b001a5167f620fmr29759plg.15.1684353562269; Wed, 17 May 2023 12:59:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684353562; cv=none; d=google.com; s=arc-20160816; b=Favg1CDCdNLCvhcgVnNCOMmCimOTjaKYt0NEspJBWfrU2l7Dt8acM3ZxZYLaV3H96H JcLiL4qAkqzewK6oUqifzgif61gLgLvb5I0/h9Aj5HGXQVEm1w2tme/bcnWjCT+Iicax gg59pdouxDcjSLnPsOS0y7q7kb2AMreJlOR8RI7lgTU3wEAlYNuh4ACBJCuaQNbXQno8 mnYwSYG+DIKLAt+pnOlmGChRPrNREGR60DwQep1+9+ZZ8XUfxmy6ndVPpHB/2cSAWPyY 6MuEgz9MdqEFwqdhtRv6YK2ZpAeopAzdEvC04WrpVfMrJxD8tcPsO+x1w+N9aJ06Fa0i sDRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:content-transfer-encoding :mime-version:user-agent:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=iDNQsba/igFQw5a1RekIylY0yn03m87hpXcc1m6fL4U=; b=P4PajOrHqkyiZB5uuAWLYezuoJL1j0D3z6URMKnrb/J4XSDkd1kA1S3yTeVDUViJl5 T53Bk2xVDxgnGRRsNLAF1U08v0/F0/tzoOPrpG1irMht76MvV0J3GBJ0gSPXcrdGzG1f 7CJPS3GaN6ESLtHnFvWBCweKM8PFAPKj/EgtGruenJzwQCZrXD/SyOhOszMuWHQnyhJe 2Yfr3l6VHORwGfg+mhGjLBqi7pR775z7Y4uVbBvwfGkQ2h0qjewdP7ePbMN+K6daVxy3 0YaENjPbb+TNz6tRHegUflQX7D3c4rFoeix/sXO6RGItoqc2KlHO1vtFo1DN2lKjOJUL UO0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=InY58JYG; 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=gmx.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a6-20020a1709027d8600b0019ab4f7b389si20396728plm.387.2023.05.17.12.59.07; Wed, 17 May 2023 12:59:22 -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=@gmx.de header.s=s31663417 header.b=InY58JYG; 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=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229563AbjEQTx3 (ORCPT + 99 others); Wed, 17 May 2023 15:53:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229921AbjEQTx1 (ORCPT ); Wed, 17 May 2023 15:53:27 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B45F4680 for ; Wed, 17 May 2023 12:53:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1684353145; i=efault@gmx.de; bh=zAXFoLOajTXEmUsic4hbXuN64+R+26WPlaON6S5yV2o=; h=X-UI-Sender-Class:Subject:From:To:Cc:Date:In-Reply-To:References; b=InY58JYGwUOxMDeBhqF37iSsCjATATTRmo64tDgw55l9Gzg3sGm/pAk4gtG+Gq4sX HVG3V1rqxoQiwesk33xMBAvR/oVW5jvPIsG4suVnGwZ9W5j4E3UGOlksxn08SkBwsj IS5qzUgpafG1jaICrDdKzt6/LrUoFtWR7WnWIsKcDS0UfPtlJ1P5w41GdZY5SUTeVQ cHZhOHRL8MBNMthZQnT99OiJTCkNy2IDcuJVcF/v827U7ScJIJzhJEyvLSedtaPaNq fQWQ88PU3weUvGLSWIDPP3lIo3XPsrs7QGz8422dBZAm81Ic53YTuRFxN8lAqQZwcQ lX6+Cgr5R+hww== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from homer.fritz.box ([185.191.218.183]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MK3W0-1pjVXK3DkE-00LW1n; Wed, 17 May 2023 21:52:24 +0200 Message-ID: Subject: Re: [RFC PATCH] sched/fair: Introduce SIS_PAIR to wakeup task on local idle core first From: Mike Galbraith To: Chen Yu Cc: Peter Zijlstra , Vincent Guittot , Ingo Molnar , Juri Lelli , Mel Gorman , Tim Chen , Dietmar Eggemann , Steven Rostedt , K Prateek Nayak , Abel Wu , Yicong Yang , "Gautham R . Shenoy" , Len Brown , Chen Yu , Arjan Van De Ven , Aaron Lu , Barry Song , linux-kernel@vger.kernel.org Date: Wed, 17 May 2023 21:52:21 +0200 In-Reply-To: References: <20230516011159.4552-1-yu.c.chen@intel.com> <19664c68f77f5b23a86e5636a17ad2cbfa073f78.camel@gmx.de> <795a6d9475ecb444d219a9d36dc93b48a69e960e.camel@gmx.de> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:EJg82i2kM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pvmBwq+Cnx9lizN6/e 3WnWeXMPZ9seLirTcvWT2SLcaGrTYfZjWtMi9L6TfxmBzDFxNvUKUOY/nBvo/mI0kMKBIgvJv 0m+99m4rV32DVJ4jOA0/S2Y1+q9wDsItVGy19iumxE/De8Ik4A5luidux33U7p0ue2sIDj672 IR9lbiHiFw7XL75lj8c0xPUpFS4= X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 Thu, 2023-05-18 at 00:57 +0800, Chen Yu wrote: > > > I'm thinking of two directions based on current patch: > > 1. Check the task duration, if it is a high speed ping-pong pair, let th= e > =C2=A0=C2=A0 wakee search for an idle SMT sibling on current core. > > =C2=A0=C2=A0 This strategy give the best overall performance improvement= , but > =C2=A0=C2=A0 the short task duration tweak based on online CPU number wo= uld be > =C2=A0=C2=A0 an obstacle. Duration is pretty useless, as it says nothing about concurrency. Taking the 500us metric as an example, one pipe ping-pong can meet that, and toss up to nearly 50% of throughput out the window if you stack based only on duration. > Or > > 2. Honors the idle core. > =C2=A0=C2=A0 That is to say, if there is an idle core in the system, cho= ose that > =C2=A0=C2=A0 idle core first. Otherwise, fall back to searching for an i= dle smt > =C2=A0=C2=A0 sibling rather than choosing a idle CPU in a random half-bu= sy core. > > =C2=A0=C2=A0 This strategy could partially mitigate the C2C overhead, an= d not > =C2=A0=C2=A0 breaking the idle-core-first strategy. So I had a try on it= , with > =C2=A0=C2=A0 above change, I did see some improvement when the system is= around > =C2=A0=C2=A0 half busy(afterall, the idle_has_core has to be false): If mitigation is the goal, and until the next iteration of socket growth that's not a waste of effort, continuing to honor idle core is the only option that has a ghost of a chance. That said, I don't like the waker/wakee have met heuristic much either, because tasks waking one another before can just as well mean they met at a sleeping lock, it does not necessarily imply latency bound IPC. I haven't met a heuristic I like, and that includes the ones I invent. The smarter you try to make them, the more precious fast path cycles they eat, and there's a never ending supply of holes in the damn things that want plugging. A prime example was the SIS_CURRENT heuristic self destructing in my box, rendering that patch a not quite free noop :) -Mike