Skip to content

Commit 2437dcb

Browse files
committed
Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
* 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: rcu: Add missing __cpuinit annotation in rcutorture code sched: Add "const" to is_idle_task() parameter rcu: Make rcutorture bool parameters really bool (core code) memblock: Fix alloc failure due to dumb underflow protection in memblock_find_in_range_node()
2 parents 0dbfe8d + b64b223 commit 2437dcb

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

include/linux/sched.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2090,7 +2090,7 @@ extern struct task_struct *idle_task(int cpu);
20902090
* is_idle_task - is the specified task an idle task?
20912091
* @p: the task in question.
20922092
*/
2093-
static inline bool is_idle_task(struct task_struct *p)
2093+
static inline bool is_idle_task(const struct task_struct *p)
20942094
{
20952095
return p->pid == 0;
20962096
}

kernel/rcutorture.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ static int nreaders = -1; /* # reader threads, defaults to 2*ncpus */
5656
static int nfakewriters = 4; /* # fake writer threads */
5757
static int stat_interval; /* Interval between stats, in seconds. */
5858
/* Defaults to "only at end of test". */
59-
static int verbose; /* Print more debug info. */
60-
static int test_no_idle_hz; /* Test RCU's support for tickless idle CPUs. */
59+
static bool verbose; /* Print more debug info. */
60+
static bool test_no_idle_hz; /* Test RCU's support for tickless idle CPUs. */
6161
static int shuffle_interval = 3; /* Interval between shuffles (in sec)*/
6262
static int stutter = 5; /* Start/stop testing interval (in sec) */
6363
static int irqreader = 1; /* RCU readers from irq (timers). */
@@ -1399,7 +1399,7 @@ rcu_torture_shutdown(void *arg)
13991399
* Execute random CPU-hotplug operations at the interval specified
14001400
* by the onoff_interval.
14011401
*/
1402-
static int
1402+
static int __cpuinit
14031403
rcu_torture_onoff(void *arg)
14041404
{
14051405
int cpu;
@@ -1447,7 +1447,7 @@ rcu_torture_onoff(void *arg)
14471447
return 0;
14481448
}
14491449

1450-
static int
1450+
static int __cpuinit
14511451
rcu_torture_onoff_init(void)
14521452
{
14531453
if (onoff_interval <= 0)

mm/memblock.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,17 @@ phys_addr_t __init_memblock memblock_find_in_range_node(phys_addr_t start,
106106
if (end == MEMBLOCK_ALLOC_ACCESSIBLE)
107107
end = memblock.current_limit;
108108

109-
/* adjust @start to avoid underflow and allocating the first page */
110-
start = max3(start, size, (phys_addr_t)PAGE_SIZE);
109+
/* avoid allocating the first page */
110+
start = max_t(phys_addr_t, start, PAGE_SIZE);
111111
end = max(start, end);
112112

113113
for_each_free_mem_range_reverse(i, nid, &this_start, &this_end, NULL) {
114114
this_start = clamp(this_start, start, end);
115115
this_end = clamp(this_end, start, end);
116116

117+
if (this_end < size)
118+
continue;
119+
117120
cand = round_down(this_end - size, align);
118121
if (cand >= this_start)
119122
return cand;

0 commit comments

Comments
 (0)