login
Header Space

 
 

Re: [patch] CFS scheduler, -v18

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Ingo Molnar <mingo@...>
Cc: <linux-kernel@...>, Linus Torvalds <torvalds@...>, Andrew Morton <akpm@...>, Mike Galbraith <efault@...>, Arjan van de Ven <arjan@...>, Thomas Gleixner <tglx@...>, Dmitry Adamushko <dmitry.adamushko@...>, Srivatsa Vaddagiri <vatsa@...>
Date: Saturday, June 30, 2007 - 5:06 pm

Ingo,

I've accidentally discovered a problem with -v18.

Some time ago, I wrote a small program to prevent my laptop from entering
low-power mode, and noticed that after upgrading my laptop's kernel from
2.4.20.9+cfs-v6 to 2.4.20.14+cfs-v18, it completely freezes if I run this
program.

The program is trivial, it just sets its prio to nice +20 and forks a busy
loop. I've added the ability to stop the loop after a user-definable number
of iterations, and I can confirm that it unfreezes when the loop ends. I'm
not even root when I run it.

Everything freezes, including the frame-buffer. It's not 100% reproducible, I
would say 90% only. Sometimes it requires a few seconds before freezing. It
*seems* to me that running another task in parallel (such as vmstat) increases
its chances to freeze. It seems like nicing to +19 does not cause any trouble.

I've tried it on my dual athlon, and with 1 process I see occasional pauses of
1 or 2 seconds, and with 2 processes, I see fairly larger pauses.

Here's the trivial program. Probably you'll find an obvious bug.

Regards,
Willy

---

/*
 * cfs-freeze.c
 * Fork a busy loop running with idle prio. This often results
 * in complete freezes with CFS-v18.
 *
 * $ gcc -O2 -s -o cfs-freeze cfs-freeze.c
 * $ ./cfs-freeze
 */

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sched.h>
#include <sys/time.h>
#include <sys/resource.h>


int main(int argc, char **argv) {
	struct sched_param sch;
	long long i;

	if (argc > 1)
		i = atoll(argv[1]);

	if (i <= 0)
		i = 4 * 1000 * 1000 * 1000ULL;

	sch.sched_priority = 0;
	sched_setscheduler(0, SCHED_OTHER, &sch);
	setpriority(PRIO_PROCESS, 0, 20);
	if (fork() == 0)
		while (i--);
	return 0;
}

---

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch] CFS scheduler, -v18, Ingo Molnar, (Fri Jun 22, 6:02 pm)
Re: [patch] CFS scheduler, -v18, Vegard Nossum, (Mon Jul 2, 7:44 am)
Re: [patch] CFS scheduler, -v18, Ingo Molnar, (Tue Jul 3, 3:15 am)
Re: [patch] CFS scheduler, -v18, Vegard Nossum, (Tue Jul 3, 5:11 am)
Re: [patch] CFS scheduler, -v18, Bill Davidsen, (Mon Jul 2, 10:13 am)
Re: [patch] CFS scheduler, -v18, Dmitry Adamushko, (Mon Jul 2, 9:01 am)
Re: [patch] CFS scheduler, -v18, Vegard Nossum, (Mon Jul 2, 9:43 am)
Re: [patch] CFS scheduler, -v18, Ingo Molnar, (Mon Jul 2, 11:50 am)
Re: [patch] CFS scheduler, -v18, Vegard Nossum, (Mon Jul 2, 12:40 pm)
Re: [patch] CFS scheduler, -v18, Mike Galbraith, (Tue Jul 3, 3:12 am)
Re: [patch] CFS scheduler, -v18, Ingo Molnar, (Tue Jul 3, 3:22 am)
Re: [patch] CFS scheduler, -v18, Andi Kleen, (Wed Jul 4, 8:11 am)
Re: [patch] CFS scheduler, -v18, Keith Packard, (Tue Jul 3, 4:08 am)
Re: [patch] CFS scheduler, -v18, Ingo Molnar, (Tue Jul 3, 4:31 am)
Re: [patch] CFS scheduler, -v18, Ingo Molnar, (Mon Jul 2, 2:13 pm)
Re: [patch] CFS scheduler, -v18, Vegard Nossum, (Tue Jul 3, 3:01 am)
Re: [patch] CFS scheduler, -v18, Willy Tarreau, (Sat Jun 30, 5:06 pm)
Re: [patch] CFS scheduler, -v18, Ingo Molnar, (Sun Jul 1, 4:31 am)
Re: [patch] CFS scheduler, -v18, Ingo Molnar, (Sun Jul 1, 4:45 am)
Re: [patch] CFS scheduler, -v18, Willy Tarreau, (Sun Jul 1, 5:00 am)
RE: [patch] CFS scheduler, -v18, Fortier,Vincent [Montreal]..., (Tue Jun 26, 4:17 pm)
Re: [patch] CFS scheduler, -v18, Ingo Molnar, (Wed Jun 27, 6:51 am)
Re: [patch] CFS scheduler, -v18, Willy Tarreau, (Sat Jun 23, 9:24 am)
Re: [patch] CFS scheduler, -v18, Ingo Molnar, (Sun Jun 24, 11:52 am)
Re: [patch] CFS scheduler, -v18, Willy Tarreau, (Sun Jun 24, 1:08 pm)
Re: [patch] CFS scheduler, -v18, Ingo Molnar, (Sun Jun 24, 4:31 pm)
Re: [patch] CFS scheduler, -v18, Antonino Ingargiola, (Sat Jun 23, 6:22 am)
Re: [patch] CFS scheduler, -v18, Ingo Molnar, (Sat Jun 23, 1:25 pm)
Re: [patch] CFS scheduler, -v18, Antonino Ingargiola, (Sun Jun 24, 6:02 am)
Re: [patch] CFS scheduler, -v18, Ingo Molnar, (Sun Jun 24, 7:07 am)
Re: [patch] CFS scheduler, -v18, Antonino Ingargiola, (Mon Jun 25, 3:27 am)
Re: [patch] CFS scheduler, -v18, Gene Heskett, (Fri Jun 22, 7:08 pm)
Re: [patch] CFS scheduler, -v18, Ingo Molnar, (Sat Jun 23, 3:11 am)
Re: [patch] CFS scheduler, -v18, Gene Heskett, (Sat Jun 23, 5:55 am)
Re: [patch] CFS scheduler, -v18, S.Çağlar, (Fri Jun 22, 6:09 pm)
Re: [patch] CFS scheduler, -v18, S.Çağlar, (Fri Jun 22, 6:16 pm)
Re: [patch] CFS scheduler, -v18, Ingo Molnar, (Fri Jun 22, 6:20 pm)
Re: [patch] CFS scheduler, -v18, Andrew Morton, (Mon Jun 25, 11:02 pm)
Re: [patch] CFS scheduler, -v18, Ingo Molnar, (Tue Jun 26, 4:38 am)
Re: [patch] CFS scheduler, -v18, Andrew Morton, (Tue Jun 26, 5:00 am)
Re: [patch] CFS scheduler, -v18, Ingo Molnar, (Tue Jun 26, 5:38 am)
speck-geostationary