Skip to content

Commit

Permalink
locking: Add __sched to semaphore functions
Browse files Browse the repository at this point in the history
The internal functions are marked with __sched already, let's do the same
for external functions too so that we can skip them in the stack trace.

Signed-off-by: Namhyung Kim <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
  • Loading branch information
namhyung authored and Peter Zijlstra committed Sep 15, 2022
1 parent 48dfb5d commit 0d97db0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions kernel/locking/semaphore.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static noinline void __up(struct semaphore *sem);
* Use of this function is deprecated, please use down_interruptible() or
* down_killable() instead.
*/
void down(struct semaphore *sem)
void __sched down(struct semaphore *sem)
{
unsigned long flags;

Expand All @@ -74,7 +74,7 @@ EXPORT_SYMBOL(down);
* If the sleep is interrupted by a signal, this function will return -EINTR.
* If the semaphore is successfully acquired, this function returns 0.
*/
int down_interruptible(struct semaphore *sem)
int __sched down_interruptible(struct semaphore *sem)
{
unsigned long flags;
int result = 0;
Expand All @@ -101,7 +101,7 @@ EXPORT_SYMBOL(down_interruptible);
* -EINTR. If the semaphore is successfully acquired, this function returns
* 0.
*/
int down_killable(struct semaphore *sem)
int __sched down_killable(struct semaphore *sem)
{
unsigned long flags;
int result = 0;
Expand Down Expand Up @@ -131,7 +131,7 @@ EXPORT_SYMBOL(down_killable);
* Unlike mutex_trylock, this function can be used from interrupt context,
* and the semaphore can be released by any task or interrupt.
*/
int down_trylock(struct semaphore *sem)
int __sched down_trylock(struct semaphore *sem)
{
unsigned long flags;
int count;
Expand All @@ -156,7 +156,7 @@ EXPORT_SYMBOL(down_trylock);
* If the semaphore is not released within the specified number of jiffies,
* this function returns -ETIME. It returns 0 if the semaphore was acquired.
*/
int down_timeout(struct semaphore *sem, long timeout)
int __sched down_timeout(struct semaphore *sem, long timeout)
{
unsigned long flags;
int result = 0;
Expand All @@ -180,7 +180,7 @@ EXPORT_SYMBOL(down_timeout);
* Release the semaphore. Unlike mutexes, up() may be called from any
* context and even by tasks which have never called down().
*/
void up(struct semaphore *sem)
void __sched up(struct semaphore *sem)
{
unsigned long flags;

Expand Down

0 comments on commit 0d97db0

Please sign in to comment.