linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Parth Shah <parth@linux.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: peterz@infradead.org, mingo@redhat.com,
	vincent.guittot@linaro.org, patrick.bellasi@matbug.net,
	valentin.schneider@arm.com, qais.yousef@arm.com, pavel@ucw.cz,
	dhaval.giani@oracle.com, qperret@qperret.net,
	David.Laight@ACULAB.COM, pjt@google.com, tj@kernel.org,
	dietmar.eggemann@arm.com
Subject: [PATCH v2 2/3] sched/core: Propagate parent task's latency requirements to the child task
Date: Sun,  8 Dec 2019 11:34:09 +0530	[thread overview]
Message-ID: <20191208060410.17814-3-parth@linux.ibm.com> (raw)
In-Reply-To: <20191208060410.17814-1-parth@linux.ibm.com>

Clone parent task's latency_tolerance attribute to the forked child task.

Reset the latency_tolerance value to default value when the child task is
set to sched_reset_on_fork.

Signed-off-by: Parth Shah <parth@linux.ibm.com>
Reviewed-by: Qais Yousef <qais.yousef@arm.com>
---
 kernel/sched/core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 2da6a005bb3f..3f9359d0e326 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2853,6 +2853,9 @@ int sched_fork(unsigned long clone_flags, struct task_struct *p)
 	 */
 	p->prio = current->normal_prio;
 
+	/* Propagate the parent's latency requirements to the child as well */
+	p->latency_tolerance = current->latency_tolerance;
+
 	uclamp_fork(p);
 
 	/*
@@ -2869,6 +2872,7 @@ int sched_fork(unsigned long clone_flags, struct task_struct *p)
 		p->prio = p->normal_prio = __normal_prio(p);
 		set_load_weight(p, false);
 
+		p->latency_tolerance = DEFAULT_LATENCY_TOLERANCE;
 		/*
 		 * We don't need the reset flag anymore after the fork. It has
 		 * fulfilled its duty:
-- 
2.17.2


  parent reply	other threads:[~2019-12-08  6:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-08  6:04 [PATCH v2 0/3] Introduce per-task latency_tolerance for scheduler hints Parth Shah
2019-12-08  6:04 ` [PATCH v2 1/3] sched: Introduce latency-tolerance as a per-task attribute Parth Shah
2019-12-08  6:04 ` Parth Shah [this message]
2019-12-08  6:04 ` [PATCH v2 3/3] sched: Allow sched_{get,set}attr to change latency_tolerance of the task Parth Shah
2020-01-15 20:33 ` [PATCH v2 0/3] Introduce per-task latency_tolerance for scheduler hints Dhaval Giani
2020-01-16 12:04   ` Parth Shah

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191208060410.17814-3-parth@linux.ibm.com \
    --to=parth@linux.ibm.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=dhaval.giani@oracle.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=patrick.bellasi@matbug.net \
    --cc=pavel@ucw.cz \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=qais.yousef@arm.com \
    --cc=qperret@qperret.net \
    --cc=tj@kernel.org \
    --cc=valentin.schneider@arm.com \
    --cc=vincent.guittot@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).