Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2068918rwb; Wed, 5 Oct 2022 08:35:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5E+XOwI6Q/20JwRKlX+9oHInfJXpL2oyBgOjD0VckOqnOVry3Jlj4JVL4sG3PVwnlCzvLq X-Received: by 2002:a05:6402:34c2:b0:459:5757:5f86 with SMTP id w2-20020a05640234c200b0045957575f86mr348833edc.268.1664984147023; Wed, 05 Oct 2022 08:35:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664984147; cv=none; d=google.com; s=arc-20160816; b=oJPczik4QCjqepLgxZ1+glBhMx/nCRAlxIeC+Qhidf5TzSRuKdIu2PoLq45QPHGc0X Krk/N55ow+ZFAxYAJuZOXQqS9lgMVDn6eN9o/mW+ja6d0sSsbeGNUEEHBRl2KZ5mFT01 fx/zMtJz+MlcWfSMo2iKQFxh+ifK17FlDaM7/CM4u5zwKuFMOL7L4OWIhr8mcmnL7jB1 crL3ss2kTpmHnLnBdD9IQ1/vu3gja1H76ozGTp4lqL4XXZcbQSWqh8O/jblW/tFpPqqo FYYj87jOBVl2kUFroCXK17v/+mJ/GZdhKMYnNfLztjsNzPcDZe6aOn/Zx8Dev3f2S9u2 t5PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=T1Qc7cNPzQhwEISFrkOBfflcgdbNcz/c0d1W2HbabXg=; b=cSoTsYWl8C7K4u2w2HVSIdUs9tj5Ff5R1jpXoZ+dhTclnlAR2sbbtYxufOFZVFzYwd XN5U3QGYLFfGDpsooK62ikSbysBIU4P7s6Flr3dDeWsZePwnYJzpGsyLL2ICorbxgwXC w8Db0FNHBgG4ahgunfCaMoR7lypKMQI/vcaT+glJVJ5vyhclaRSY5/tzrBIjzHoJEo4+ e0Ji6Q9HA/moKlH9kAaakh6Fq4wGx2FnMCPBKEggERUzErJ95DWQtrEC4Uw1Pll73MUO tbpOTVvij/od9f2iF1xrPQKYPkJzGWANrhQlRqo4UFpqGXFfyZs9XiQddxlj7sd1hPsr rSJQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f25-20020a50ee99000000b004587b75d725si12919052edr.47.2022.10.05.08.35.20; Wed, 05 Oct 2022 08:35:47 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230219AbiJEPbd (ORCPT + 99 others); Wed, 5 Oct 2022 11:31:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229819AbiJEPbb (ORCPT ); Wed, 5 Oct 2022 11:31:31 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 48F201A078 for ; Wed, 5 Oct 2022 08:31:30 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 913D9113E; Wed, 5 Oct 2022 08:31:36 -0700 (PDT) Received: from wubuntu (unknown [10.57.32.122]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 89D5F3F67D; Wed, 5 Oct 2022 08:31:27 -0700 (PDT) Date: Wed, 5 Oct 2022 16:31:25 +0100 From: Qais Yousef To: John Stultz Cc: LKML , Connor O'Brien , John Dias , Rick Yiu , John Kacur , Chris Redpath , Abhijeet Dharmapurikar , Peter Zijlstra , Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Thomas Gleixner , kernel-team@android.com, "J . Avila" Subject: Re: [RFC PATCH v3 2/3] sched: Avoid placing RT threads on cores handling long softirqs Message-ID: <20221005153125.3apfpzhqs3mx6deg@wubuntu> References: <20220921012550.3288570-1-jstultz@google.com> <20220921012550.3288570-3-jstultz@google.com> <20220928125517.ei64pxfucaem55cr@wubuntu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE 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 10/03/22 09:55, John Stultz wrote: [...] > > > int target = find_lowest_rq(p); > > > @@ -1656,11 +1699,14 @@ select_task_rq_rt(struct task_struct *p, int cpu, int flags) > > > goto out_unlock; > > > > > > /* > > > - * Don't bother moving it if the destination CPU is > > > + * If cpu is non-preemptible, prefer remote cpu > > > + * even if it's running a higher-prio task. > > > + * Otherwise: Don't bother moving it if the destination CPU is > > > * not running a lower priority task. > > > */ > > > if (target != -1 && > > > - p->prio < cpu_rq(target)->rt.highest_prio.curr) > > > + (may_not_preempt || > > > + p->prio < cpu_rq(target)->rt.highest_prio.curr)) > > > cpu = target; > > > > I'm not sure this makes sense. You assume a higher priority task will cause > > less delay than softirqs. Which I think is an optimistic assumption? > > > > I think we should just mimic the same fallback behavior when we fail to find > > a CPU that fits the capacity requirement. Keeps things more consistent IMO. > > This sounds reasonable. I do fret that long-running rt tasks are less > common then the long running softirqs, so this may have an impact to > the effectiveness of the patch, but I also suspect it's even more rare > to have all the other cpus busy with rt tasks, so its probably very > unlikely. Yes. I think it is a hard problem to hit as all these other RT tasks must be higher priority. So if this ever happens, then one should question if the priority is set correctly for the audio threads first. Or why there are so many higher priority tasks running for so long. Thanks! -- Qais Yousef