All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rasmus Villemoes <ravi@prevas.dk>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
	 Peter Zijlstra <peterz@infradead.org>,
	 Tejun Heo <tj@kernel.org>,  David Vernet <void@manifault.com>,
	 Ingo Molnar <mingo@kernel.org.com>,
	 Juri Lelli <juri.lelli@redhat.com>,
	 Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	 Steven Rostedt <rostedt@goodmis.org>,
	 Ben Segall <bsegall@google.com>,  Mel Gorman <mgorman@suse.de>,
	 Valentin Schneider <vschneid@redhat.com>,
	 Ingo Molnar <mingo@kernel.org>
Subject: Re: [patch 2/2] sched/ext: Remove sched_fork() hack
Date: Mon, 28 Oct 2024 13:30:15 +0100	[thread overview]
Message-ID: <87zfmojtpk.fsf@prevas.dk> (raw)
In-Reply-To: <20241028103142.423153706@linutronix.de> (Thomas Gleixner's message of "Mon, 28 Oct 2024 11:43:43 +0100 (CET)")

On Mon, Oct 28 2024, Thomas Gleixner <tglx@linutronix.de> wrote:

> Instead of solving the underlying problem of the double invocation of
> __sched_fork() for idle tasks, sched-ext decided to hack around the issue
> by partially clearing out the entity struct to preserve the already
> enqueued node. A provided analysis and solution has been ignored for four
> months.
>
> Now that someone else has taken care of cleaning it up, remove the
> disgusting hack and clear out the full structure.
>
> Fixes: f0e1a0643a59 ("sched_ext: Implement BPF extensible scheduler class")
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Cc: Tejun Heo <tj@kernel.org>
> Cc: David Vernet <void@manifault.com>
> Cc: Ingo Molnar <mingo@kernel.org.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Juri Lelli <juri.lelli@redhat.com>
> Cc: Vincent Guittot <vincent.guittot@linaro.org>
> Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Ben Segall <bsegall@google.com>
> Cc: Mel Gorman <mgorman@suse.de>
> Cc: Valentin Schneider <vschneid@redhat.com>
> ---
>  kernel/sched/ext.c |    7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
>
> --- a/kernel/sched/ext.c
> +++ b/kernel/sched/ext.c
> @@ -3548,12 +3548,7 @@ static void scx_ops_exit_task(struct tas
>  
>  void init_scx_entity(struct sched_ext_entity *scx)
>  {
> -	/*
> -	 * init_idle() calls this function again after fork sequence is
> -	 * complete. Don't touch ->tasks_node as it's already linked.
> -	 */
> -	memset(scx, 0, offsetof(struct sched_ext_entity, tasks_node));
> -
> +	memset(scx, 0, sizeof(*scx));
>  	INIT_LIST_HEAD(&scx->dsq_list.node);
>  	RB_CLEAR_NODE(&scx->dsq_priq);
>  	scx->sticky_cpu = -1;

Should the "must be the last" comment in include/linux/sched/ext.h also
be removed?

Rasmus

  reply	other threads:[~2024-10-28 12:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-28 10:43 [patch 0/2] sched: Cleanup idle task double initialization Thomas Gleixner
2024-10-28 10:43 ` [patch 1/2] sched: Initialize idle tasks only once Thomas Gleixner
2024-11-06 10:48   ` [tip: sched/core] " tip-bot2 for Thomas Gleixner
2024-10-28 10:43 ` [patch 2/2] sched/ext: Remove sched_fork() hack Thomas Gleixner
2024-10-28 12:30   ` Rasmus Villemoes [this message]
2024-10-28 12:58     ` Thomas Gleixner
2024-10-28 13:20   ` [patch v1A " Thomas Gleixner
2024-10-28 17:37     ` Tejun Heo
2024-11-06 10:48     ` [tip: sched/core] " tip-bot2 for Thomas Gleixner

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=87zfmojtpk.fsf@prevas.dk \
    --to=ravi@prevas.dk \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@kernel.org \
    --cc=mingo@kernel.org.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=void@manifault.com \
    --cc=vschneid@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.