From nobody Tue Dec 2 02:52:31 2025 Received: from out-185.mta0.migadu.com (out-185.mta0.migadu.com [91.218.175.185]) (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 AC94A25C809 for ; Mon, 17 Nov 2025 12:53:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.185 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763384016; cv=none; b=N/NAZ0nRb5GsORDcASvXHhN7XYPbsRFJ9YfQNSvQHNZnbrrAACmblraXG5nkxzf0dg3Ck3/MzmGBS8aOsY6NZokYcjhJ8Zv3VhzgLLOIgmTC6tAVFAmVYgRQdoRW1pb5d8kQWeIqvHUNfOd0q6KTciBoPoD7e1pBQexC/48dEFY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763384016; c=relaxed/simple; bh=/kpQpvlYJPvcSZkI3pab8KS3SY9zhU/qLB0PelVX3+4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R0UxCR+syBDBYK7joxUHnW0eeRMUhPzS6ZzD50yNX5vj0Zh+Yh4uW8YCXSSIOPAHmch84ympdmjQw2KMdHwkJjdhv7Ce4EvIS2IoOVWJ0rT1uptbZ5jAlKZoXjzF02qA0gQkgdcqt9GqK++yqpxpK/xRAOjh546cxDqzl+7+uO0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=iqZ7Q3jk; arc=none smtp.client-ip=91.218.175.185 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="iqZ7Q3jk" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1763384007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jAy8cmz2p+czQC2sX+kbLgrJS6zsZipV2vS2Etsh/R4=; b=iqZ7Q3jkqAB48fLN0E5wMX84m9374hJhcsTzbUoYZ2pEMK7GmPCtE4/g/kAunlLlhQvY9U NBvwRfEsbkWYurJzB1HwaODOR2UT1S8tDaAmZ1ifDMtIrNz3GUfGRYGzFHq/PsSfSFdLn1 iWtPCRgFwjpH0wWH5k62czrdLnas4UU= From: Zqiang To: tj@kernel.org, void@manifault.com, arighi@nvidia.com, changwoo@igalia.com Cc: sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org, qiang.zhang@linux.dev, qiang.zhang1211@gmail.com Subject: [PATCH] sched_ext: Use kvfree_rcu() to release per-cpu ksyncs object Date: Mon, 17 Nov 2025 20:53:11 +0800 Message-ID: <20251117125311.107687-2-qiang.zhang@linux.dev> In-Reply-To: <20251117125311.107687-1-qiang.zhang@linux.dev> References: <20251117125311.107687-1-qiang.zhang@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" The free_kick_syncs_rcu() rcu-callback only invoke kvfree() to release per-cpu ksyncs object, this can use kvfree_rcu() replace call_rcu() to release per-cpu ksyncs object in the free_kick_syncs(). Signed-off-by: Zqiang --- kernel/sched/ext.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c index c8de9ec70d75..fe94daea7889 100644 --- a/kernel/sched/ext.c +++ b/kernel/sched/ext.c @@ -4161,13 +4161,6 @@ static const char *scx_exit_reason(enum scx_exit_kin= d kind) } } =20 -static void free_kick_syncs_rcu(struct rcu_head *rcu) -{ - struct scx_kick_syncs *ksyncs =3D container_of(rcu, struct scx_kick_syncs= , rcu); - - kvfree(ksyncs); -} - static void free_kick_syncs(void) { int cpu; @@ -4178,7 +4171,7 @@ static void free_kick_syncs(void) =20 to_free =3D rcu_replace_pointer(*ksyncs, NULL, true); if (to_free) - call_rcu(&to_free->rcu, free_kick_syncs_rcu); + kvfree_rcu(to_free, rcu); } } =20 --=20 2.48.1