mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zqiang <qiang.zhang@linux.dev>
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	[thread overview]
Message-ID: <20251117125311.107687-2-qiang.zhang@linux.dev> (raw)
In-Reply-To: <20251117125311.107687-1-qiang.zhang@linux.dev>

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 <qiang.zhang@linux.dev>
---
 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_kind kind)
 	}
 }
 
-static void free_kick_syncs_rcu(struct rcu_head *rcu)
-{
-	struct scx_kick_syncs *ksyncs = 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)
 
 		to_free = rcu_replace_pointer(*ksyncs, NULL, true);
 		if (to_free)
-			call_rcu(&to_free->rcu, free_kick_syncs_rcu);
+			kvfree_rcu(to_free, rcu);
 	}
 }
 
-- 
2.48.1


  reply	other threads:[~2025-11-17 12:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-17 12:53 [PATCH] sched_ext: Use IRQ_WORK_INIT_HARD() to initialize rq->scx.kick_cpus_irq_work Zqiang
2025-11-17 12:53 ` Zqiang [this message]
2025-11-17 15:18   ` [PATCH] sched_ext: Use kvfree_rcu() to release per-cpu ksyncs object Tejun Heo
2025-11-17 15:15 ` [PATCH] sched_ext: Use IRQ_WORK_INIT_HARD() to initialize rq->scx.kick_cpus_irq_work Tejun Heo

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=20251117125311.107687-2-qiang.zhang@linux.dev \
    --to=qiang.zhang@linux.dev \
    --cc=arighi@nvidia.com \
    --cc=changwoo@igalia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qiang.zhang1211@gmail.com \
    --cc=sched-ext@lists.linux.dev \
    --cc=tj@kernel.org \
    --cc=void@manifault.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®