The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* add /proc/sys/kernel/cache_decay_ticks
@ 2003-06-18 21:51 David Mosberger
  0 siblings, 0 replies; 4+ messages in thread
From: David Mosberger @ 2003-06-18 21:51 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

/proc/sys/kernel/cache_decay_ticks allows runtime tuning of the
scheduler.  The earlier patch collided with the C99-ification of the
file, so here is a retransmit.

	--david

diff -Nru a/include/linux/sysctl.h b/include/linux/sysctl.h
--- a/include/linux/sysctl.h	Wed Jun 18 13:32:49 2003
+++ b/include/linux/sysctl.h	Wed Jun 18 13:32:49 2003
@@ -130,6 +130,7 @@
 	KERN_PIDMAX=55,		/* int: PID # limit */
   	KERN_CORE_PATTERN=56,	/* string: pattern for core-file names */
 	KERN_PANIC_ON_OOPS=57,  /* int: whether we will panic on an oops */
+	KERN_CACHEDECAYTICKS=58, /* ulong: value for cache_decay_ticks (EXPERIMENTAL!) */
 };
 
 
diff -Nru a/kernel/sysctl.c b/kernel/sysctl.c
--- a/kernel/sysctl.c	Wed Jun 18 13:32:49 2003
+++ b/kernel/sysctl.c	Wed Jun 18 13:32:49 2003
@@ -551,6 +551,16 @@
 		.mode		= 0644,
 		.proc_handler	= &proc_dointvec,
 	},
+#ifdef CONFIG_SMP
+	{
+		.ctl_name	= KERN_CACHEDECAYTICKS,
+		.procname	= "cache_decay_ticks",
+		.data		= &cache_decay_ticks,
+		.maxlen		= sizeof(cache_decay_ticks),
+		.mode		= 0644,
+		.proc_handler	= &proc_doulongvec_minmax,
+	},
+#endif
 	{ .ctl_name = 0 }
 };
 

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

* Re: add /proc/sys/kernel/cache_decay_ticks
       [not found] <200306182151.h5ILpMcx022062@napali.hpl.hp.com.suse.lists.linux.kernel>
@ 2003-06-18 22:05 ` Andi Kleen
  2003-06-18 22:12   ` David Mosberger
  0 siblings, 1 reply; 4+ messages in thread
From: Andi Kleen @ 2003-06-18 22:05 UTC (permalink / raw)
  To: David Mosberger; +Cc: linux-kernel

David Mosberger <davidm@napali.hpl.hp.com> writes:

> /proc/sys/kernel/cache_decay_ticks allows runtime tuning of the
> scheduler.  The earlier patch collided with the C99-ification of the
> file, so here is a retransmit.

Funny, I did a similar patch for 2.4 a short time ago. But I would
suggest one change before you merge that to mainline. The variable
is currently used like this:

#define CAN_MIGRATE_TASK(p,rq,this_cpu)                                 \
        ((jiffies - (p)->last_run > cache_decay_ticks) &&       \o

Which means 0 means 1 jiffie. For a tunable it would be useful to be 
able to turn it off completely, which means the > needs to be replaced
with a >=. Unfortunately this requires changes in the architectures
too to subtract one. But it would make it more useful. I would do
the change before exposing it.

-Andi

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

* Re: add /proc/sys/kernel/cache_decay_ticks
  2003-06-18 22:05 ` add /proc/sys/kernel/cache_decay_ticks Andi Kleen
@ 2003-06-18 22:12   ` David Mosberger
  2003-06-18 22:18     ` Andi Kleen
  0 siblings, 1 reply; 4+ messages in thread
From: David Mosberger @ 2003-06-18 22:12 UTC (permalink / raw)
  To: Andi Kleen; +Cc: David Mosberger, linux-kernel

>>>>> On 19 Jun 2003 00:05:18 +0200, Andi Kleen <ak@suse.de> said:

  Andi> David Mosberger <davidm@napali.hpl.hp.com> writes:
  >> /proc/sys/kernel/cache_decay_ticks allows runtime tuning of the
  >> scheduler.  The earlier patch collided with the C99-ification of
  >> the file, so here is a retransmit.

  Andi> Funny, I did a similar patch for 2.4 a short time ago. But I
  Andi> would suggest one change before you merge that to
  Andi> mainline. The variable is currently used like this:

  Andi> #define CAN_MIGRATE_TASK(p,rq,this_cpu) \ ((jiffies -
  Andi> (p)->last_run > cache_decay_ticks) && \o

  Andi> Which means 0 means 1 jiffie. For a tunable it would be useful
  Andi> to be able to turn it off completely, which means the > needs
  Andi> to be replaced with a >=. Unfortunately this requires changes
  Andi> in the architectures too to subtract one. But it would make it
  Andi> more useful. I would do the change before exposing it.

I don't see why the two have to be tied together.  I agree it would be
_nice_, but having /proc/sys/kernel/cache_decay_ticks in it's current
form is much better than nothing at all.

	--david

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

* Re: add /proc/sys/kernel/cache_decay_ticks
  2003-06-18 22:12   ` David Mosberger
@ 2003-06-18 22:18     ` Andi Kleen
  0 siblings, 0 replies; 4+ messages in thread
From: Andi Kleen @ 2003-06-18 22:18 UTC (permalink / raw)
  To: davidm; +Cc: Andi Kleen, David Mosberger, linux-kernel

> I don't see why the two have to be tied together.  I agree it would be
> _nice_, but having /proc/sys/kernel/cache_decay_ticks in it's current
> form is much better than nothing at all.

The problem is that when you change it later with the sysctl you have a subtle
user visible change, breaking existing users.

-Andi


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

end of thread, other threads:[~2003-06-18 22:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200306182151.h5ILpMcx022062@napali.hpl.hp.com.suse.lists.linux.kernel>
2003-06-18 22:05 ` add /proc/sys/kernel/cache_decay_ticks Andi Kleen
2003-06-18 22:12   ` David Mosberger
2003-06-18 22:18     ` Andi Kleen
2003-06-18 21:51 David Mosberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox