Skip to content

Commit

Permalink
evl/mutex: alert only once on boost drop detection
Browse files Browse the repository at this point in the history
At this chance, privatize some helper macro, dropping an unused one.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
  • Loading branch information
pgerum authored and gyohng committed Dec 28, 2024
1 parent 672384d commit 874cf50
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 0 additions & 6 deletions include/evl/thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,6 @@ struct evl_thread {
char *name;
};

#define for_each_evl_booster(__pos, __thread) \
list_for_each_entry(__pos, &(__thread)->boosters, next_booster)

#define for_each_evl_tracker_safe(__pos, __tmp, __thread) \
list_for_each_entry_safe(__pos, __tmp, &(__thread)->trackers, next_tracker)

static inline void evl_sync_uwindow(struct evl_thread *curr)
{
if (curr->u_window) {
Expand Down
5 changes: 4 additions & 1 deletion kernel/evl/mutex.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
#define for_each_evl_mutex_waiter(__pos, __mutex) \
list_for_each_entry(__pos, &(__mutex)->wchan.wait_list, wait_next)

#define for_each_evl_booster(__pos, __thread) \
list_for_each_entry(__pos, &(__thread)->boosters, next_booster)

static inline int get_ceiling_value(struct evl_mutex *mutex)
{
/*
Expand Down Expand Up @@ -456,7 +459,7 @@ void evl_detect_boost_drop(void)
for_each_evl_booster(mutex, curr) {
raw_spin_lock(&mutex->wchan.lock);
for_each_evl_mutex_waiter(waiter, mutex) {
if (!(waiter->state & T_WOLI))
if (!(waiter->state & (T_WOLI|T_PIALERT)))
continue;
raw_spin_lock(&waiter->rq->lock);
waiter->info |= T_PIALERT;
Expand Down

0 comments on commit 874cf50

Please sign in to comment.