Subject: bufq and sysctl question
To: None <tech-kern@netbsd.org>
From: Juan RP <juan@xtrarom.org>
List: tech-kern
Date: 01/22/2006 08:13:56
This is a multi-part message in MIME format.

--Multipart=_Sun__22_Jan_2006_08_13_56_+0100_Pw6jAMJYA+KKBaN_
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit


Hi,

I'm trying to create a sysctl tree of the bufq strategies
available in the kernel to modify the hardcoded values
of its queues.

That's what I have:

[juan@Nocturno][~]> sysctl kern.bufq
kern.bufq.priocscan.burst.noncritical = 64
kern.bufq.priocscan.burst.limited = 16
kern.bufq.priocscan.burst.critical = 4
kern.bufq.readprio.read_burst = 48
kern.bufq.readprio.write_req = 16
kern.bufq.strategies = disksort fcfs priocscan readprio
[juan@Nocturno][~]>

The problem is the following:

[juan@Nocturno][~]> sudo sysctl -w kern.bufq.readprio.write_req=64
kern.bufq.readprio.write_req: 16 -> 64
[juan@Nocturno][~]> sysctl kern.bufq.readprio.write_req
kern.bufq.readprio.write_req = 16
[juan@Nocturno][~]>

Does anyone know what's the problem?

http://www.xtrarom.org/o.diff

(Patch attached too).

Thanks...



--Multipart=_Sun__22_Jan_2006_08_13_56_+0100_Pw6jAMJYA+KKBaN_
Content-Type: application/octet-stream;
 name="o.diff"
Content-Disposition: attachment;
 filename="o.diff"
Content-Transfer-Encoding: base64

SW5kZXg6IHN5cy9rZXJuL2J1ZnFfcHJpb2NzY2FuLmMKPT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpSQ1MgZmlsZTogL2N2
c3Jvb3Qvc3JjL3N5cy9rZXJuL2J1ZnFfcHJpb2NzY2FuLmMsdgpyZXRyaWV2aW5nIHJldmlzaW9u
IDEuNwpkaWZmIC11IC1wIC1yMS43IGJ1ZnFfcHJpb2NzY2FuLmMKLS0tIHN5cy9rZXJuL2J1ZnFf
cHJpb2NzY2FuLmMJMjQgRGVjIDIwMDUgMTk6MTI6M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