public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.6-rc3-mm1] Add maxthinktime to sysfs
@ 2004-04-30 22:26 FabF
  2004-04-30 22:42 ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: FabF @ 2004-04-30 22:26 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Nick Piggin, lkml

[-- Attachment #1: Type: text/plain, Size: 99 bytes --]

Andrew,

	Here's a patch to add the asio maxthinktime to sysfs.
Could you apply ?

Regards,
Fabian

[-- Attachment #2: maxthinktime1.diff --]
[-- Type: text/x-patch, Size: 1936 bytes --]

diff -Naur orig/drivers/block/as-iosched.c edited/drivers/block/as-iosched.c
--- orig/drivers/block/as-iosched.c	2004-04-30 20:10:43.000000000 +0200
+++ edited/drivers/block/as-iosched.c	2004-05-01 00:02:59.000000000 +0200
@@ -65,7 +65,7 @@
  * or doing a lengthy computation. A small penalty can be justified there, and
  * will still catch out those processes that constantly have large thinktimes.
  */
-#define MAX_THINKTIME (HZ/50UL)
+unsigned long maxthinktime=(HZ/50UL);
 
 /* Bits in as_io_context.state */
 enum as_io_states {
@@ -869,7 +869,7 @@
 			if (test_bit(AS_TASK_IORUNNING, &aic->state)
 							&& in_flight == 0) {
 				thinktime = jiffies - aic->last_end_request;
-				thinktime = min(thinktime, MAX_THINKTIME-1);
+				thinktime = min(thinktime, maxthinktime-1);
 			} else
 				thinktime = 0;
 			as_update_thinktime(ad, aic, thinktime);
@@ -1951,6 +1951,7 @@
 {									\
 	return as_var_show(__VAR, (page));			\
 }
+SHOW_FUNCTION(as_maxthinktime_show, maxthinktime);
 SHOW_FUNCTION(as_readexpire_show, ad->fifo_expire[REQ_SYNC]);
 SHOW_FUNCTION(as_writeexpire_show, ad->fifo_expire[REQ_ASYNC]);
 SHOW_FUNCTION(as_anticexpire_show, ad->antic_expire);
@@ -1968,6 +1969,7 @@
 		*(__PTR) = (MAX);					\
 	return ret;							\
 }
+STORE_FUNCTION(as_maxthinktime_store, &maxthinktime, 0, LONG_MAX);
 STORE_FUNCTION(as_readexpire_store, &ad->fifo_expire[REQ_SYNC], 0, INT_MAX);
 STORE_FUNCTION(as_writeexpire_store, &ad->fifo_expire[REQ_ASYNC], 0, INT_MAX);
 STORE_FUNCTION(as_anticexpire_store, &ad->antic_expire, 0, INT_MAX);
@@ -1977,6 +1979,11 @@
 			&ad->batch_expire[REQ_ASYNC], 0, INT_MAX);
 #undef STORE_FUNCTION
 
+static struct as_fs_entry as_maxthinktime = {
+	.attr = {.name = "maxthinktime", .mode = S_IRUGO | S_IWUSR },
+	.show = as_maxthinktime_show,
+	.store = as_maxthinktime_store,
+};
 static struct as_fs_entry as_est_entry = {
 	.attr = {.name = "est_time", .mode = S_IRUGO },
 	.show = as_est_show,

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

* Re: [PATCH 2.6.6-rc3-mm1] Add maxthinktime to sysfs
  2004-04-30 22:26 [PATCH 2.6.6-rc3-mm1] Add maxthinktime to sysfs FabF
@ 2004-04-30 22:42 ` Andrew Morton
  2004-04-30 23:37   ` FabF
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2004-04-30 22:42 UTC (permalink / raw)
  To: FabF; +Cc: nickpiggin, linux-kernel, Badari Pulavarty

FabF <Fabian.Frederick@skynet.be> wrote:
>
> 	Here's a patch to add the asio maxthinktime to sysfs.

Why?  Have you measured any benefit from varying it, and if so, what was
the result?

Badari, did you find any need to vary this in the AS tuning work which you
were doing?  (What happened to that, btw?)

If we're going to expose this tunable to users it needs to be documented in
as-iosched.txt

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

* Re: [PATCH 2.6.6-rc3-mm1] Add maxthinktime to sysfs
  2004-04-30 23:37   ` FabF
@ 2004-04-30 23:34     ` Andrew Morton
  2004-05-01  3:41     ` Nick Piggin
  1 sibling, 0 replies; 5+ messages in thread
From: Andrew Morton @ 2004-04-30 23:34 UTC (permalink / raw)
  To: FabF; +Cc: nickpiggin, linux-kernel, pbadari

FabF <Fabian.Frederick@skynet.be> wrote:
>
>        I notice huge variations in first seconds of a 10 client
>  throughput activity as attached (5,100,300 as maxthinktime).
>  It's just another parameter I'd like to play with ;)

Fair enough.  Interesting result.

Can you describe and/or publish ffbench?

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

* Re: [PATCH 2.6.6-rc3-mm1] Add maxthinktime to sysfs
  2004-04-30 22:42 ` Andrew Morton
@ 2004-04-30 23:37   ` FabF
  2004-04-30 23:34     ` Andrew Morton
  2004-05-01  3:41     ` Nick Piggin
  0 siblings, 2 replies; 5+ messages in thread
From: FabF @ 2004-04-30 23:37 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Nick Piggin, linux-kernel, Badari Pulavarty

[-- Attachment #1: Type: text/plain, Size: 913 bytes --]

On Sat, 2004-05-01 at 00:42, Andrew Morton wrote:
> FabF <Fabian.Frederick@skynet.be> wrote:
> >
> > 	Here's a patch to add the asio maxthinktime to sysfs.
> 
> Why? Have you measured any benefit from varying it, and if so, what was
> the result?

Andrew,

       I notice huge variations in first seconds of a 10 client
throughput activity as attached (5,100,300 as maxthinktime).
It's just another parameter I'd like to play with ;)
Maybe this one's exposition is not important intrinsequely but we could
bring interesting combinations later ...
       

> 
> Badari, did you find any need to vary this in the AS tuning work which you
> were doing?  (What happened to that, btw?)
> 
> If we're going to expose this tunable to users it needs to be documented in
> as-iosched.txt

I'm an absolute beginner Andrew ... Maybe someone more experienced could do that ?

PS:Attached the patch v2.

Best regards,
Fabian

[-- Attachment #2: ffbench11.txt --]
[-- Type: text/plain, Size: 905 bytes --]

ffbench 11 - Fabian Frederick 04/2004 - asio - maxthinktime - 10 clients
5	100	300
---------------------
5.37	21.26	16.28
11.71	23.10	20.14
15.22	21.05	20.20
13.85	18.03	17.55
11.58	16.39	16.86
11.41	15.50	14.30
11.43	14.37	14.03
11.43	13.82	14.16
11.43	13.60	14.29
11.57	13.27	14.01
11.24	13.06	13.67
10.78	12.91	13.67
10.71	12.41	12.91
10.91	12.53	12.70
10.97	12.32	12.67
10.90	12.34	12.82
10.62	12.25	12.68
10.59	11.81	12.61
10.44	11.40	12.15
10.44	11.35	11.96
10.37	11.36	11.68
10.20	11.19	11.73
10.39	11.18	11.85
10.22	11.22	11.92
10.10	11.15	11.81
10.11	11.03	11.53
9.95	11.00	11.56
10.15	11.21	11.55
10.32	11.17	11.54
10.34	10.96	11.47
10.08	11.02	11.47
10.10	11.14	11.54
10.15	11.14	11.45
10.07	11.04	11.31
10.12	11.08	11.26
10.01	11.04	11.28
10.02	10.93	11.15
9.98	10.70	10.93
9.94	10.60	10.93
9.85	10.45	10.78
9.87	10.40	10.68
9.98	10.37	10.62
9.95	10.28	10.56
9.87	10.20	10.51
9.72	10.16	10.55

[-- Attachment #3: maxthinktime2.diff --]
[-- Type: text/x-patch, Size: 2116 bytes --]

diff -Naur orig/drivers/block/as-iosched.c edited/drivers/block/as-iosched.c
--- orig/drivers/block/as-iosched.c	2004-04-30 20:10:43.000000000 +0200
+++ edited/drivers/block/as-iosched.c	2004-05-01 01:00:36.000000000 +0200
@@ -65,7 +65,7 @@
  * or doing a lengthy computation. A small penalty can be justified there, and
  * will still catch out those processes that constantly have large thinktimes.
  */
-#define MAX_THINKTIME (HZ/50UL)
+unsigned long maxthinktime=(HZ/50UL);
 
 /* Bits in as_io_context.state */
 enum as_io_states {
@@ -869,7 +869,7 @@
 			if (test_bit(AS_TASK_IORUNNING, &aic->state)
 							&& in_flight == 0) {
 				thinktime = jiffies - aic->last_end_request;
-				thinktime = min(thinktime, MAX_THINKTIME-1);
+				thinktime = min(thinktime, maxthinktime-1);
 			} else
 				thinktime = 0;
 			as_update_thinktime(ad, aic, thinktime);
@@ -1951,6 +1951,7 @@
 {									\
 	return as_var_show(__VAR, (page));			\
 }
+SHOW_FUNCTION(as_maxthinktime_show, maxthinktime);
 SHOW_FUNCTION(as_readexpire_show, ad->fifo_expire[REQ_SYNC]);
 SHOW_FUNCTION(as_writeexpire_show, ad->fifo_expire[REQ_ASYNC]);
 SHOW_FUNCTION(as_anticexpire_show, ad->antic_expire);
@@ -1968,6 +1969,7 @@
 		*(__PTR) = (MAX);					\
 	return ret;							\
 }
+STORE_FUNCTION(as_maxthinktime_store, &maxthinktime, 0, LONG_MAX);
 STORE_FUNCTION(as_readexpire_store, &ad->fifo_expire[REQ_SYNC], 0, INT_MAX);
 STORE_FUNCTION(as_writeexpire_store, &ad->fifo_expire[REQ_ASYNC], 0, INT_MAX);
 STORE_FUNCTION(as_anticexpire_store, &ad->antic_expire, 0, INT_MAX);
@@ -1977,6 +1979,11 @@
 			&ad->batch_expire[REQ_ASYNC], 0, INT_MAX);
 #undef STORE_FUNCTION
 
+static struct as_fs_entry as_maxthinktime = {
+	.attr = {.name = "maxthinktime", .mode = S_IRUGO | S_IWUSR },
+	.show = as_maxthinktime_show,
+	.store = as_maxthinktime_store,
+};
 static struct as_fs_entry as_est_entry = {
 	.attr = {.name = "est_time", .mode = S_IRUGO },
 	.show = as_est_show,
@@ -2008,6 +2015,7 @@
 };
 
 static struct attribute *default_attrs[] = {
+	&as_maxthinktime.attr,
 	&as_est_entry.attr,
 	&as_readexpire_entry.attr,
 	&as_writeexpire_entry.attr,

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

* Re: [PATCH 2.6.6-rc3-mm1] Add maxthinktime to sysfs
  2004-04-30 23:37   ` FabF
  2004-04-30 23:34     ` Andrew Morton
@ 2004-05-01  3:41     ` Nick Piggin
  1 sibling, 0 replies; 5+ messages in thread
From: Nick Piggin @ 2004-05-01  3:41 UTC (permalink / raw)
  To: FabF; +Cc: Andrew Morton, linux-kernel, Badari Pulavarty

FabF wrote:
> On Sat, 2004-05-01 at 00:42, Andrew Morton wrote:

>>Badari, did you find any need to vary this in the AS tuning work which you
>>were doing?  (What happened to that, btw?)
>>
>>If we're going to expose this tunable to users it needs to be documented in
>>as-iosched.txt
> 
> 
> I'm an absolute beginner Andrew ... Maybe someone more experienced could do that ?
> 

No no, writing end user documentation is much easier than writing
kernel code!

But either way you needn't worry about it because this isn't something
that you would want to tweak from userspace really. If you find it
useful to do some tuning then I guess it can go in -mm.

> PS:Attached the patch v2.
> 
> Best regards,
> Fabian
> 
> 
> ------------------------------------------------------------------------
> 
> ffbench 11 - Fabian Frederick 04/2004 - asio - maxthinktime - 10 clients
> 5	100	300
> ---------------------
> 5.37	21.26	16.28
> 11.71	23.10	20.14
> 15.22	21.05	20.20
> 13.85	18.03	17.55
> 11.58	16.39	16.86
...

maxthinktime of 5 is below the default antic_expire of 6. This
basically turns off the thinktime heuristic, so it isn't really
surprising that it runs like crap.

The *minimum* maxthinktime you should be playing with is probably
about double the antic_expire value.

Raising the value will make the heuristic a bit more restrictive
which could be a good idea. I think OSDL's STP has a couple of
database tests where the anticipatory scheduler has a small
regression (dbt2, dbt3). They might be helpful to you.

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

end of thread, other threads:[~2004-05-01  3:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-30 22:26 [PATCH 2.6.6-rc3-mm1] Add maxthinktime to sysfs FabF
2004-04-30 22:42 ` Andrew Morton
2004-04-30 23:37   ` FabF
2004-04-30 23:34     ` Andrew Morton
2004-05-01  3:41     ` Nick Piggin

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