[v12,3/8] sched/core: Propagate parent task's latency requirements to the child task
Message ID | 20230224093454.956298-4-vincent.guittot@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:7b8e:b0:9f:8c76:fea4 with SMTP id j14csp1222491dyk; Fri, 24 Feb 2023 01:39:06 -0800 (PST) X-Google-Smtp-Source: AK7set/vTTTkeP9FEMI0tFMe6WwFTbi23CFR6EYIMMKGDmOq4HzlFDeKil3d3LsnbQhNQZ5ip7Ks X-Received: by 2002:a17:907:1c0f:b0:8d7:6699:3ba9 with SMTP id nc15-20020a1709071c0f00b008d766993ba9mr18340843ejc.29.1677231545992; Fri, 24 Feb 2023 01:39:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677231545; cv=none; d=google.com; s=arc-20160816; b=nZOvlw3yvtKAaFHWV5pHIKymTykgJZZSe1y7hVtfNAqPkcxKqjrJNh1byMs9jAC6jV w4P+0NI12A9iDOdn8O/LswakvABSH7lF9yTeqd264QMM0KBcCrTehPUYj6rw+GC+z1oZ uAEABnajMPDk4sPgaU3sMaSTBSYN6YXHlTNezVKW6jKaU/lnBlT0hZg5Qc7HYEg37cH1 xqVW5rRCaiYBwCHxkOSjh1KyJ9+oTk0h0gicTgp7Uz1EdoXoXOlz1yp613NW+KNfc94T 1a5+wIPo79iLMk0kHVV7AjhNe5R6W8TyXdJorV1uQe4AAkxsohynuEF53S0/cz4Ur4jz MhXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Oe0Uu935GUv7Os5h4xnlj3hjmH+1d59YLoRXBZZGIAY=; b=Y7OWs4koW91wwdQunVfYP+OF0o/Anl5qnWsGZXyo3eTrI5KflgFx6UFFvEsShLdu4c JbjN8BHZdXsxKOJCfk+e1OjtPf+5kMlPyudc6nF0WwNLht+Qhj2vNJl/oPtt1VTNjKZz E86n8FxF56Q4fyV601ZKQ7/+7PZCou9C3IrIcBlV5f+8M/UXJj2z9qNosodk46vHw+8P Y0ex5k9b2/6Swqf9fQZ8sunotTj46N0EtnbEm6HwR5zK8yCh11e/8wdYwZcTgwBxfEQu r6rO6IMoJnktAQmYss6rLCrzEt9/ERwSzOYgxR343Z+0+Zjj/dDwTmTN1R5aJAzEWjFV l7iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="M/oQDDEh"; 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 j3-20020a170906534300b008bd243fe7easi27275838ejo.776.2023.02.24.01.38.43; Fri, 24 Feb 2023 01:39:05 -0800 (PST) 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="M/oQDDEh"; 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 S229798AbjBXJfN (ORCPT <rfc822;jeff.pang.chn@gmail.com> + 99 others); Fri, 24 Feb 2023 04:35:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229684AbjBXJfF (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 24 Feb 2023 04:35:05 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45BBD4DBCA for <linux-kernel@vger.kernel.org>; Fri, 24 Feb 2023 01:35:03 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id az36so1396295wmb.1 for <linux-kernel@vger.kernel.org>; Fri, 24 Feb 2023 01:35:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Oe0Uu935GUv7Os5h4xnlj3hjmH+1d59YLoRXBZZGIAY=; b=M/oQDDEh1x3rok6xB3rswBzsh2CRxoaZDID2byS65RkMGb0GDD3MqQmZH9MppTnquq fTby+i2kplGA5hVWZsaxpw1fs5xuLjf142dgQ0zIhorxZwv1qQC743lB+ZBvxIB3XpgX ejykMcqofVFzvaWswtOlR/1nyi3ch4k59aW9F2s1awuNUohXaJ6NmHbZ042zD6GD2Lwm 8ex+yj1V149qNPNyUdSrZ1rxeAVrMLA081+RP1BnvvM8je801xgRaPigur0shh0gwhxr PCqmbsxGGIhXYM9IQZM/+ChhpzH7cxxHHVenlx5XW5jPf/1IM8YtzbrnZziibwY+MF2w zS0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version: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=Oe0Uu935GUv7Os5h4xnlj3hjmH+1d59YLoRXBZZGIAY=; b=Es51guq9AlM+fpaR3dadBmfupp3E+yM9aVkxUJz2W+qrvweaqTTHJCK+BjG3SRo78m JkH0thsIRWBTkVUoF5+8MyiToktKnM1RIt+5bjC+xukETy1/4ALD+dJzCaIBHp7d1Bon rDXNfDLKmky9cVGweHmOmBjYqpsToLpXlq3jqyGNOAlPPAigfXCn5WhWIJk3GG0nJmln eifUG4syrrWPMautVR0xcTwF9FFt6GqQ0xFPc1lLB0wbXK4feiFoCDCoxsmFnvzXVKa0 2ztMuomqgv1hG/9PLhyokIIzChBMba8DH1pJNBS2ddkZSH7zqri/bgAwVDuvsxUYS+tN BKTw== X-Gm-Message-State: AO0yUKUWnpxas0ZOdizexXcxdz5IlOc0COhnN8ecnWc7CvHcRxM5wWiG VM5/5fd+pQ2mUBcH2yqbRdqUTTgpCqYz3jwT X-Received: by 2002:a05:600c:4d21:b0:3ea:e4bb:340c with SMTP id u33-20020a05600c4d2100b003eae4bb340cmr2641552wmp.18.1677231301533; Fri, 24 Feb 2023 01:35:01 -0800 (PST) Received: from vingu-book.. ([2a01:e0a:f:6020:a6f0:4ee9:c103:44cb]) by smtp.gmail.com with ESMTPSA id d18-20020a05600c34d200b003e6dcd562a6sm2239179wmq.28.2023.02.24.01.35.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Feb 2023 01:35:00 -0800 (PST) From: Vincent Guittot <vincent.guittot@linaro.org> 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, tj@kernel.org, lizefan.x@bytedance.com, hannes@cmpxchg.org, cgroups@vger.kernel.org, corbet@lwn.net, linux-doc@vger.kernel.org Cc: qyousef@layalina.io, chris.hyser@oracle.com, patrick.bellasi@matbug.net, David.Laight@aculab.com, pjt@google.com, pavel@ucw.cz, 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 <vincent.guittot@linaro.org> Subject: [PATCH v12 3/8] sched/core: Propagate parent task's latency requirements to the child task Date: Fri, 24 Feb 2023 10:34:49 +0100 Message-Id: <20230224093454.956298-4-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230224093454.956298-1-vincent.guittot@linaro.org> References: <20230224093454.956298-1-vincent.guittot@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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=unavailable 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758704745656593307?= X-GMAIL-MSGID: =?utf-8?q?1758704745656593307?= |
Series |
Add latency priority for CFS class
|
|
Commit Message
Vincent Guittot
Feb. 24, 2023, 9:34 a.m. UTC
From: Parth Shah <parth@linux.ibm.com> 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 <parth@linux.ibm.com> [rebase] Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org> Tested-by: K Prateek Nayak <kprateek.nayak@amd.com> --- 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 4580fe3e1d0c..28b397f9698b 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -4681,6 +4681,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: