Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp681317pxb; Fri, 15 Apr 2022 08:48:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiDRteq1O07w1g5Li1vOpD/Qpz5D8cCaPPAEpO7DqvvQ6+sDIGbm/lJI1dw3LqeBvunZa4 X-Received: by 2002:a05:6a02:19c:b0:399:3007:c8fb with SMTP id bj28-20020a056a02019c00b003993007c8fbmr6815491pgb.571.1650037731835; Fri, 15 Apr 2022 08:48:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650037731; cv=none; d=google.com; s=arc-20160816; b=eZ9RKzopE5yToWLCKewl30xVTtjKJ44zX7bM5qCqike1rQPhruqmYMwcBChu8hBqGQ SIElzbBm/jgDhWaJwEshFRSwIc5UWegsFdwZ+HIbwoiL25nJHwX33kRzrh1BmcWqfUZg p760+OTuYEsUQOfzBZO8Mav/CZ7NOYrqb7R6Ko5Iz1t8YXzWXnC+aWvRxgcpU6WVTgLr VPe3uf7aYntaM5y8VwyuKnAYLyEgSRb5MkROmDbZPC3E+1XqWKDHLck7CxfdHQivOcly Xu9d1dMC1gEcB1UEAB9u4+jtwEAplXTMyvp7uDWaJpiXFYws/hITmE4TG4l+vU7IGYVI RghA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=HHScB9zVQ0Ljr9Sb/cRUcY7IzVf6n2YKRFUZpSVWquY=; b=p4Vry1SnrsHmkD8oac2dnhI1urdT8cgtuprCq4STUPYzkkOaQ48DPX23HQ5KbjKRjG 5iaUx7kAZ1AZeSpNDoXdQzU1QJH55LNWdlIK1134RFvNzDYBgu5F+7cDYLxvq5m0hfRb nzqAy5KJTUPASzMswIG8n0SxtCzU/NjOg5FzAUES5nqmPTedntUtIi758ma0eyNl+xt8 CZgMTNXjg5WqRAcqc17HVOaYpzxCo5Z0gNh7yFv6RlzxIaVrgR6Xw79xLGvEPRym16sR qkfARPEQ+LXFFhwx2OmSKnznb99Dnkj9so0AkwH7za795gAnZ2igk1cYdQTqIdhJ5JzM 65kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZZeYOv1A; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f9-20020a639c09000000b0039cdd7341b2si1884150pge.601.2022.04.15.08.48.36; Fri, 15 Apr 2022 08:48:51 -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=@linaro.org header.s=google header.b=ZZeYOv1A; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233593AbiDNH5C (ORCPT + 99 others); Thu, 14 Apr 2022 03:57:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240636AbiDNH46 (ORCPT ); Thu, 14 Apr 2022 03:56:58 -0400 Received: from mail-yw1-x112f.google.com (mail-yw1-x112f.google.com [IPv6:2607:f8b0:4864:20::112f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30E0530F7E for ; Thu, 14 Apr 2022 00:54:33 -0700 (PDT) Received: by mail-yw1-x112f.google.com with SMTP id 00721157ae682-2ebf3746f87so46989957b3.6 for ; Thu, 14 Apr 2022 00:54:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HHScB9zVQ0Ljr9Sb/cRUcY7IzVf6n2YKRFUZpSVWquY=; b=ZZeYOv1AdyqI8YkaFK+P2tv6O4lkkR6u3mlvdQAORx0n3eHsRCpfpitKcEt6AUIwCT xdqM0pIQyHON2fZ2cq3quKQDpm0W/w+cNLaiBIU2lvSFPASvyC9g8358HmEWH22DC+UT cUvw4nIq8lBwO0NuJteh3HHFJetxXYYH2nrzy/hkCQq+DH3PnaXTP9zGKf4ZXlVYZVBb rKi7ukzHVehJm0Twa/jsO46WPpd8nlOLOj8OKS9Sp0Ewhtln7XWU0xfqTGEqKKKtj0Qz j0uT16zr++MtJkTenLXjGcYrdv+X+RVrd5gk/09cYs0WClTcKMPrGhKmTd8mJCYNzxEO sezw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HHScB9zVQ0Ljr9Sb/cRUcY7IzVf6n2YKRFUZpSVWquY=; b=Thg5FhlBb2QoQ18uDv93DVA6JuHL8AUunZ61iXnxXMlHQ4z2blrmr9FxBVT8hdlz2s 7lEGDr+XalFFNUpeHiaBNZ8VujmULOo67SEzzZWhuigrZ46WiAXN0KXUkJ7tlDosV2GU 5vHd50/EUofneAK9zsrgkeQx0D8LvX3DAMTs7d1P2Lo41AQTchuI62P0Fm6eQtH1/000 cQpnGRr+zSJQkZBwQI17NjMQ4qI/mpjOVJNVb3yII8gz2BmKTbWg/CFA1/1aZQh1dcvR tZWd4P45ygZ7m9rJ2wTV/l0u+R5CHr1fjHbE9L+jLrC7mxiO2XfMqccQZmvjxWoULBn9 uqEA== X-Gm-Message-State: AOAM531NsHNU66jFCIpFfmsYE796Ssb1fh+GhdQtz/HnvxC0j0m8OXc2 LxEJYgwEEQRlPllxSAnHsBAKxL6RfNt2ZZIstr3m2w== X-Received: by 2002:a0d:d946:0:b0:2ef:67ce:47c with SMTP id b67-20020a0dd946000000b002ef67ce047cmr58878ywe.228.1649922872356; Thu, 14 Apr 2022 00:54:32 -0700 (PDT) MIME-Version: 1.0 References: <030aacb0c1304e43ab917924dcf4f138@AcuMS.aculab.com> <20220411233447.rcencjivkhyltyxm@airbuntu> <4ca5cd70904d47bea0df93f7c0979c66@AcuMS.aculab.com> <20220413235719.xs72pm2kgihia46g@airbuntu> In-Reply-To: <20220413235719.xs72pm2kgihia46g@airbuntu> From: Vincent Guittot Date: Thu, 14 Apr 2022 09:54:20 +0200 Message-ID: Subject: Re: Scheduling tasks on idle cpu To: Qais Yousef Cc: David Laight , Dietmar Eggemann , "mingo@redhat.com" , "peterz@infradead.org" , "juri.lelli@redhat.com" , "rostedt@goodmis.org" , "bsegall@google.com" , "mgorman@suse.de" , "linux-kernel@vger.kernel.org" , "parth@linux.ibm.com" , "chris.hyser@oracle.com" , "pkondeti@codeaurora.org" , "Valentin.Schneider@arm.com" , "patrick.bellasi@matbug.net" , "pjt@google.com" , "pavel@ucw.cz" , "tj@kernel.org" , "qperret@google.com" , "tim.c.chen@linux.intel.com" , Wei Wang Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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, 14 Apr 2022 at 01:57, Qais Yousef wrote: > > On 04/12/22 11:07, Vincent Guittot wrote: > > On Tue, 12 Apr 2022 at 10:39, David Laight wrote: > > > Yes I want the CFS scheduler to pick an idle cpu in preference > > > to an active RT one. > > > > When task 34512 wakes up, scheduler checks if prev or this cpu are > > idle which is not the case for you. Then, it compares the load of prev > > and this_cpu and seems to select this_cpu (cpu17). > > > > Once cpu17 selected, it will try to find an idle cpu which shares LLC > > but it seems that the scheduler didn't find one and finally keeps task > > 34512 on this_cpu. > > > > Note that during the next tick, a load balance will be trigger if > > this_cpu still have both RT and task 34512, > > David said there are idle cpus > > " There are two physical cpu with 20 cores each (with hyperthreading). > 16, 18, 34, 36 and 38 were idle. So both 16 and 18 should be on the > same NUMA node. All the others are running the same RT thread code. " > > Except for the possibility of them becoming idle just after the task has woken > up, shouldn't one of them have been picked? we don't loop on all cpus in the LLC to find an idle one but compute a reasonable number of iteration based on the avg_idle David can rerun is use case after disabling sched_feat(SIS_PROP) > > Thanks > > -- > Qais Yousef