kernel: Remove superfluous thread_is_sliceable() call
Within z_sched_ipi() there is no need for the thread_is_sliceable() test as z_time_slice() performs that check. Since as a result of this thread_is_sliceable() is now only used within timeslicing.c, the 'static' keyword is applied to it. Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
This commit is contained in:
committed by
Henrik Brix Andersen
parent
fe039cb07b
commit
d05d9454bf
@@ -73,7 +73,6 @@ void z_ready_thread(struct k_thread *thread);
|
||||
void z_requeue_current(struct k_thread *curr);
|
||||
struct k_thread *z_swap_next_thread(void);
|
||||
void move_current_to_end_of_prio_q(void);
|
||||
bool thread_is_sliceable(struct k_thread *thread);
|
||||
|
||||
static inline void z_reschedule_unlocked(void)
|
||||
{
|
||||
|
||||
@@ -191,9 +191,7 @@ void z_sched_ipi(void)
|
||||
#endif /* CONFIG_TRACE_SCHED_IPI */
|
||||
|
||||
#ifdef CONFIG_TIMESLICING
|
||||
if (thread_is_sliceable(_current)) {
|
||||
z_time_slice();
|
||||
}
|
||||
z_time_slice();
|
||||
#endif /* CONFIG_TIMESLICING */
|
||||
|
||||
#ifdef CONFIG_ARCH_IPI_LAZY_COPROCESSORS_SAVE
|
||||
|
||||
@@ -36,7 +36,7 @@ static inline int slice_time(struct k_thread *thread)
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool thread_is_sliceable(struct k_thread *thread)
|
||||
static bool thread_is_sliceable(struct k_thread *thread)
|
||||
{
|
||||
bool ret = thread_is_preemptible(thread)
|
||||
&& slice_time(thread) != 0
|
||||
@@ -99,7 +99,7 @@ void k_thread_time_slice_set(struct k_thread *thread, int32_t thread_slice_ticks
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Called out of each timer interrupt */
|
||||
/* Called out of each timer and IPI interrupt */
|
||||
void z_time_slice(void)
|
||||
{
|
||||
k_spinlock_key_t key = k_spin_lock(&_sched_spinlock);
|
||||
|
||||
Reference in New Issue
Block a user