Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp749097pxb; Fri, 29 Oct 2021 20:25:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzs7voV4PIjNfi1tWVjYu0NqfhbtDW5MUqpBEFcEnWN1MRTRHg+gTGFM1cpzMQtciUu16qU X-Received: by 2002:a05:6402:438d:: with SMTP id o13mr20107337edc.127.1635564322221; Fri, 29 Oct 2021 20:25:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635564322; cv=none; d=google.com; s=arc-20160816; b=v6y3Bz+iKBT5nptllTBFMWEUe0uV1wCkfMgctFQtnQ1+cjN6AZkBuISAE8B8UxBD66 R71z9Mto7ZZ/gZBxhYIdm9+yKYD/C87SqKfj0pJ+Gy5t1gxU3Nq5Kwza2ML7WMS9JXNW /6SV6NIqid4vf1C22CjIFt5LX7ZHpublTqGsN0BxchMZW+sCLDXou0AVhzrpk5CLQW23 iAK2nAgXNcf/rjq74noU7Bu/Gr/d7A9a1ahbYP22N+o1oOdNSkgxJ6dtaO/hvaeYHm5E /fot4itTOWOuugdCVc9NKzzDExIGrQpwMu00OzawZSOD7U30w0YUWWmStoGVlaTpa3Xr rqtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=p6b8gduGucs1chVVONDTPvIGoz4h1r4VQ7sGptYcoa4=; b=XWL0AdZFGUzBBStU3HpPG3y2fXQHIzevYjDqbxP8tAjNItxj8g4u0kZZIV6S7IN1d8 pYwGz4sNQqYKEQRvqeBVn+Kmt67R93AH9GgiLV2MqCL+doqGB6owH9kk/itHHz/0jk4J /TZhr/+6d/cTi7CKDH+eMxbZdQu2hpidXmaVN+RLM/DOzF7oyxo9dR0eRsEoEzCObZKE UCx2AmMSLhkulecIt4BdnqodHqBQVBN9ZVLiKBX4l/WjT+CBSXKuAfV7ERGhZYduc88z IvaHLhzQjfQe3Vib1/qq2PYqs2aUViNcyYdT54Q6i4tz1z1bvipIesB+ceQIFwk11U3a QNmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=DZrZ4yWa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y26si4372849edo.112.2021.10.29.20.24.20; Fri, 29 Oct 2021 20:25:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=DZrZ4yWa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231442AbhJ3DOo (ORCPT + 99 others); Fri, 29 Oct 2021 23:14:44 -0400 Received: from mout.gmx.net ([212.227.15.15]:47147 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229921AbhJ3DOn (ORCPT ); Fri, 29 Oct 2021 23:14:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1635563494; bh=qjTtp88hW/qAnuLq6PK4CdIotMnR4Kq8WGCR55KIXz4=; h=X-UI-Sender-Class:Subject:From:To:Cc:Date:In-Reply-To:References; b=DZrZ4yWa3krIjDRRcNThLwSb/YNITw05M1M8Ou8WriM5OjgzhZVStUbjiMuQKtef+ /k4WP6nfi9R8fGWo+UbgIGN5kH5xwV9vwKCEzDAquF1PSXR3tJqPpK2iDTn9ssKUgn hAtZlVYDlWP3Foep62A2Y/+fnSWlU4pYOBP5S8c8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from homer.fritz.box ([185.221.149.242]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MybGh-1mqkPo3WQf-00yv1o; Sat, 30 Oct 2021 05:11:33 +0200 Message-ID: Subject: Re: [PATCH 1/2] sched/fair: Couple wakee flips with heavy wakers From: Mike Galbraith To: Vincent Guittot , Mel Gorman Cc: Peter Zijlstra , Ingo Molnar , Valentin Schneider , Aubrey Li , Barry Song , Srikar Dronamraju , LKML Date: Sat, 30 Oct 2021 05:11:30 +0200 In-Reply-To: References: <20211028094834.1312-1-mgorman@techsingularity.net> <20211028094834.1312-2-mgorman@techsingularity.net> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:chsK/1SSDeIrgUkxsmaKoBd9QuPwC5WEIqIDqhsih6Jde/9dlzc OZcys95BQjHlsi7kMnbkbE+5E69qZgxEtxg7suHs305eiuQ7bwXOCRGl1oRTIzrAnfh+vdu Shh6LnlUzK0kCcxHZQuzP/ZrTtBxIyZvnBmrOxGg290rnomhcSLnXe60VIuGLEb6q/tRAF+ HmkVbQKZUW9QT0MgFgYGg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:esvAs1nuxIE=:VMt1UqDNoir4ABskIv+4ij glZs0jUXXcK0ri7y0C0PgzSILOw+WaKiKv0hocz7yWX2LDOu4Ba/jeUsb+b4wYA6ZnSkvWlXI H+dgfhiwya14zsv+Y5U9UWfPSO/VkjaQnR7YNp5F8WqdK0QizZAxQMXPvMH5S6s6MaWKfDyKt 1ln7Q5LczRsTuE/MMa/TsPioAP0Bh4JgcAeUp4pmTCRSeGvXVNai8I+tLe31rF7YrP4NI5AkI dqC+n//r1RGBf0mM2Fsuvzi0F+uZjefQbafcRCNMCWHNdBawyQNEIVZcgOPVLPZXm2HQo/vhy bIxoL0OM2rwSXOVZyYN5Oo1ptcO6B7WsTEhDeSMk30Cr6b5X7C0cjC9lE0SoxGV+aI3BFwVbw v8OmxHpP5ZGdPu/sKWNHPFaQg0sBhYaYH/Sx8hnjZQaDE4xpm4cArjqc1ZaAl8tQc8WQG5sWS rCP6Hz6LD2EFWN1AMuJfmMNWD800udqJ6B6jtUCi8JGilAUtGSRsq4WeX0stalrqgce39195p lSsEfXt3kUqyc91u2f5nO+tCP8XOArnexfYfBBqvo/gwocyAqkcIX7cTso4DIjy11JxKhgcOP tFtOCABuOB/IVuKfFswWqMTQ+Qo+rHNMGgSyzRknLi59tcb4eqZlBaJTJzKD2mhK2x3yNO/j0 Ni7OT3QkGvTneLJsm3b7ULykqNnbNChkdwh8BGA6xt5UH7U5ufSLFFMrR+MlQ2YMdQcNmWh8n mJBNsbWXxJiIdQJYlFUiAQiICzSrRGiTVFxn0r9A4Ew99GCJcUSLBQq3/XbbEAZ1OzV6PNqHW VlTZVw0OQ+Sl0H1eefye9Tx7H91fa9Qkv4w6iKVEnFZmDXXROT7/Fs126oxDMaXnly1sJUFob VafMBe/fyzYI2q1ywSt4Gkr/nKCf+bBWlO8KQGk5go29T3f85tCJJ13dl45WZungYzkyBMrpG zPeLc709Gq7yCzzSXYUENt9lWm5tdPIlKt4Nj838H9UplYtutBaKTORnKQhR9pP/2jR+6k32K AXvTRphB8Q+Aox8TfWWf45xedcoNxGrbJf879ZWUxDkt76HPHMRwG5LQoHZq44Mhh9gz4ScAB TYwq8DnaKjl6Zo= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2021-10-29 at 17:17 +0200, Vincent Guittot wrote: > > I have a hard time understanding the rationale behind these changes > and the one below. Could you provide more details about why to > increase p->wakee_flips here ? The rationale behind it was me discovering wake_affine_weight() use of weight averages causing X waking a way too big thread pool to stack the entire herd of 21 threads onto the waker's CPU while all other CPUs in my little i7 box had one task each. Preventing stacking is SIS or wake_wide(), but because I was test driving a patch I had some fairness concerns about, box was kept busy. I was subsequently asked about wake_wide()'s role, and while I don't think it should have one in a single LLC box, looked into it, found that while X is a candidate, event thread wakees were not. I think to self, what if I loosely couple zero flip earning wakees, do so, then allow for a bit of decay wiggle room while after watching it do its thing in realtime. There you have the rationale. While it did help, it did not eliminate the aforementioned worst case because as desktop behavior changes, decay turns off the heuristic, stacking follows. I profiled it with a perf that sums delay (local mod I find useful), and found that there was no real benefit to the light desktop test load, at which point, no longer having NUMA boxen at my disposal where wake_wide() does have a mission, I lost interest. Mel was interested however, fed it to SUSE's test array, and here we are. Executive summary: patchlet is not so lovely mitigation of an even more not so lovely scheduler behavior. The two deserve each other ;-) Kidding aside, way better would be wake_wide() becoming obsolete. -Mike