From patchwork Fri Oct 28 07:36:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 12135 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp679146wru; Fri, 28 Oct 2022 00:41:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Rq8iukC8LMB4yguK66aLgF2KRQZzz6R73qyRXDjhlab601F5FXrP+zyLrFIWl0YH40dFr X-Received: by 2002:a17:907:7627:b0:78d:b6f5:9f15 with SMTP id jy7-20020a170907762700b0078db6f59f15mr46575074ejc.149.1666942885094; Fri, 28 Oct 2022 00:41:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666942885; cv=none; d=google.com; s=arc-20160816; b=SkiFqhB9+JkoP/uOxNRYtd6kgk5m/rxnCFFvK9IFu0G4n0fAAfeW8iOtMyeIx8fObf T053iKXYN2y2Pw4ZFAJqH1jgbvrh88kpGQaPRoFmdzehl6/u4UhErwLjTnyFf8Z/AoOb ZOF3UhbZJn3HJ6zZZ3pND7vLbPtLkEXp0dwYN8+mmFL9W6GUUoxwy9aJWURkB1JmNu2e qsQVMnUsZYVFddluV4L/JYzmcGj92IrsEuW5tpSvyVZlO+FL42Zdp8M2ByXUFXJoDaX7 zpZCSCdC/yljJ9ELYPKGI+reLhfW33x+1dKTdAQL9bsIXr0c+2k3/oyN+lzrenWDunib 0dmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=ySpaS8Fkj5Miw0XHBXwZ3O8DcUQ428wDyrUI4Txxz7I=; b=lzloDYayVw2Vn7kJh363lV7/XcyjKxXWx3no3s1cS6PjZXYoyNGR1cFZte+JglrPjC LWYrkajTGLCj16UWQwGcQWt3tH+s/7CV58RmUBWxE3JzZ4EsJjfRcM0BcBHmsU37CkwX Ps+bYQ/BL9K8i4RyvvtZSPmATEazQ7Z5dVhBXm53cPeKvj6VbS2q105SEt7QFXYKbKVA AUVJ0Nl2vjLlj6LrP7sEndGL2pJJh6V9hTJI+d4nkyf4X7o9Wnzqu0hUlwR6BGz9YHxA uL2m6m83/HUvceG0NZx9A68lMPDtUOWyDJuLCv2/AE7/Ep8iINiuL11t68rj5Jp/3mGm TxeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wqSeFbRd; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ji13-20020a170907980d00b0078d85777c4fsi4390918ejc.700.2022.10.28.00.41.01; Fri, 28 Oct 2022 00:41:25 -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=wqSeFbRd; 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 S230206AbiJ1HhC (ORCPT + 99 others); Fri, 28 Oct 2022 03:37:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230185AbiJ1Hg4 (ORCPT ); Fri, 28 Oct 2022 03:36:56 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39B2C1BB579 for ; Fri, 28 Oct 2022 00:36:55 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id h9so5894025wrt.0 for ; Fri, 28 Oct 2022 00:36:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=ySpaS8Fkj5Miw0XHBXwZ3O8DcUQ428wDyrUI4Txxz7I=; b=wqSeFbRdq2adahV/mdUOa1fqJD6aVJJovMUxYS+oMGCv12Q3FUv9AHXl4ggCN9Eo2j 96+U5EEOxOoQZ+FUtLT0YZhrHzFKzFUx9VjE6IzHV2wkARJeZBxUAJfB1VSsKDLs5BSO 5iqzHmI3yJT/4wMQ8sQ5l9fV6ReSQDtOEJfvUAxGwdiIQTaBuL89u4KmgRmWik2XLXIj zefQBzdrz6vtgunooANIBekXTuye4ROpVYuFsXCK98gV1PW5hzRkDB90d/Q+myXBBfXk ltabfUODHhh33AjDCP46QLX32FN7Jn59jmZcoy6SrGYwxVVVZ7D9WW8beT27BrFLYH44 Utpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ySpaS8Fkj5Miw0XHBXwZ3O8DcUQ428wDyrUI4Txxz7I=; b=UmPuyyARMpFtRiab/cg5WDEwrDW5K8nCLxhgiKVBV7R/oLeYBHxez0K+9MZsAq68qj TY3dQiv/dAfCB2II8Wkte221leQ65+m1yI2xcdY9hAYuPmaIXXammXhdQqwllWM0Vtas mmpXrgEMaQbDHjTLqjQAVxFn0cM24zfp4mCJ3NkB0swvVh7HUol725HmAmCKMm7nVFxZ t1UfhDc6fIYJchxPWLO7LrGDdm++w4IPbOUqyBh73lfD7RSBgqwrEGUFVVI1dT1YLu5i dAL4AXYAHnZl1N40I8psVXp6f4h8MEoclSbGjNdBVz9uJgs7DYPBx/bvVV9Qlnouuglr hFWw== X-Gm-Message-State: ACrzQf3TfBJST/uZRj8ZUziMbp46Ltp/dlyR9LfPZTdJuyedesLWXkPE omszR1T5Y8ZbCCJskZlp1waQrQ== X-Received: by 2002:a05:6000:719:b0:236:73ff:9ca3 with SMTP id bs25-20020a056000071900b0023673ff9ca3mr15200834wrb.603.1666942613661; Fri, 28 Oct 2022 00:36:53 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:f:6020:c12b:b448:f0a9:83ef]) by smtp.gmail.com with ESMTPSA id j8-20020a05600c190800b003b47e8a5d22sm7783129wmq.23.2022.10.28.00.36.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 00:36:52 -0700 (PDT) From: Vincent Guittot To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, linux-kernel@vger.kernel.org, parth@linux.ibm.com Cc: qais.yousef@arm.com, chris.hyser@oracle.com, patrick.bellasi@matbug.net, David.Laight@aculab.com, pjt@google.com, pavel@ucw.cz, tj@kernel.org, qperret@google.com, tim.c.chen@linux.intel.com, joshdon@google.com, timj@gnu.org, kprateek.nayak@amd.com, yu.c.chen@intel.com, youssefesmat@chromium.org, joel@joelfernandes.org, Vincent Guittot Subject: [PATCH v6 3/9] sched/core: Propagate parent task's latency requirements to the child task Date: Fri, 28 Oct 2022 09:36:31 +0200 Message-Id: <20221028073637.31195-4-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221028073637.31195-1-vincent.guittot@linaro.org> References: <20221028073637.31195-1-vincent.guittot@linaro.org> 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747916302913893679?= X-GMAIL-MSGID: =?utf-8?q?1747916302913893679?= From: Parth Shah Clone parent task's latency_nice attribute to the forked child task. Reset the latency_nice value to default value when the child task is set to sched_reset_on_fork. Also, initialize init_task.latency_nice value with DEFAULT_LATENCY_NICE value Signed-off-by: Parth Shah [rebase] Signed-off-by: Vincent Guittot --- init/init_task.c | 1 + kernel/sched/core.c | 1 + 2 files changed, 2 insertions(+) diff --git a/init/init_task.c b/init/init_task.c index ff6c4b9bfe6b..7dd71dd2d261 100644 --- a/init/init_task.c +++ b/init/init_task.c @@ -78,6 +78,7 @@ struct task_struct init_task .prio = MAX_PRIO - 20, .static_prio = MAX_PRIO - 20, .normal_prio = MAX_PRIO - 20, + .latency_nice = DEFAULT_LATENCY_NICE, .policy = SCHED_NORMAL, .cpus_ptr = &init_task.cpus_mask, .user_cpus_ptr = NULL, diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 02dc1b8e3cb6..54544353025b 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -4559,6 +4559,7 @@ int sched_fork(unsigned long clone_flags, struct task_struct *p) p->prio = p->normal_prio = p->static_prio; set_load_weight(p, false); + p->latency_nice = DEFAULT_LATENCY_NICE; /* * We don't need the reset flag anymore after the fork. It has * fulfilled its duty: