Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6299292rwn; Tue, 13 Sep 2022 02:00:43 -0700 (PDT) X-Google-Smtp-Source: AA6agR6aLouDwSOjLr6wf3KJ+X/9DZ66mSTmACNz6ucRtfvoUsyWXWm5M1t2L4BcBBbN2QYPiRpA X-Received: by 2002:a17:902:ef50:b0:171:516d:d2ce with SMTP id e16-20020a170902ef5000b00171516dd2cemr29676335plx.171.1663059643576; Tue, 13 Sep 2022 02:00:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663059643; cv=none; d=google.com; s=arc-20160816; b=ocLi/rpWd0VBggPNB5AZyWo4yVGQgOuZyg8Fdtlv0YTA3li208H0Leftem+4zAbCLI iKqTodAEu6QJJhzGTPo/A/53O9UL3JAV3Us5Pwr69Xv9YwaqRTC7Q/b2qKNDHtrYJxvG ukXsDqFn5a6sChsY2yvT21VXRdo3Bjvn7tEXgriNRt46Eoy5yTgmed/VeMJzFLzmtTVT f43fb67h87I6NdBU4Y3YRdOK382pLsSCnrZBcfvMooBV7CfcvVfMrq7zXftf2ze4Ej+V 33LUI12YdrwZ9Zigxv50Nr7TAAzHd+lIDX130zDOp2FGR7M23dcml4MxZdToj9ChZieN 39yw== 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=65VDpIBxJ/IKZQ4sgA2HdVbfOJGF8riVXodtuFxvN2I=; b=DhQM/XwqHoGtltxnevbpjcCMBq1EO7vj/5wvJwXCk4XAR3uRPWcwJzmjzYsCrDOS51 gBW4C0XvTiu2rwKi2sffYwueEv4aftrDGZ7WCiqNXWnRCt4hG6tZVFhx1LdWcadm4Vg+ Rtz/DHg5TNoWY+6J/MEHofbClU8SbQqm4eSmU/95WMbp2b9FinM3cubAFLiPr8/ZtlQH m/hRTHf6ORDMYg+YM/yp3tV2letMb1YLmilR/e47PK1EWcxNwPE6wrQTyy53D8Jbxeh+ +gmiQkpNZvgpWI588e9xR38FDRJo9HH/lMIXG1ajTAmcA2OlA49h5V4TChFYobLfwU+V WjRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NcQcTEQd; 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 cm24-20020a17090afa1800b00200a43d4d58si11164902pjb.80.2022.09.13.02.00.32; Tue, 13 Sep 2022 02:00:43 -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=NcQcTEQd; 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 S231157AbiIMIhc (ORCPT + 99 others); Tue, 13 Sep 2022 04:37:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbiIMIhb (ORCPT ); Tue, 13 Sep 2022 04:37:31 -0400 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92EBE422CD for ; Tue, 13 Sep 2022 01:37:29 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id 9so12579005ljr.2 for ; Tue, 13 Sep 2022 01:37:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=65VDpIBxJ/IKZQ4sgA2HdVbfOJGF8riVXodtuFxvN2I=; b=NcQcTEQdSIxnGT43id3CCJUNW0bBEVVOf6Oe3r6DWcG++C4D5HIVsKFaEq4cu/JcLp JB2LlFdz8hsZrEk5X5jA0EHeH3KlDzbIgF0Y6TgONg+LaK4KPb0vDiYuyY/5f3Ebd8CK mveIOGLWL7LoH0pw1RYgBtvaE6zkaiN2E41bc7p4YWlNOa/La0D2GMi7K3Kh/EEPvsW0 k8SvDcfq+xb1zr0/Hoa8SQFz0mXT4Nk7UiLQthndRQJTb69iWTBb/tLXqdtPOWC8oeIq +0sBG8yPQehkgsFCmcz8rZSNnAdNWb6/XKcLLVMwxwcq2OGxNu7iqbz4k2u4SFCzlhkv el+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=65VDpIBxJ/IKZQ4sgA2HdVbfOJGF8riVXodtuFxvN2I=; b=XJjv9vEkC/sa44Kpk5Wisch+vInFwZwXCkoCw9F977n20vhsH352dQcn4b0HCYFEk5 4lEu3ihTXJjcXdIuxgcQ38ioN2jLhzanEHjGtnxdmMfWyafgOb+oAeWb+33u7p3hvEHo VpVwFghCrI41FJ0nqgfZgIhR0Yk/zmN4lfcJr/+Q7QjQL5SZGvJ4Mo8HqKU+WfMUN3ZJ bTJ3dCRRtV1V2JRYCWbLje6AAg/DZ1bMSN7aapIFsWxFlTGbeKj0gGquh9WGxqqlLfjL JsHf/noJ+31Y4yV6dmSC07hzn8maIBtW2sKtR8OYE9odKx3XbnKKiZBulQD1Ko+keP5Y 7BIw== X-Gm-Message-State: ACgBeo0Yu9Ch7tRwN0/KXGdWC+rhAbNBwkcf7v8sDzMH+ERnaohgx6ts 0O2RFwj9i+quo+CVVIBuu42bqf5pSSryutEPKo0mBw== X-Received: by 2002:a2e:86cf:0:b0:26b:fe50:8c4c with SMTP id n15-20020a2e86cf000000b0026bfe508c4cmr3128621ljj.17.1663058247897; Tue, 13 Sep 2022 01:37:27 -0700 (PDT) MIME-Version: 1.0 References: <20220825122726.20819-1-vincent.guittot@linaro.org> <20220825122726.20819-3-vincent.guittot@linaro.org> <294b8903-393f-7242-a887-6ec6d6fc829e@arm.com> In-Reply-To: <294b8903-393f-7242-a887-6ec6d6fc829e@arm.com> From: Vincent Guittot Date: Tue, 13 Sep 2022 10:37:16 +0200 Message-ID: Subject: Re: [PATCH 2/4] sched/fair: cleanup loop_max and loop_break To: Dietmar Eggemann Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, linux-kernel@vger.kernel.org, zhangqiao22@huawei.com 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 Mon, 12 Sept 2022 at 10:45, Dietmar Eggemann wrote: > > On 25/08/2022 14:27, Vincent Guittot wrote: > > sched_nr_migrate_break is set to a fix value and never changes so we can > > replace it by a define SCHED_NR_MIGRATE_BREAK. > > > > Also, we adjust SCHED_NR_MIGRATE_BREAK to be aligned with the init value > > of sysctl_sched_nr_migrate which can be init to different values. > > > > Then, use SCHED_NR_MIGRATE_BREAK to init sysctl_sched_nr_migrate. > > > > The behavior stays unchanged unless you modify sysctl_sched_nr_migrate > > trough debugfs. > > I don't quite get this sentence. The behavior would potentially change > if you change sysctl_sched_nr_migrate before this patch too? the behavior is different if you change the sysctl_sched_nr_migrate. With this patch, loop_break is now aligned with sysctl_sched_nr_migrate value which was not the case for CONFIG_PREEMPT_RT. For the latter, the behavior can change if you increase sysctl_sched_nr_migrate at runtime because there is now at least one break whereas it was not the case before as long as sysctl_sched_nr_migrate stayed below 32 > > > > > Signed-off-by: Vincent Guittot > > --- > > kernel/sched/core.c | 6 +----- > > kernel/sched/fair.c | 11 ++++------- > > kernel/sched/sched.h | 6 ++++++ > > 3 files changed, 11 insertions(+), 12 deletions(-) > > > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > > index 64c08993221b..a21e817bdd1c 100644 > > --- a/kernel/sched/core.c > > +++ b/kernel/sched/core.c > > @@ -142,11 +142,7 @@ __read_mostly int sysctl_resched_latency_warn_once = 1; > > * Number of tasks to iterate in a single balance run. > > * Limited because this is done with IRQs disabled. > > */ > > ^^^ > Shouldn't this comment be removed as well? > > > -#ifdef CONFIG_PREEMPT_RT > > -const_debug unsigned int sysctl_sched_nr_migrate = 8; > > -#else > > -const_debug unsigned int sysctl_sched_nr_migrate = 32; > > -#endif > > +const_debug unsigned int sysctl_sched_nr_migrate = SCHED_NR_MIGRATE_BREAK; > > > > __read_mostly int scheduler_running; > > [...]