Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp712542rwd; Thu, 25 May 2023 02:53:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5xB4JiOKtkAdGxf4+J1RymMlpTYP41vuQkOXLi4IRNP7pVFavQ6r0jbEkY/IIzU1y2W9MO X-Received: by 2002:a17:902:8ec3:b0:1a0:7156:f8d1 with SMTP id x3-20020a1709028ec300b001a07156f8d1mr1007191plo.19.1685008382895; Thu, 25 May 2023 02:53:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685008382; cv=none; d=google.com; s=arc-20160816; b=Du8cnwgXzoSv4VScThkciVr6Q/v3JziL274BBYHqReXzVvfxQJkM66waXjPqBxhu+Z KB5rpNve3PUxT9Ky7SnS24Gz5Ieu7SsZdmMeeoCHBKX2OsMpWosbx6S+jbyl2WVSg6Jp zKOlznuLEkxewO14OmNRF7FS5c+9LmsPAo81tM52U6FwQy8PzITFZdg9qrBIhhO+2/gx nqDwBK6POahpvNx86UUD7h9vWfyuY8aCt1h3akK6oISIDHFdrEeKrJrHVqWnurIbFKDL 3DG2PnJDzgXdqzwXLwFKL+d1+dbbImL/UvSCCRY4IsEYJ1k/TFG9XBZRmoSn1Lstt71e LfGg== 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=JbYe6oQ/t+MGOrVPaSZVVEb9Om/jNAfxeWoq5v6vxoA=; b=XrsbBR8oUU6bDGVmDggv+gdt2/QoWQusaH6i0bW66KcT1mKti8Mdlgt9xu4bo2KLPL iZuEi4VOyfVpx8ofs+M3qxtctN4x3V/c4GVH5ZNoG3RFUR8HUmAOg1XrV0VQ5yRGkDns KADeGGuyTthjLtr6c1qeYNqDunzoh7EiuojV4vcpt2uGJLiw9S74lCRZDAx1QcC0hSDv jN97mgZP5/0nXWZGdhz6xKo4A6Cg1rLoKDrPAGbLfnYw+emYhdeVAM3bzB2zPFfkjphA 2baiFOe94tJ0qAeKDedgH0DRubm8h3LMGMKkWSvENJTeIif4jzQUNj++Ngnm1pKiUiwB Dxow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=OnhzaCti; 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 u12-20020a170902bf4c00b001afc602cd5esi1113574pls.90.2023.05.25.02.52.51; Thu, 25 May 2023 02:53:02 -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=OnhzaCti; 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 S240309AbjEYJeZ (ORCPT + 99 others); Thu, 25 May 2023 05:34:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240444AbjEYJeN (ORCPT ); Thu, 25 May 2023 05:34:13 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81D38E4B for ; Thu, 25 May 2023 02:34:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1685007193; i=efault@gmx.de; bh=dzmGJbT9vNfENkU55MdWdhIPKYqJfzUidx6T+yitQTY=; h=X-UI-Sender-Class:Subject:From:To:Cc:Date:In-Reply-To:References; b=OnhzaCti1/1qeJlfMnlCSjhSQuY9sNonlb95Lz9rsax6aRKJLQdG7VxYEgtGp5r2J mYkw1wB4zxptB+HK7Q4qP1yOEZO2ZDIlBgcWLcjkKbstTi3VI0+W7R98jWn5rUG/Du 494NvUQSqGOhnp7nDo7/6b7yyc5iwEUlnyYcKStfbyStVXsnbkhWR1tDrspYK2EZTD WWIekZTx7Kvjf2FxU6Z0aaP7lmRoMpA6LFYRo1ldXGJR/R0EsPe4w5O9I4yLtDbxzh s6Ckn/n9LOrxAXcuvqnbhVdt+2yAZhxtx9wrAa/5qsdL/eXdwny19t7psfyd8Nvmnb rCfSWwgvUcgPw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from homer.fritz.box ([185.221.150.37]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M5wLZ-1q3Uup3dhj-007XXu; Thu, 25 May 2023 11:33:12 +0200 Message-ID: <372fcc546474ed280d1e200fc83deded3759da52.camel@gmx.de> Subject: Re: [RFC PATCH] sched/fair: Introduce SIS_PAIR to wakeup task on local idle core first From: Mike Galbraith To: Chen Yu Cc: K Prateek Nayak , Peter Zijlstra , Vincent Guittot , Ingo Molnar , Juri Lelli , Mel Gorman , Tim Chen , Dietmar Eggemann , Steven Rostedt , 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: Thu, 25 May 2023 11:33:09 +0200 In-Reply-To: References: <20230516011159.4552-1-yu.c.chen@intel.com> <19664c68f77f5b23a86e5636a17ad2cbfa073f78.camel@gmx.de> <795a6d9475ecb444d219a9d36dc93b48a69e960e.camel@gmx.de> <0ac968e3-cd80-6339-970d-37005876b145@amd.com> <12061140-4f09-b83f-843c-2fb8ff9f6e81@amd.com> <5ffb7ebcc75c106d791d4b5c4dece4b74c551245.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:bXu3eUWOX28a31ftyMMXf4cKy0h12gX9iO1Tzxond1i2ZKtjkUL fHfap1obrjqu5+Trv9il2smV+On34ZaVxV+pumnitFn/FUcgqbDf6c1E2AGRi0qgTjzdop4 vZ23y58FVKnHBL8RlsvXeN2voaIhIGFNaW68+wgQRpvDoisuZaJPA9nusZSA9L7TIiJHgcB nGsSaSa7Ak6uyG7U7WqkA== UI-OutboundReport: notjunk:1;M01:P0:+9o+2iJ57fk=;lZTfHIMPq8rDV/OGmwxFQcr61J8 6sv+q3RNR79SjJvd+SiES3EW8UVfe+ocFggYpACDBzAqZ9uJHwBeOEL2rSsLd6G2Ik49qS46S gjj/fnhPJwWhoCQvtl2oAKLkrOzDPp6pGRoFO5Y2OBqAMQw9lKA6WBEp+06i1+qiGE/0Eo4ex RFoWpbNFqCfhFjVCOyGg1bI6hmhVsSE0vXEQu2LnQpmJC4tnCUwmM7EJyui4eG529jiq6K8JK UdWhCEsE7jvIB6MBsGy+O40MA5gf3Dy7XixhZyOPLPDn6rp5fYvjUam8crRRUtEQfs7ulQNFX 8B64fW3ik0TqBzEX+iLSMagtL/46OXbx8uQYSbvCqNVhRwcprmII52Rid12xnlIco4j7+aYEu JZKpwEJ37qAqqThUNycL/49WxJZCpKvJ4A56YgW+Jw1GiPUWbTHT844E6PxVmTgeZ2IC1jZ9r On07/0mCkgKMCD1QRdA7PuseeiAf1sbzYLQC6IJvUpUvUbg3RXvle+Rl7jMBTm3CqTrBcK3fI DHNOFNMtQDY183cpQ6DL1hfyKcImQ1lfeweqjedtwN0MyB0qBBSL99O3d2cEHb2GaMC6/nU/b AAOyiUNNf/84lq1LoT/3Ol5KLefRaWvoDhyEAvZ7c6+aLBh8i9lqVPdExAuINyurxN1aMaLOw ONLJcR76msxbS5SgWmg0u+Y26B2ClVeo3oLdiDhgRTyJGezPWcLXMVOGBSn+N3ZbC13umom2b UWZD/8UGqCiL6DJRscR/m8kZtxKjKhgENpSS7Zxd3Vby081Ik3q518SFfs3OS9FeusqjuB0rC M97pvkBHtY/rAikeoqZDubXGP1fQ2zvxW6b+cRHMlghMMzWYaH89uNwK7EjMLoKUAlbhZzr67 ObnL2NtCYObTBGhWCaT3+uirTueNbRbnCV5r0IJu3xv5sgiNId1n4TjPUNnVbRCZLgrSWLgB/ q5uXHQC+LoVI5NEhjof7XsV3sQA= 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, 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-25 at 15:47 +0800, Chen Yu wrote: > On 2023-05-22 at 09:10:33 +0200, Mike Galbraith wrote: > > > > At one extreme of the huge spectrum of possibilities, a couple less > > than brilliant tasks playing high speed ping-pong can bounce all over = a > > box with zero consequences, but for a pair more akin to say Einstein > > and Bohr pondering chalkboards full of mind bending math and meeting > > occasionally at the water cooler to exchange snarky remarks, needlessl= y > > bouncing them about forces them to repopulate chalkboards, and C2C > > traffic you try to avoid via bounce you generate via bounce. > > > I guess what you mean is that, for a wakee has large local data cache > footprint, it is not a good idea to wakeup the wakee on a remote core. > Because in that way the wakee has to repopulate the cache from scratch. Yeah, and all variations in between. > Yes, the problem is that currently the scheduler is lacking of metric > to indicate the task's working set, or per-task-cache-footprint-track > (although we have numa balancing to calculate per-task-node-statistics). > If provided with this cache-aware metric, the wakee can be put to a cand= idate > CPU where the cache locallity(either LLC or L2) is friendly to the wakee= . > Because there is no such accurate metric, the heuristic seems to be an c= ompromised > way to predict the task placement. Nah, it's a dart toss. With a box full of net blaster tools, the odds may even be favorable, but who knows what the wild will do. > The C2C was mainly caused by accessing global tg->load, so besides > wakeup placement, there should also be other way to mitigate C2C, > such as reducing the frequency of accessing tg->load. Attacking that is the only thing that makes any sense to me. > Besides that, while studying the history of wake_wide(), I suddenly > found that 10 years ago Michael has proposed exactly the same strategy t= o > check if task A and B are waking up each other, if they are, put them > together, otherwise, spread them to different LLC: > https://lkml.org/lkml/2013/3/6/73 > And this version has finnaly evolved to what wake_wide() looks like toda= y > in your patch: Yeah, I've touched that, but it's still busted. I watched firefox burst wake a way too big thread pool, but since worker-bees collected zero flips, the heuristic says all is well, move along ginormous swarm. -Mike