projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c0490bc
)
sched/core: Use do-while instead of for loop in set_nr_if_polling()
author
Uros Bizjak
<ubizjak@gmail.com>
Tue, 28 Feb 2023 16:14:26 +0000
(17:14 +0100)
committer
Ingo Molnar
<mingo@kernel.org>
Fri, 15 Sep 2023 15:18:02 +0000
(17:18 +0200)
Use equivalent do-while loop instead of infinite for loop.
There are no asm code changes.
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link:
https://lore.kernel.org/r/20230228161426.4508-1-ubizjak@gmail.com
kernel/sched/core.c
patch
|
blob
|
history
diff --git
a/kernel/sched/core.c
b/kernel/sched/core.c
index
76662d8
..
f39482d
100644
(file)
--- a/
kernel/sched/core.c
+++ b/
kernel/sched/core.c
@@
-919,14
+919,13
@@
static bool set_nr_if_polling(struct task_struct *p)
struct thread_info *ti = task_thread_info(p);
typeof(ti->flags) val = READ_ONCE(ti->flags);
-
for (;;)
{
+
do
{
if (!(val & _TIF_POLLING_NRFLAG))
return false;
if (val & _TIF_NEED_RESCHED)
return true;
- if (try_cmpxchg(&ti->flags, &val, val | _TIF_NEED_RESCHED))
- break;
- }
+ } while (!try_cmpxchg(&ti->flags, &val, val | _TIF_NEED_RESCHED));
+
return true;
}