Re: TASK_NONINTERACTIVE (was: Machine Freezes while Running Crossover Office)

From: Ingo Molnar
Date: Fri Jun 03 2005 - 06:00:02 EST



* Pekka J Enberg <penberg@xxxxxxxxxxxxxx> wrote:

> Unfortunately I have to take that comment back. Under heavy CPU load
> [*], the interactivity is worse than with 2.6.11.10. XMMS skips and
> the X mouse cursor is all jerky. A better short-term fix would be to
> reduce pipe buffer size to 4 KB.
>
> [*] Running Eclipse and Tomcat while exercising Selenium JavaScript
> tests in Firefox. In other words, a JavaScript bot going through a
> Java web application.

could you please make it double sure and try the attached patch ontop of
the other patch? It adds a /proc/sys/kernel/pipe_noninteractive tunable
(default: off). It's quite tricky to test interactivity between kernels
(there's too much other state that may matter), so having a runtime
tunable can help significantly. Could you enable/disable it and see
whether it has a negative impact on interactivity? (besides fixing the
Wine problem too, of course)

Ingo

--- linux/fs/pipe.c.orig2
+++ linux/fs/pipe.c
@@ -34,16 +34,19 @@
* -- Manfred Spraul <manfred@xxxxxxxxxxxxxxxx> 2002-05-09
*/

+int pipe_noninteractive;
+
/* Drop the inode semaphore and wait for a pipe event, atomically */
void pipe_wait(struct inode * inode)
{
+ int flag = pipe_noninteractive ? TASK_NONINTERACTIVE : 0;
DEFINE_WAIT(wait);

/*
* Pipes are system-local resources, so sleeping on them
* is considered a noninteractive wait:
*/
- prepare_to_wait(PIPE_WAIT(*inode), &wait, TASK_INTERRUPTIBLE|TASK_NONINTERACTIVE);
+ prepare_to_wait(PIPE_WAIT(*inode), &wait, TASK_INTERRUPTIBLE|flag);
up(PIPE_SEM(*inode));
schedule();
finish_wait(PIPE_WAIT(*inode), &wait);
--- linux/kernel/sysctl.c.orig2
+++ linux/kernel/sysctl.c
@@ -66,6 +66,8 @@ extern int printk_ratelimit_jiffies;
extern int printk_ratelimit_burst;
extern int pid_max_min, pid_max_max;

+extern int pipe_noninteractive;
+
#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86)
int unknown_nmi_panic;
extern int proc_unknown_nmi_panic(ctl_table *, int, struct file *,
@@ -275,6 +277,14 @@ static ctl_table kern_table[] = {
.proc_handler = &proc_dointvec,
},
{
+ .ctl_name = KERN_PANIC,
+ .procname = "pipe_noninteractive",
+ .data = &pipe_noninteractive,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .proc_handler = &proc_dointvec,
+ },
+ {
.ctl_name = KERN_CORE_USES_PID,
.procname = "core_uses_pid",
.data = &core_uses_pid,
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/