Re: [RFC] scheduler: improve SMP fairness in CFS

2007-07-26 Thread Li, Tong N
On Thu, 2007-07-26 at 23:31 +0200, Ingo Molnar wrote: > * Tong Li <[EMAIL PROTECTED]> wrote: > > > > you need to measure it over longer periods of time. Its not worth > > > balancing for such a thing in any high-frequency manner. (we'd trash > > > the cache constantly migrating tasks back and

Re: [RFC] scheduler: improve SMP fairness in CFS

2007-07-26 Thread Li, Tong N
On Thu, 2007-07-26 at 23:31 +0200, Ingo Molnar wrote: * Tong Li [EMAIL PROTECTED] wrote: you need to measure it over longer periods of time. Its not worth balancing for such a thing in any high-frequency manner. (we'd trash the cache constantly migrating tasks back and forth.) I

Re: [RFC] scheduler: improve SMP fairness in CFS

2007-07-25 Thread Li, Tong N
On Wed, 2007-07-25 at 16:55 -0400, Chris Snook wrote: > Chris Friesen wrote: > > Ingo Molnar wrote: > > > >> the 3s is the problem: change that to 60s! We no way want to > >> over-migrate for SMP fairness, the change i did gives us reasonable > >> long-term SMP fairness without the need for

Re: [RFC] scheduler: improve SMP fairness in CFS

2007-07-25 Thread Li, Tong N
On Wed, 2007-07-25 at 14:03 +0200, Ingo Molnar wrote: > Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]> > --- > include/linux/sched.h |2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > Index: linux/include/linux/sched.h >

Re: [RFC] scheduler: improve SMP fairness in CFS

2007-07-25 Thread Li, Tong N
On Wed, 2007-07-25 at 14:03 +0200, Ingo Molnar wrote: Signed-off-by: Ingo Molnar [EMAIL PROTECTED] --- include/linux/sched.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux/include/linux/sched.h ===

Re: [RFC] scheduler: improve SMP fairness in CFS

2007-07-25 Thread Li, Tong N
On Wed, 2007-07-25 at 16:55 -0400, Chris Snook wrote: Chris Friesen wrote: Ingo Molnar wrote: the 3s is the problem: change that to 60s! We no way want to over-migrate for SMP fairness, the change i did gives us reasonable long-term SMP fairness without the need for high-rate

Re: [RFC] scheduler: improve SMP fairness in CFS

2007-07-24 Thread Li, Tong N
On Tue, 2007-07-24 at 16:39 -0400, Chris Snook wrote: > Divining the intentions of the administrator is an AI-complete problem and > we're > not going to try to solve that in the kernel. An intelligent administrator > could also allocate 50% of each CPU to a resource group containing all the

Re: [RFC] scheduler: improve SMP fairness in CFS

2007-07-24 Thread Li, Tong N
On Tue, 2007-07-24 at 04:07 -0400, Chris Snook wrote: > To clarify, I'm not suggesting that the "balance with cpu (x+1)%n only" > algorithm is the only way to do this. Rather, I'm pointing out that > even an extremely simple algorithm can give you fair loading when you > already have CFS

Re: [RFC] scheduler: improve SMP fairness in CFS

2007-07-24 Thread Li, Tong N
On Tue, 2007-07-24 at 04:07 -0400, Chris Snook wrote: To clarify, I'm not suggesting that the balance with cpu (x+1)%n only algorithm is the only way to do this. Rather, I'm pointing out that even an extremely simple algorithm can give you fair loading when you already have CFS managing

Re: [RFC] scheduler: improve SMP fairness in CFS

2007-07-24 Thread Li, Tong N
On Tue, 2007-07-24 at 16:39 -0400, Chris Snook wrote: Divining the intentions of the administrator is an AI-complete problem and we're not going to try to solve that in the kernel. An intelligent administrator could also allocate 50% of each CPU to a resource group containing all the

Re: [RFC] scheduler: improve SMP fairness in CFS

2007-07-23 Thread Li, Tong N
I benchmarked an early version of this code (against 2.6.21) with SPECjbb, SPEComp, kernbench, etc. on an 8-processor system, and didn't see any slowdown compared to the stock scheduler. I'll generate the data again with this version of the code. On the other hand, if locking does become a problem

Re: [RFC] scheduler: improve SMP fairness in CFS

2007-07-23 Thread Li, Tong N
I benchmarked an early version of this code (against 2.6.21) with SPECjbb, SPEComp, kernbench, etc. on an 8-processor system, and didn't see any slowdown compared to the stock scheduler. I'll generate the data again with this version of the code. On the other hand, if locking does become a problem

RE: Re: [ANNOUNCE][RFC] PlugSched-6.5.1 for 2.6.22

2007-07-15 Thread Li, Tong N
> -Original Message- > From: Adrian Bunk [mailto:[EMAIL PROTECTED] > Sent: Sunday, July 15, 2007 4:46 PM > To: Li, Tong N > Cc: Giuseppe Bilotta; linux-kernel@vger.kernel.org > Subject: Re: Re: [ANNOUNCE][RFC] PlugSched-6.5.1 for 2.6.22 > > On Sun, Jul 15, 2007

RE: Re: [ANNOUNCE][RFC] PlugSched-6.5.1 for 2.6.22

2007-07-15 Thread Li, Tong N
> On Thursday 12 July 2007 00:17, Al Boldi wrote: > > > Peter Williams wrote: > >> > >> Probably the last one now that CFS is in the main line :-(. > > > > What do you mean? A pluggable scheduler framework is indispensible even > in > > the presence of CFS or SD. > > Indeed, and I hope it gets

RE: Re: [ANNOUNCE][RFC] PlugSched-6.5.1 for 2.6.22

2007-07-15 Thread Li, Tong N
On Thursday 12 July 2007 00:17, Al Boldi wrote: Peter Williams wrote: Probably the last one now that CFS is in the main line :-(. What do you mean? A pluggable scheduler framework is indispensible even in the presence of CFS or SD. Indeed, and I hope it gets merged, giving

RE: Re: [ANNOUNCE][RFC] PlugSched-6.5.1 for 2.6.22

2007-07-15 Thread Li, Tong N
-Original Message- From: Adrian Bunk [mailto:[EMAIL PROTECTED] Sent: Sunday, July 15, 2007 4:46 PM To: Li, Tong N Cc: Giuseppe Bilotta; linux-kernel@vger.kernel.org Subject: Re: Re: [ANNOUNCE][RFC] PlugSched-6.5.1 for 2.6.22 On Sun, Jul 15, 2007 at 10:47:51AM -0700, Li, Tong N

RE: [patch 10/10] *Tests* Scheduler profiling - Use immediate values

2007-07-07 Thread Li, Tong N
Mathieu, > cycles_per_iter = 0.0; > for (i=0; i time1 = get_cycles(); > for (j = 0; j < NR_ITER; j++) { > testval = [random() % ARRAY_SIZE]; > } > time2 = get_cycles(); > cycles_per_iter +=

RE: [patch 10/10] *Tests* Scheduler profiling - Use immediate values

2007-07-07 Thread Li, Tong N
Mathieu, cycles_per_iter = 0.0; for (i=0; iNR_TESTS; i++) { time1 = get_cycles(); for (j = 0; j NR_ITER; j++) { testval = array[random() % ARRAY_SIZE]; } time2 = get_cycles();

RE: [patch 10/10] Scheduler profiling - Use immediate values

2007-07-06 Thread Li, Tong N
> I found that memory latency is difficult to measure in modern x86 > CPUs because they have very clever prefetchers that can often > outwit benchmarks. A pointer-chasing program that accesses a random sequence of addresses usually can produce a good estimate on memory latency. Also, prefetching

RE: [patch 10/10] Scheduler profiling - Use immediate values

2007-07-06 Thread Li, Tong N
> Also cache misses in this situation tend to be much more than 48 cycles > (even an K8 with integrated memory controller with fastest DIMMs is > slower than that) Mathieu probably measured an L2 miss, not a load from > RAM. > Load from RAM can be hundreds of ns in the worst case. > The 48

RE: [patch 10/10] Scheduler profiling - Use immediate values

2007-07-06 Thread Li, Tong N
Also cache misses in this situation tend to be much more than 48 cycles (even an K8 with integrated memory controller with fastest DIMMs is slower than that) Mathieu probably measured an L2 miss, not a load from RAM. Load from RAM can be hundreds of ns in the worst case. The 48 cycles

RE: [patch 10/10] Scheduler profiling - Use immediate values

2007-07-06 Thread Li, Tong N
I found that memory latency is difficult to measure in modern x86 CPUs because they have very clever prefetchers that can often outwit benchmarks. A pointer-chasing program that accesses a random sequence of addresses usually can produce a good estimate on memory latency. Also, prefetching can

Re: [PATCH] Chinese translation of Documentation/HOWTO

2007-06-22 Thread Li, Tong N
> As I know, there are a lot of standalone kernel developer in China. They > write device drivers for their chips or iptables modules for their > linux based network devices. They send source files to their customers > or publish them on web but seldom do anything to make the codes into >

Re: [PATCH] Chinese translation of Documentation/HOWTO

2007-06-22 Thread Li, Tong N
As I know, there are a lot of standalone kernel developer in China. They write device drivers for their chips or iptables modules for their linux based network devices. They send source files to their customers or publish them on web but seldom do anything to make the codes into kernel

RE: [RFC] Extend Linux to support proportional-share scheduling

2007-06-05 Thread Li, Tong N
more). Thanks, tong > -Original Message- > From: Willy Tarreau [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 05, 2007 8:33 PM > To: Li, Tong N > Cc: linux-kernel@vger.kernel.org; Ingo Molnar; Con Kolivas; Linus Torvalds; > Arjan van de Ven; Siddha, Suresh B; Barnes,

[RFC] Extend Linux to support proportional-share scheduling

2007-06-05 Thread Li, Tong N
Hi all, I've ported my code to mainline 2.6.21.3. You can get it at http://www.cs.duke.edu/~tongli/linux/. As I said before, the intent of the patch is not to compete with CFS and SD because the design relies on the underlying scheduler for interactive performance. The goal here is to present a

[RFC] Extend Linux to support proportional-share scheduling

2007-06-05 Thread Li, Tong N
Hi all, I've ported my code to mainline 2.6.21.3. You can get it at http://www.cs.duke.edu/~tongli/linux/. As I said before, the intent of the patch is not to compete with CFS and SD because the design relies on the underlying scheduler for interactive performance. The goal here is to present a

RE: [RFC] Extend Linux to support proportional-share scheduling

2007-06-05 Thread Li, Tong N
more). Thanks, tong -Original Message- From: Willy Tarreau [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 05, 2007 8:33 PM To: Li, Tong N Cc: linux-kernel@vger.kernel.org; Ingo Molnar; Con Kolivas; Linus Torvalds; Arjan van de Ven; Siddha, Suresh B; Barnes, Jesse; William Lee Irwin

Re: [RFC] [PATCH 0/3] Add group fairness to CFS

2007-05-25 Thread Li, Tong N
On Fri, 2007-05-25 at 21:44 +0530, Srivatsa Vaddagiri wrote: > > > > That assumes per-user scheduling groups; other configurations would > > make it one step for each level of hierarchy. It may be possible to > > reduce those steps to only state transitions that change weightings > > and

Re: [RFC] [PATCH 0/3] Add group fairness to CFS

2007-05-25 Thread Li, Tong N
On Fri, 2007-05-25 at 21:44 +0530, Srivatsa Vaddagiri wrote: That assumes per-user scheduling groups; other configurations would make it one step for each level of hierarchy. It may be possible to reduce those steps to only state transitions that change weightings and incremental

Re: [patch] CFS scheduler, -v8

2007-05-07 Thread Li, Tong N
On Mon, 2007-05-07 at 19:52 +0530, Srivatsa Vaddagiri wrote: > On Thu, May 03, 2007 at 08:53:47AM -0700, William Lee Irwin III wrote: > > On Thu, May 03, 2007 at 08:23:18PM +0530, Srivatsa Vaddagiri wrote: > > > And what about group scheduling extensions? Do you have plans to work on > > > it? I

Re: [patch] CFS scheduler, -v8

2007-05-07 Thread Li, Tong N
On Mon, 2007-05-07 at 19:52 +0530, Srivatsa Vaddagiri wrote: On Thu, May 03, 2007 at 08:53:47AM -0700, William Lee Irwin III wrote: On Thu, May 03, 2007 at 08:23:18PM +0530, Srivatsa Vaddagiri wrote: And what about group scheduling extensions? Do you have plans to work on it? I was

Re: [patch] CFS scheduler, -v8

2007-05-03 Thread Li, Tong N
On Thu, 2007-05-03 at 08:53 -0700, William Lee Irwin III wrote: > On Thu, May 03, 2007 at 03:29:32PM +0200, Damien Wyart wrote: > >> What are your thoughts/plans concerning merging CFS into mainline ? Is > >> it a bit premature to get it into 2.6.22 ? I remember Linus was ok to > >> change the

Re: [patch] CFS scheduler, -v8

2007-05-03 Thread Li, Tong N
On Thu, 2007-05-03 at 08:53 -0700, William Lee Irwin III wrote: On Thu, May 03, 2007 at 03:29:32PM +0200, Damien Wyart wrote: What are your thoughts/plans concerning merging CFS into mainline ? Is it a bit premature to get it into 2.6.22 ? I remember Linus was ok to change the default

Re: [patch] CFS scheduler, -v8

2007-05-02 Thread Li, Tong N
> Based on my understanding, adopting something like EEVDF in CFS should > not be very difficult given their similarities, although I do not have > any idea on how this impacts the load balancing for SMP. Does this worth > a try? > > Sorry for such a long email :-) Thanks for the

Re: [patch] CFS scheduler, -v8

2007-05-02 Thread Li, Tong N
Based on my understanding, adopting something like EEVDF in CFS should not be very difficult given their similarities, although I do not have any idea on how this impacts the load balancing for SMP. Does this worth a try? Sorry for such a long email :-) Thanks for the excellent

Re: [REPORT] cfs-v4 vs sd-0.44

2007-04-26 Thread Li, Tong N
On Wed, 2007-04-25 at 22:13 +0200, Willy Tarreau wrote: > On Wed, Apr 25, 2007 at 04:58:40AM -0700, William Lee Irwin III wrote: > > > Adjustments to the lag computation for for arrivals and departures > > during execution are among the missing pieces. Some algorithmic devices > > are also needed

Re: [REPORT] cfs-v4 vs sd-0.44

2007-04-26 Thread Li, Tong N
On Wed, 2007-04-25 at 22:13 +0200, Willy Tarreau wrote: On Wed, Apr 25, 2007 at 04:58:40AM -0700, William Lee Irwin III wrote: Adjustments to the lag computation for for arrivals and departures during execution are among the missing pieces. Some algorithmic devices are also needed to

RE: [REPORT] cfs-v4 vs sd-0.44

2007-04-24 Thread Li, Tong N
ill consider an algorithm to be fair as long as the second metric is bounded by a constant. > > On Mon, Apr 23, 2007 at 05:59:06PM -0700, Li, Tong N wrote: > > I understand that via experiments we can show a design is reasonably > > fair in the common case, but IMHO, to claim that a d

Re: [REPORT] cfs-v4 vs sd-0.44

2007-04-24 Thread Li, Tong N
On Mon, 2007-04-23 at 18:57 -0700, Bill Huey wrote: > On Mon, Apr 23, 2007 at 05:59:06PM -0700, Li, Tong N wrote: > > I don't know if we've discussed this or not. Since both CFS and SD claim > > to be fair, I'd like to hear more opinions on the fairness aspect of > > th

Re: [REPORT] cfs-v4 vs sd-0.44

2007-04-24 Thread Li, Tong N
On Mon, 2007-04-23 at 18:57 -0700, Bill Huey wrote: On Mon, Apr 23, 2007 at 05:59:06PM -0700, Li, Tong N wrote: I don't know if we've discussed this or not. Since both CFS and SD claim to be fair, I'd like to hear more opinions on the fairness aspect of these designs. In areas such as OS

RE: [REPORT] cfs-v4 vs sd-0.44

2007-04-24 Thread Li, Tong N
an algorithm to be fair as long as the second metric is bounded by a constant. On Mon, Apr 23, 2007 at 05:59:06PM -0700, Li, Tong N wrote: I understand that via experiments we can show a design is reasonably fair in the common case, but IMHO, to claim that a design is fair, there needs to be some

RE: [REPORT] cfs-v4 vs sd-0.44

2007-04-23 Thread Li, Tong N
I don't know if we've discussed this or not. Since both CFS and SD claim to be fair, I'd like to hear more opinions on the fairness aspect of these designs. In areas such as OS, networking, and real-time, fairness, and its more general form, proportional fairness, are well-defined terms. In fact,

RE: [REPORT] cfs-v4 vs sd-0.44

2007-04-23 Thread Li, Tong N
I don't know if we've discussed this or not. Since both CFS and SD claim to be fair, I'd like to hear more opinions on the fairness aspect of these designs. In areas such as OS, networking, and real-time, fairness, and its more general form, proportional fairness, are well-defined terms. In fact,