Skip to content

Commit 0d97db0

Browse files
namhyungPeter Zijlstra
authored andcommitted
locking: Add __sched to semaphore functions
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 <namhyung@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20220909000803.4181857-1-namhyung@kernel.org
1 parent 48dfb5d commit 0d97db0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

kernel/locking/semaphore.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static noinline void __up(struct semaphore *sem);
5151
* Use of this function is deprecated, please use down_interruptible() or
5252
* down_killable() instead.
5353
*/
54-
void down(struct semaphore *sem)
54+
void __sched down(struct semaphore *sem)
5555
{
5656
unsigned long flags;
5757

@@ -74,7 +74,7 @@ EXPORT_SYMBOL(down);
7474
* If the sleep is interrupted by a signal, this function will return -EINTR.
7575
* If the semaphore is successfully acquired, this function returns 0.
7676
*/
77-
int down_interruptible(struct semaphore *sem)
77+
int __sched down_interruptible(struct semaphore *sem)
7878
{
7979
unsigned long flags;
8080
int result = 0;
@@ -101,7 +101,7 @@ EXPORT_SYMBOL(down_interruptible);
101101
* -EINTR. If the semaphore is successfully acquired, this function returns
102102
* 0.
103103
*/
104-
int down_killable(struct semaphore *sem)
104+
int __sched down_killable(struct semaphore *sem)
105105
{
106106
unsigned long flags;
107107
int result = 0;
@@ -131,7 +131,7 @@ EXPORT_SYMBOL(down_killable);
131131
* Unlike mutex_trylock, this function can be used from interrupt context,
132132
* and the semaphore can be released by any task or interrupt.
133133
*/
134-
int down_trylock(struct semaphore *sem)
134+
int __sched down_trylock(struct semaphore *sem)
135135
{
136136
unsigned long flags;
137137
int count;
@@ -156,7 +156,7 @@ EXPORT_SYMBOL(down_trylock);
156156
* If the semaphore is not released within the specified number of jiffies,
157157
* this function returns -ETIME. It returns 0 if the semaphore was acquired.
158158
*/
159-
int down_timeout(struct semaphore *sem, long timeout)
159+
int __sched down_timeout(struct semaphore *sem, long timeout)
160160
{
161161
unsigned long flags;
162162
int result = 0;
@@ -180,7 +180,7 @@ EXPORT_SYMBOL(down_timeout);
180180
* Release the semaphore. Unlike mutexes, up() may be called from any
181181
* context and even by tasks which have never called down().
182182
*/
183-
void up(struct semaphore *sem)
183+
void __sched up(struct semaphore *sem)
184184
{
185185
unsigned long flags;
186186

0 commit comments

Comments
 (0)