From nobody Mon Nov 25 11:22:25 2024 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70BD21D88AC for ; Mon, 28 Oct 2024 10:43:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730112227; cv=none; b=Y43v6bRAF0bQkMibRwM7IZ/nxKYIJd+CldrYwyvq/8E/pV7DjD5J3WnlH04OVqOQQeGwQG21G6uWvJEuDvE6iMtL2KRcEBfyorE5vNG9idFbNN4WtPDr8fz46SWSmXEeY1nDtlbv68hWI3tlAWGXTM28PV3yFLFoGL7CfNbOCkk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730112227; c=relaxed/simple; bh=p87L0U/wfgeWAEMV0TRvnldY0DFh6yspZEZFR/aI/jI=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=cfHYdl5qH/vor4ruLqdx1RF7JmIMeSCUf6qPaKOyweFSrsm8YbRfIGQY37/6Rtkic17UFxjw1CmIV/vBN56zM8RYdD2cXCDsuQVE2NEvfqaJ03coJMZ1+2NdKY5fgcBVWgCIfG22Cg/igzh3p2LB1xpT0ZLMQ4LgMD17eJ6q8Q8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=qLNLtPAF; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=RMcTOJSu; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="qLNLtPAF"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="RMcTOJSu" Message-ID: <20241028103142.423153706@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1730112223; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=8V9BMISLe+emg3tqf6WBDnIjWn20ZCDDb1a0hEN5uUQ=; b=qLNLtPAFOUQqVGi9YaQuXAvmlhkZXUc5MY2L3mUxrd0zQrBAwdSh3dFrfGnegyUoaDUNOL FcGqQvwf/SsjGVnNTzsHXIo5kesoeapMfMqoRxuWkygF0228NlGRUUulBoBuHIfUxeMDMS QM7MPW4SKUJLW3jU/1jSoIOJDn2saYfDpNvBI7t3EOBP3sUGcEVXwPWXzTGIL5MlQTBuCq MScWBZvt+cOQLTmexKDZjuYe2oQzAg8JMY5ErRkSpJAnVNUxkna0HrpObbcKvcTxAKwbiV BQvULmC7B1kBNqKmgokT0B8Ek58nopQNq9x2Sz9JwV9zCk7X/qP3e/oM9lDIYQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1730112223; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=8V9BMISLe+emg3tqf6WBDnIjWn20ZCDDb1a0hEN5uUQ=; b=RMcTOJSuPsXLBGtu+xnTbDBPjkc+ZnBCqYfj+5Na8Ao+PgNp3ENrq7JtFfkkK2djbXG0PI Ve1rODsJ454IqADQ== From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Tejun Heo , David Vernet , Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Ingo Molnar Subject: [patch 2/2] sched/ext: Remove sched_fork() hack References: <20241028103006.008053168@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Mon, 28 Oct 2024 11:43:43 +0100 (CET) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Cc: Tejun Heo Cc: David Vernet Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Juri Lelli Cc: Vincent Guittot Cc: Dietmar Eggemann Cc: Steven Rostedt Cc: Ben Segall Cc: Mel Gorman Cc: Valentin Schneider --- 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 =20 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 =3D -1;