Skip to content

Commit 51dad80

Browse files
author
Linus Torvalds
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched
* git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched: sched: do not hurt SCHED_BATCH on wakeup sched: touch softlockup watchdog after idling sched: sysctl, proc_dointvec_minmax() expects int values for sched: mark rwsem functions as __sched for wchan/profiling sched: fix crash on ia64, introduce task_current()
2 parents 3c615e1 + 6cbf1c1 commit 51dad80

File tree

5 files changed

+21
-15
lines changed

5 files changed

+21
-15
lines changed

kernel/rwsem.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include <linux/types.h>
88
#include <linux/kernel.h>
9+
#include <linux/sched.h>
910
#include <linux/module.h>
1011
#include <linux/rwsem.h>
1112

@@ -15,7 +16,7 @@
1516
/*
1617
* lock for reading
1718
*/
18-
void down_read(struct rw_semaphore *sem)
19+
void __sched down_read(struct rw_semaphore *sem)
1920
{
2021
might_sleep();
2122
rwsem_acquire_read(&sem->dep_map, 0, 0, _RET_IP_);
@@ -42,7 +43,7 @@ EXPORT_SYMBOL(down_read_trylock);
4243
/*
4344
* lock for writing
4445
*/
45-
void down_write(struct rw_semaphore *sem)
46+
void __sched down_write(struct rw_semaphore *sem)
4647
{
4748
might_sleep();
4849
rwsem_acquire(&sem->dep_map, 0, 0, _RET_IP_);

kernel/sched.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -508,10 +508,15 @@ EXPORT_SYMBOL_GPL(cpu_clock);
508508
# define finish_arch_switch(prev) do { } while (0)
509509
#endif
510510

511+
static inline int task_current(struct rq *rq, struct task_struct *p)
512+
{
513+
return rq->curr == p;
514+
}
515+
511516
#ifndef __ARCH_WANT_UNLOCKED_CTXSW
512517
static inline int task_running(struct rq *rq, struct task_struct *p)
513518
{
514-
return rq->curr == p;
519+
return task_current(rq, p);
515520
}
516521

517522
static inline void prepare_lock_switch(struct rq *rq, struct task_struct *next)
@@ -540,7 +545,7 @@ static inline int task_running(struct rq *rq, struct task_struct *p)
540545
#ifdef CONFIG_SMP
541546
return p->oncpu;
542547
#else
543-
return rq->curr == p;
548+
return task_current(rq, p);
544549
#endif
545550
}
546551

@@ -663,6 +668,7 @@ void sched_clock_idle_wakeup_event(u64 delta_ns)
663668
struct rq *rq = cpu_rq(smp_processor_id());
664669
u64 now = sched_clock();
665670

671+
touch_softlockup_watchdog();
666672
rq->idle_clock += delta_ns;
667673
/*
668674
* Override the previous timestamp and ignore all
@@ -3334,7 +3340,7 @@ unsigned long long task_sched_runtime(struct task_struct *p)
33343340

33353341
rq = task_rq_lock(p, &flags);
33363342
ns = p->se.sum_exec_runtime;
3337-
if (rq->curr == p) {
3343+
if (task_current(rq, p)) {
33383344
update_rq_clock(rq);
33393345
delta_exec = rq->clock - p->se.exec_start;
33403346
if ((s64)delta_exec > 0)
@@ -4021,7 +4027,7 @@ void rt_mutex_setprio(struct task_struct *p, int prio)
40214027

40224028
oldprio = p->prio;
40234029
on_rq = p->se.on_rq;
4024-
running = task_running(rq, p);
4030+
running = task_current(rq, p);
40254031
if (on_rq) {
40264032
dequeue_task(rq, p, 0);
40274033
if (running)
@@ -4332,7 +4338,7 @@ int sched_setscheduler(struct task_struct *p, int policy,
43324338
}
43334339
update_rq_clock(rq);
43344340
on_rq = p->se.on_rq;
4335-
running = task_running(rq, p);
4341+
running = task_current(rq, p);
43364342
if (on_rq) {
43374343
deactivate_task(rq, p, 0);
43384344
if (running)
@@ -7101,7 +7107,7 @@ void sched_move_task(struct task_struct *tsk)
71017107

71027108
update_rq_clock(rq);
71037109

7104-
running = task_running(rq, tsk);
7110+
running = task_current(rq, tsk);
71057111
on_rq = tsk->se.on_rq;
71067112

71077113
if (on_rq) {

kernel/sched_fair.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,7 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial)
511511

512512
if (!initial) {
513513
/* sleeps upto a single latency don't count. */
514-
if (sched_feat(NEW_FAIR_SLEEPERS) && entity_is_task(se) &&
515-
task_of(se)->policy != SCHED_BATCH)
514+
if (sched_feat(NEW_FAIR_SLEEPERS) && entity_is_task(se))
516515
vruntime -= sysctl_sched_latency;
517516

518517
/* ensure we never gain time by being placed backwards. */

kernel/sysctl.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,10 @@ static struct ctl_table root_table[] = {
225225
};
226226

227227
#ifdef CONFIG_SCHED_DEBUG
228-
static unsigned long min_sched_granularity_ns = 100000; /* 100 usecs */
229-
static unsigned long max_sched_granularity_ns = NSEC_PER_SEC; /* 1 second */
230-
static unsigned long min_wakeup_granularity_ns; /* 0 usecs */
231-
static unsigned long max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */
228+
static int min_sched_granularity_ns = 100000; /* 100 usecs */
229+
static int max_sched_granularity_ns = NSEC_PER_SEC; /* 1 second */
230+
static int min_wakeup_granularity_ns; /* 0 usecs */
231+
static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */
232232
#endif
233233

234234
static struct ctl_table kern_table[] = {

lib/rwsem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ __rwsem_do_wake(struct rw_semaphore *sem, int downgrading)
146146
/*
147147
* wait for a lock to be granted
148148
*/
149-
static struct rw_semaphore *
149+
static struct rw_semaphore __sched *
150150
rwsem_down_failed_common(struct rw_semaphore *sem,
151151
struct rwsem_waiter *waiter, signed long adjustment)
152152
{

0 commit comments

Comments
 (0)