From nobody Mon Apr 13 18:46:22 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9BFEC4332F for ; Tue, 15 Nov 2022 17:19:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238392AbiKORTj (ORCPT ); Tue, 15 Nov 2022 12:19:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237837AbiKORTN (ORCPT ); Tue, 15 Nov 2022 12:19:13 -0500 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F080114012 for ; Tue, 15 Nov 2022 09:19:05 -0800 (PST) Received: by mail-wm1-x329.google.com with SMTP id c3-20020a1c3503000000b003bd21e3dd7aso13622221wma.1 for ; Tue, 15 Nov 2022 09:19:05 -0800 (PST) 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=DgoNBUoh3xxz3SNc31PO9TCe3YvH8+92yCBAOfiBBfg=; b=hR92ngdMg3GykIaP4ffe1GgO/tIUL6mOpgZJ4oKmccAUk9tP3gLq8vTiWyYjvolGJt vvF65JA347Yel2JzgD9Eneke7KfoUhrcJfPS1h1S/DlCWD6MPARG60Dn14vEwcaXxntV OT4pTEJqdz5Ycg4ITjVaH4ip0DLAy+YZ3huhT3MwNPuKmXz+XoXGqhTFBwpn6TlBoCcj D0OmDVl48lyoIgYYcgsLtwpATXsq0XWf9bLIEw0LFwQEE3ZlTw2iByPZDsTAj9tGUjgx 10O/fz1E0RMU/rO8/RngXp/ukrAmD7/1uidZXTiyDnQN/KZNv8LVOnPPcP0ecCIS7NsJ 23kw== 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=DgoNBUoh3xxz3SNc31PO9TCe3YvH8+92yCBAOfiBBfg=; b=cZ+umRTK4WfkpcYJ1Jo3gvHiNaks/Kl5067b5L1W6Gk0uf4vHeSIxvBnWsbyzLowr7 MzFTnf5GyTOw3N5GlcLzBLBAfs7Lp7pM3cD6ajnWw3AJfGm6taCpy5e+5NY+gjYpmz46 6Qlkt44PqAWD39KL178unWOmWWTbtZuhCXFbnPjLnGVZ8q7+AcRnvyyeWFcnuhF/h0/c fH2mrgRGb25Tvfp+dnE/svHd15qGLZWC6K1nafThh6URXFt2njEoAc+5FPfWemVPJgan cLtYBOF/Rgku3+/YKHN5fs4JMA4dd4fmM9hvIxB5axTApcJ3bpJio8bJdjEYz2BS9Jfi 6Q8w== X-Gm-Message-State: ANoB5plJ3eEnsKP1NH+PdYXDNW46yDpwFCOcLD6GZQtiX/YUpNRXsi1V /VkMW/mj66nGS1JWxX68VQyFgA== X-Google-Smtp-Source: AA0mqf4UlrX5D8DgBA1b4vkwpHc3w/tK1dpXtXCJyr65p3JMv5dgCg9uvTJM8CS+sJ2rK6vOYn0ZHg== X-Received: by 2002:a7b:c394:0:b0:3cf:b545:596 with SMTP id s20-20020a7bc394000000b003cfb5450596mr1198667wmj.49.1668532744320; Tue, 15 Nov 2022 09:19:04 -0800 (PST) Received: from localhost.localdomain ([2a01:e0a:f:6020:91c8:7496:8b73:811f]) by smtp.gmail.com with ESMTPSA id bg40-20020a05600c3ca800b003cf78aafdd7sm16846461wmb.39.2022.11.15.09.19.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 09:19:03 -0800 (PST) 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: qyousef@layalina.io, 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 v9 3/9] sched/core: Propagate parent task's latency requirements to the child task Date: Tue, 15 Nov 2022 18:18:45 +0100 Message-Id: <20221115171851.835-4-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221115171851.835-1-vincent.guittot@linaro.org> References: <20221115171851.835-1-vincent.guittot@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 =3D MAX_PRIO - 20, .static_prio =3D MAX_PRIO - 20, .normal_prio =3D MAX_PRIO - 20, + .latency_nice =3D DEFAULT_LATENCY_NICE, .policy =3D SCHED_NORMAL, .cpus_ptr =3D &init_task.cpus_mask, .user_cpus_ptr =3D NULL, diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 07ac08caf019..8c84c652853b 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -4592,6 +4592,7 @@ int sched_fork(unsigned long clone_flags, struct task= _struct *p) p->prio =3D p->normal_prio =3D p->static_prio; set_load_weight(p, false); =20 + p->latency_nice =3D DEFAULT_LATENCY_NICE; /* * We don't need the reset flag anymore after the fork. It has * fulfilled its duty: --=20 2.17.1