From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752819AbdKWNNs convert rfc822-to-8bit (ORCPT ); Thu, 23 Nov 2017 08:13:48 -0500 Received: from mout.gmx.net ([212.227.17.22]:59962 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751447AbdKWNNp (ORCPT ); Thu, 23 Nov 2017 08:13:45 -0500 Message-ID: <1511442781.6505.26.camel@gmx.de> Subject: Re: [PATCH RFC 1/2] sched: Minimize the idle cpu selection race window. From: Mike Galbraith To: Uladzislau Rezki , Atish Patra , Peter Zijlstra Cc: Joel Fernandes , LKML , Brendan Jackman , Josef Bacik , Ingo Molnar Date: Thu, 23 Nov 2017 14:13:01 +0100 In-Reply-To: <20171123105247.wcl2fiypge2pvile@pc636> References: <1509427662-25114-1-git-send-email-atish.patra@oracle.com> <1509427662-25114-2-git-send-email-atish.patra@oracle.com> <20171031082009.rxxa57goto6q5xld@hirez.programming.kicks-ass.net> <49e98b00-80c7-b3a4-30fd-bccb382d002b@oracle.com> <20171123105247.wcl2fiypge2pvile@pc636> Content-Type: text/plain; charset="ISO-8859-15" X-Mailer: Evolution 3.20.5 Mime-Version: 1.0 Content-Transfer-Encoding: 8BIT X-Provags-ID: V03:K0:HKbZKIzQdTJ7EcYBruR1N8yWYr7BMuxQ7B8T6yImhr55eWoA8D0 EATaWrX8yw4WENn+HPdD9q3HpnVZC7cKHKhYdSyrRGMizlqMSgapq2TCqPgB/aR43Tc/bp8 8kKAq68U2IqjTH/msmsTonhw8fULaZqsCmSM/CjouV9a8w3zt/SBOJVz3O7ihGGnnksiC98 In8m5msBV1FzHowp5ydIw== X-UI-Out-Filterresults: notjunk:1;V01:K0:cy3lWAIk/oU=:K8KJ9Yt70aacaV4V7KT4ze WqYKogDad4r4YwM9Qdj0onotpvzx+Q4pzvy64Pe4QnLwwAIuMLsixstdM22vo8of/fOfyp/2C R0gq5qLgChYuOre3ww/TpoK+7NPZprh3mU1XUbPW8bs1r+hLmfiYlQnCrlyBecWbPOKsWJyLi 1sQl5HCM+v4w+kyquIgT1XM5o34IC2tzvSYs0qGS1u/JJL4mSBmjSVhZsmX+FDeKB9pz5088D 5Qna3yqNySvLobdKK8xSdLm+mQkfjw7ehIOZRoaZ/EiFSgzny2PVPWVqJxNBStvGtHdCSKKYq wetCWLzalVp+wZbYLpLuK8zGHrUe8s8Xbxd0cIB6ez0/0achyOk8QNnIf1dqYjSz7csADzO5C zN5d6eGzLlSLyZk5m7mpXTcAYTBmcrPvY1u06/J34MjIkbhfrMDybEzXguLnWVjc2tAuUbIsY flvBHMcdWzY04+m8WfwMwAqHDb1Iz5v2l4Q+qLDGGfdiFMdBwuYoQfV2wGIFAOhWCF2dqiheI s1uoADczdsA3YCbFW/W9P9/nlidxbONNzQVDbcHZJLw4j6dvi6KufO4VwvrQP5WdUDu4tSTJZ C6RL0vTUvAAsB1E/sJAwoRuOxFYyv8SmrQD1rHjPr14gkNyZPJT9llu+3pTH9R1m+RA9QfWKE PmwsswqXtPPKdESmsRxQSySCc0gBxoohuunFrPziQCGuM7K0r684cyr7ySHCr2mbJ8jxi1KRD 9SFBorUJlYpCSnsTO8Cn+42a2E/tWO+2tTufRzQjxMaJsmjQZIt2mnRYkjBPx0tv6uENk5xmT cw68vmyoAzRU/DJQelDu6jaVjcA46QLxOUG96H1+xGzkNqKeQg= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2017-11-23 at 11:52 +0100, Uladzislau Rezki wrote: > Hello, Atish, Peter, all. > > I have a question about if a task's nr_cpus_allowed is 1. > In that scenario we do not call select_task_rq. Therefore > even thought a task "p" is placed on idle CPU that CPU > will not be marked as claimed for wake-up. > > What do you think about adding per_cpu(claim_wakeup, cpu) = 1; > to select_task_rq() instead and possibly get rid of them from > other places (increases a race window a bit)? My thoughts on all of this is that we need less SIS, not more.  Rather than trying so hard for the absolute lowest wakeup latency, which induces throughput/efficiency robbing bouncing, I think we'd be better of considering leaving an already llc affine task where it is if the average cycle time is sufficiently low that it will likely hit the CPU RSN.  Completely ignoring low utilization kernel threads would go a long way to getting rid of bouncing userspace (which tends to have a meaningful footprint), all over hell and creation. You could also periodically send mobile kthreads down the slow path to try to keep them the hell away from partially busy CPUs, as well as anything else that hasn't run for a while, to keep background cruft from continually injecting itself into the middle of a cross core cyber-sex. -Mike