linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the workqueues tree with the tip tree
@ 2009-11-26  8:00 Stephen Rothwell
  2009-11-26  8:12 ` Ingo Molnar
  0 siblings, 1 reply; 28+ messages in thread
From: Stephen Rothwell @ 2009-11-26  8:00 UTC (permalink / raw)
  To: Tejun Heo
  Cc: linux-next, linux-kernel, Mike Galbraith, Thomas Gleixner,
	Ingo Molnar, H. Peter Anvin, Peter Zijlstra

Hi Tejun,

Today's linux-next merge of the workqueues tree got a conflict in
kernel/sched.c between commit eae0c9dfb534cb3449888b9601228efa6480fdb5
("sched: Fix and clean up rate-limit newidle code") from the tip tree and
commit 710c15b748f5ce9c573cc047f419cf007a677a9a ("sched: refactor
try_to_wake_up() and implement try_to_wake_up_local()") from the
workqueues tree.

I did the following fixup which should be checked ... I can carry this
fix (if it is suitable).

However, I have gone back to a previous version of the workqueues tree
for another issue (build problem for an interaction with the sound tree),
so this is not in linux-next today.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc kernel/sched.c
index 686be36,e488e07..0000000
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@@ -2323,7 -2336,58 +2335,69 @@@ void task_oncpu_function_call(struct ta
  	preempt_enable();
  }
  
- /***
+ static inline void ttwu_activate(struct task_struct *p, struct rq *rq,
+ 				 bool is_sync, bool is_migrate, bool is_local)
+ {
+ 	schedstat_inc(p, se.nr_wakeups);
+ 	if (is_sync)
+ 		schedstat_inc(p, se.nr_wakeups_sync);
+ 	if (is_migrate)
+ 		schedstat_inc(p, se.nr_wakeups_migrate);
+ 	if (is_local)
+ 		schedstat_inc(p, se.nr_wakeups_local);
+ 	else
+ 		schedstat_inc(p, se.nr_wakeups_remote);
+ 
+ 	activate_task(rq, p, 1);
+ 
+ 	/*
+ 	 * Only attribute actual wakeups done by this task.
+ 	 */
+ 	if (!in_interrupt()) {
+ 		struct sched_entity *se = &current->se;
+ 		u64 sample = se->sum_exec_runtime;
+ 
+ 		if (se->last_wakeup)
+ 			sample -= se->last_wakeup;
+ 		else
+ 			sample -= se->start_runtime;
+ 		update_avg(&se->avg_wakeup, sample);
+ 
+ 		se->last_wakeup = se->sum_exec_runtime;
+ 	}
+ }
+ 
+ static inline void ttwu_woken_up(struct task_struct *p, struct rq *rq,
+ 				 int wake_flags, bool success)
+ {
+ 	trace_sched_wakeup(rq, p, success);
+ 	check_preempt_curr(rq, p, wake_flags);
+ 
+ 	p->state = TASK_RUNNING;
+ #ifdef CONFIG_SMP
+ 	if (p->sched_class->task_wake_up)
+ 		p->sched_class->task_wake_up(rq, p);
++
++	if (unlikely(rq->idle_stamp)) {
++		u64 delta = rq->clock - rq->idle_stamp;
++		u64 max = 2*sysctl_sched_migration_cost;
++
++		if (delta > max)
++			rq->avg_idle = max;
++		else
++			update_avg(&rq->avg_idle, delta);
++		rq->idle_stamp = 0;
++	}
+ #endif
+ 	/*
+ 	 * Wake up is complete, fire wake up notifier.  This allows
+ 	 * try_to_wake_up_local() to be called from wake up notifiers.
+ 	 */
+ 	if (success)
+ 		fire_sched_notifier(p, wakeup);
+ }
+ 
+ /**
   * try_to_wake_up - wake up a thread
   * @p: the to-be-woken-up thread
   * @state: the mask of task states that can be woken

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2009-11-27  7:03 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-26  8:00 linux-next: manual merge of the workqueues tree with the tip tree Stephen Rothwell
2009-11-26  8:12 ` Ingo Molnar
2009-11-26  9:15   ` Tejun Heo
2009-11-26  9:26     ` Ingo Molnar
2009-11-26  9:48       ` Tejun Heo
2009-11-26  9:51         ` Ingo Molnar
2009-11-26 10:11           ` [PATCH 1/4 tip/sched/core] sched: rename preempt_notifier to sched_notifier and always enable it Tejun Heo
2009-11-26 10:29             ` Ingo Molnar
2009-11-26 10:32               ` Peter Zijlstra
2009-11-26 11:23                 ` Peter Zijlstra
2009-11-26 11:56                   ` Ingo Molnar
2009-11-26 12:40                     ` Peter Zijlstra
2009-11-27  2:11                       ` Tejun Heo
2009-11-27  4:52                         ` Ingo Molnar
2009-11-27  5:38                           ` Tejun Heo
2009-11-27  5:46                             ` Ingo Molnar
2009-11-27  6:01                               ` Tejun Heo
2009-11-27  6:13                                 ` Ingo Molnar
2009-11-27  6:16                                   ` Tejun Heo
2009-11-27  6:21                                     ` Ingo Molnar
2009-11-27  6:38                                       ` Tejun Heo
2009-11-27  7:02                                         ` Ingo Molnar
2009-11-26 10:44               ` Tejun Heo
2009-11-27  3:33               ` Paul Mackerras
2009-11-27  4:54                 ` Ingo Molnar
2009-11-26 10:13           ` [PATCH 2/4 tip/sched/core] sched: update sched_notifier and add wakeup/sleep notifications Tejun Heo
2009-11-26 10:13           ` [PATCH 3/4 tip/sched/core] sched: refactor try_to_wake_up() and implement try_to_wake_up_local() Tejun Heo
2009-11-26 10:14           ` [PATCH 4/4 tip/sched/core] sched: implement force_cpus_allowed() Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).