Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp934450rwi; Wed, 19 Oct 2022 04:58:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM69u0oKSzAZIdmfpSLlMtPLFGaJ5LGCN5/9NvtAZORTuKyIgRY1tSxYCE653oXD9THOl+UW X-Received: by 2002:a17:907:2cf7:b0:78d:c7fc:29ff with SMTP id hz23-20020a1709072cf700b0078dc7fc29ffmr6551623ejc.748.1666180697891; Wed, 19 Oct 2022 04:58:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666180697; cv=none; d=google.com; s=arc-20160816; b=j/N8U0Ct6F11ikqj8Q7X9WfRRvIAOY2P64suDCGYdcKdfOA/IGi7upWQ8LXo77M2bH Xf9RwPaI0dH1FeR87fGJJO50bhY6+6DhhSYdDm+WSKNUxsHOZPeCvaYzvhHT6+EAc0FT i5DcwZxVMXY3gC7n5Fqh8KhcdDaoBsMVOR/cSsa6DOR92v8eOKBNEf9QWjDqHltMpkXO Ez0hpDVyMfwrQ9rIOWAvYMkhyt9IcHRXyIXFALPd47Ge46lcDMN/zUdZZhMtmqvP/hwj rVJllNlYcKUhCBzcXTHQcvt5yARHC4B13P7le86qYOe3H6AhhpFA3S0cKZJRjsTNw4mj iBYw== 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:dkim-signature; bh=qhq4XsHm9zBucvLkrTiP0zAM83hKGzPFColPYSxlPio=; b=o5hfGoojtK465PedAAxy0XeUS9WB6qrC9IGmAzn+LMGM+lgzD9gPdjSfNwMIinux8U LM5RVTfY2srcNwDOrmUMD0/f+KORo/qzpkkV5ieAu3q4sTk8gIaKYBlohcO7sAJE//jV 5ivInbAF5fNQmgVYMIjdTUegXFFM4kpwjYLaAGjLCODcsSY/0yDor5k3pqt23dIHEcZK kjpPfzQTj8sR4I0Drgs12GKxRYKrdLVRhlCYOz5/8qXYiOqaHSSKckHdWEF1z0fYM1Ik T60bhanC0wqvluGsS1JGAHg/I0Q026wCLDBS9wATCMSxHuN9mbi+ujQecIFxkJIkbgho +cyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@layalina-io.20210112.gappssmtp.com header.s=20210112 header.b=yAXpN2Ke; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a26-20020a17090682da00b0078d9d67841fsi11739391ejy.400.2022.10.19.04.57.51; Wed, 19 Oct 2022 04:58:17 -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=@layalina-io.20210112.gappssmtp.com header.s=20210112 header.b=yAXpN2Ke; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229716AbiJSLpD (ORCPT + 99 others); Wed, 19 Oct 2022 07:45:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229867AbiJSLoi (ORCPT ); Wed, 19 Oct 2022 07:44:38 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39A3A2BE39 for ; Wed, 19 Oct 2022 04:24:32 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id j7so28604155wrr.3 for ; Wed, 19 Oct 2022 04:24:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=layalina-io.20210112.gappssmtp.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=qhq4XsHm9zBucvLkrTiP0zAM83hKGzPFColPYSxlPio=; b=yAXpN2Ke1P6pd+fxrUkG227eg+znIQ+GWsECK2wnzTfyQDL2bV/ObDcTf2UjYEB8wJ isKHeIW80H8JamnN9tf3ff+SuGWJAGL4w1vVIt7grjUYgkA4K8znQvv3zKkHOYw51MTw lQFKbUG2ALujj01wwTJrimSn4eJgAxKKwYQnOKgGd7PutIQUo9R8s00gdgwQNXQk6e5h Q5HlQUADVHpqhv2Sijir4Wzt10mwCvP5FLomfFPlbFi8OKfXbUK9O+VuuwoNw+2Pc9lC cocKGnB/Or3sODmrpRN3tHDfKQA8iGTyhqHRnulE0i72oACb3zzC7mloFP/9DKBbqDg/ duwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=qhq4XsHm9zBucvLkrTiP0zAM83hKGzPFColPYSxlPio=; b=es55MxFVVGeOgR3rX54jpr2W2Tzp0k8Bd5XAwxMZKC5AJPi1NDFJfoXuXpQXZfESk3 V6CIDYoTx/OVqku6K2qLP/ryZG/jI1qMyBC4ZmOAWAHoMatSTKevNvCiNYr+zB+oSSBa 3xG5YQEOeeg4NnPIYoG43goD+ZQegxGk3qpnU8NIWbImdL8keSCtX/jTy0nWxaXBYN1m MUBtlimAW1GTAOfCUPR0nt3sAZSiffDq2FnOJ/072wyppbuDt7a9mU7Kg2Qpmbc1Oj7J igAXN+d3CF5+eGOTeQpMiWCeEyBK5GWnwRVLe6ips4v3z/DXw/QVnlF2N98Nov9Aa4E+ iGEA== X-Gm-Message-State: ACrzQf0MWLbgIMtX6B8qH7qhMVozc3kecmH/6gG1VHUt2IaKkd04H73P j9XfShd4zIk+UcX92GMbSQYBNw== X-Received: by 2002:a5d:5988:0:b0:22e:58fe:28cf with SMTP id n8-20020a5d5988000000b0022e58fe28cfmr4690564wri.440.1666178597630; Wed, 19 Oct 2022 04:23:17 -0700 (PDT) Received: from airbuntu (host86-130-134-87.range86-130.btcentralplus.com. [86.130.134.87]) by smtp.gmail.com with ESMTPSA id k16-20020a5d6290000000b0022ae4f8395dsm13056468wru.96.2022.10.19.04.23.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 04:23:17 -0700 (PDT) Date: Wed, 19 Oct 2022 12:23:15 +0100 From: Qais Yousef To: John Stultz Cc: Alexander Gordeev , LKML , Connor O'Brien , John Dias , Rick Yiu , John Kacur , Qais Yousef , 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: [PATCH RFC v4 2/3] sched: Avoid placing RT threads on cores handling long softirqs Message-ID: <20221019112315.7d6wyc7d7dgzwsch@airbuntu> References: <20221003232033.3404802-1-jstultz@google.com> <20221003232033.3404802-3-jstultz@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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/17/22 20:42, John Stultz wrote: > > > + return ret; > > > +} > > > +#else > > > +#define __use_softirq_opt 0 > > > +static bool cpu_busy_with_softirqs(int cpu) > > > +{ > > > + return false; > > > +} > > > +#endif /* CONFIG_RT_SOFTIRQ_OPTIMIZATION */ > > > + > > > +static bool rt_task_fits_cpu(struct task_struct *p, int cpu) > > > > To me, the new name is unfortunate, since it strips a notion > > of the reason. Instead, "CPU un/fits, because of capacity" it > > reads as "CPU un/fits, because of ..." what? > > As with all complicated questions: "It depends" :) On the kernel > config specifically. > > The earlier version of the patch had: > rt_task_fits_capacity_and_may_preempt() but Qais suggested it be > switched to the generic "fits_cpu" as it would depend on the kernel > config as to which aspect of "fit" was being considered. > > I guess it could be rt_task_fits_capacity_and_softirq_free() ? My line of thinking is that we have multiple reasons which could potentially come and go. Having a simple generic name is future proof to the details of the reason. For example, in the future we might find a better way to handle the softirq conflict and remove this reason; or we might find a new 'reason' is required. Documenting that in the function header (if required, I see the one line implementation is self descriptive so far) rather than in name made more sense to me, hence the suggestion. I am already aware of another new reason required to handle thermal pressure when checking for capacity [1]. The discussion has stalled, but the problem is still there and we'd need to address it. So I expect this code will be massaged somewhat in the near future. Sticking to rt_task_fits_cpu() will reduce the churn IMHO. But if you really prefer something else, works for me :-) [1] https://lore.kernel.org/lkml/20220514235513.jm7ul2y6uddj6eh2@airbuntu/ Cheers -- Qais Yousef