diff options
author | Rasmus Villemoes <[email protected]> | 2017-07-10 15:49:26 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2017-07-10 16:32:32 -0700 |
commit | b002529d256307602c669d1886c0b953b52b8700 (patch) | |
tree | 9219954404a5b6124356dd8a1785d6f5c0653126 /tools/perf/scripts/python/sched-migration.py | |
parent | 8c03cc85a035ae7a208c28c4382ecfeb6adf79a6 (diff) |
mm/page_alloc.c: eliminate unsigned confusion in __rmqueue_fallback
Since current_order starts as MAX_ORDER-1 and is then only decremented,
the second half of the loop condition seems superfluous. However, if
order is 0, we may decrement current_order past 0, making it UINT_MAX.
This is obviously too subtle ([1], [2]).
Since we need to add some comment anyway, change the two variables to
signed, making the counting-down for loop look more familiar, and
apparently also making gcc generate slightly smaller code.
[1] https://lkml.org/lkml/2016/6/20/493
[2] https://lkml.org/lkml/2017/6/19/345
[[email protected]: fix up reject fixupping]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Rasmus Villemoes <[email protected]>
Reported-by: Hao Lee <[email protected]>
Acked-by: Wei Yang <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Acked-by: Vlastimil Babka <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/sched-migration.py')
0 files changed, 0 insertions, 0 deletions