Skip to contentSkip to conversation

sched/core: Remove the unused schedule_user() function

PATCH In review Eiichi Tsukata 3 participants 4 messages Jul 27, 2019 – Jul 29, 2019 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched/core: Remove the unused schedule_user() function

Since commit 02bc7768fe44 ("x86/asm/entry/64: Migrate error and IRQ exit work to C and remove old assembly code"), it's no longer used.

---
 kernel/sched/core.c | 19 -------------------
 1 file changed, 19 deletions(-)
kernel/sched/core.c +0 -19
index 2b037f195473..0079bebe0086 100644
@@ -3973,25 +3973,6 @@ void __sched schedule_idle(void)
 	} while (need_resched());
 }
 
-#ifdef CONFIG_CONTEXT_TRACKING
-asmlinkage __visible void __sched schedule_user(void)
-{
-	/*
-	 * If we come here after a random call to set_need_resched(),
-	 * or we have been woken up remotely but the IPI has not yet arrived,
-	 * we haven't yet exited the RCU idle mode. Do it here manually until
-	 * we find a better solution.
-	 *
-	 * NB: There are buggy callers of this function.  Ideally we
-	 * should warn if prev_state != CONTEXT_USER, but that will trigger
-	 * too frequently to make sense yet.
-	 */
-	enum ctx_state prev_state = exception_enter();
-	schedule();
-	exception_exit(prev_state);
-}
-#endif
-
 /**
  * schedule_preempt_disabled - called with preemption disabled
  *
Signature · 1 line
2.21.0
#1 lore raw
Quoted 2 lines · Eiichi Tsukata

Since commit 02bc7768fe44 ("x86/asm/entry/64: Migrate error and IRQ exit work to C and remove old assembly code"), it's no longer used.

It seems to me that powerpc and sparc are still using it?

$ git grep SCHEDULE_USER
arch/powerpc/include/asm/context_tracking.h:#define SCHEDULE_USER bl    schedule_user
arch/powerpc/include/asm/context_tracking.h:#define SCHEDULE_USER bl    schedule
arch/powerpc/kernel/entry_64.S: SCHEDULE_USER
arch/sparc/kernel/rtrap_64.S:# define SCHEDULE_USER schedule_user
arch/sparc/kernel/rtrap_64.S:# define SCHEDULE_USER schedule
arch/sparc/kernel/rtrap_64.S:           call                    SCHEDULE_USER

Cheers

--
Qais Yousef

Quoted 39 lines
---
 kernel/sched/core.c | 19 -------------------
 1 file changed, 19 deletions(-)
kernel/sched/core.c +0 -19
index 2b037f195473..0079bebe0086 100644
@@ -3973,25 +3973,6 @@ void __sched schedule_idle(void)
 	} while (need_resched());
 }
 
-#ifdef CONFIG_CONTEXT_TRACKING
-asmlinkage __visible void __sched schedule_user(void)
-{
-	/*
-	 * If we come here after a random call to set_need_resched(),
-	 * or we have been woken up remotely but the IPI has not yet arrived,
-	 * we haven't yet exited the RCU idle mode. Do it here manually until
-	 * we find a better solution.
-	 *
-	 * NB: There are buggy callers of this function.  Ideally we
-	 * should warn if prev_state != CONTEXT_USER, but that will trigger
-	 * too frequently to make sense yet.
-	 */
-	enum ctx_state prev_state = exception_enter();
-	schedule();
-	exception_exit(prev_state);
-}
-#endif
-
 /**
  * schedule_preempt_disabled - called with preemption disabled
  *
Signature · 1 line
2.21.0
#2 lore raw
Quoted 14 lines · Qais Yousef
Quoted 2 lines · Eiichi Tsukata

Since commit 02bc7768fe44 ("x86/asm/entry/64: Migrate error and IRQ exit work to C and remove old assembly code"), it's no longer used.

It seems to me that powerpc and sparc are still using it?

$ git grep SCHEDULE_USER
arch/powerpc/include/asm/context_tracking.h:#define SCHEDULE_USER bl    schedule_user
arch/powerpc/include/asm/context_tracking.h:#define SCHEDULE_USER bl    schedule
arch/powerpc/kernel/entry_64.S: SCHEDULE_USER
arch/sparc/kernel/rtrap_64.S:# define SCHEDULE_USER schedule_user
arch/sparc/kernel/rtrap_64.S:# define SCHEDULE_USER schedule
arch/sparc/kernel/rtrap_64.S:           call                    SCHEDULE_USER
Quoted 5 lines

Cheers

--
Qais Yousef

Sorry, I misused cscope. The function is still used as you say.

Thanks

Eiichi

maintainer
#3 lore raw
In reply to Eiichi Tsukata
Quoted 2 lines · Eiichi Tsukata

Since commit 02bc7768fe44 ("x86/asm/entry/64: Migrate error and IRQ exit work to C and remove old assembly code"), it's no longer used.

Thanks!