Skip to contentSkip to conversation

Update description of net.sctp.sctp_rmem and net.sctp.sctp_wmem tunables

PATCH In review Max Matveev 3 participants 7 messages Jun 20, 2011 – Jun 21, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Update description of net.sctp.sctp_rmem and net.sctp.sctp_wmem tunables

sctp does not use second and third ("default" and "max") values of sctp_(r|w)mem tunables. The format is the same and tcp_(r|w)mem but the meaning is different so make the documentation explicit to avoid confusion.

#1 lore raw

Re: [PATCH] Update description of net.sctp.sctp_rmem and net.sctp.sctp_wmem

Max Matveev wrote, at 06/20/2011 04:14 PM:

Quoted 7 lines

sctp does not use second and third ("default" and "max") values of sctp_(r|w)mem tunables. The format is the same and tcp_(r|w)mem but the meaning is different so make the documentation explicit to avoid confusion.

I can't open the attachment.
Please include your patch contents in the mail.
So that be convenient to review.

Signature · 3 lines
Best Regards
-----
Shan Wei
#2 lore raw

Re: [PATCH] Update description of net.sctp.sctp_rmem and net.sctp.sctp_wmem

In reply to Max Matveev

On Mon, 20 Jun 2011 16:29:25 +0800, Shan Wei wrote:

shanwei> I can't open the attachment.
shanwei> Please include your patch contents in the mail. shanwei> So that be convenient to review.

commit 7bc21f45041b9e2619e59c9c1f8a2368f0bb0aa1

Author: Max Matveev <[email protected]>
Date:   Mon Jun 20 18:08:10 2011 +1000

Update description of net.sctp.sctp_rmem and net.sctp.sctp_wmem tunables

sctp does not use second and third ("default" and "max") values of sctp_(r|w)mem tunables. The format is the same and tcp_(r|w)mem but the meaning is different so make the documentation explicit to avoid confusion.

Documentation/networking/ip-sysctl.txt +15 -2
index d3d653a..81734c0 100644
@@ -1465,10 +1465,23 @@ sctp_mem - vector of 3 INTEGERs: min, pressure, max
 	Default is calculated at boot time from amount of available memory.
 
 sctp_rmem - vector of 3 INTEGERs: min, default, max
-	See tcp_rmem for a description.
+	Only the first value ("min") is used, "default" and "max" are
+	ignored and may be removed in the future versions.
+
+	min: Minimal size of receive buffer used by SCTP socket.
+	It is guaranteed to each STCP socket (but not association) even 
+	under moderate memory pressure.
+
+	Default: 1 page
 
 sctp_wmem  - vector of 3 INTEGERs: min, default, max
-	See tcp_wmem for a description.
+	Only the first value ("min") is used, "default" and "max" are
+	ignored and may be removed in the future versions.
+
+	min: Amount of memory reserved for send buffers for SCTP sockets.
+	Each SCTP socket has rights to use it due to fact of its birth.
+
+	Default: 1 page
 
 addr_scope_policy - INTEGER
 	Control IPv4 address scoping - draft-stewart-tsvwg-sctp-ipv4-00
#3 lore raw

Re: [PATCH] Update description of net.sctp.sctp_rmem and net.sctp.sctp_wmem

In reply to Max Matveev

Hi

Some comments inline.
And Cc David Miller who maybe will accepte your patch.

Max Matveev wrote, at 06/20/2011 04:36 PM:

Quoted 26 lines · Shan Wei

shanwei> I can't open the attachment.
shanwei> Please include your patch contents in the mail. shanwei> So that be convenient to review.

commit 7bc21f45041b9e2619e59c9c1f8a2368f0bb0aa1

Author: Max Matveev <[email protected]>
Date:   Mon Jun 20 18:08:10 2011 +1000

Update description of net.sctp.sctp_rmem and net.sctp.sctp_wmem tunables

sctp does not use second and third ("default" and "max") values of sctp_(r|w)mem tunables. The format is the same and tcp_(r|w)mem but the meaning is different so make the documentation explicit to avoid confusion.

Documentation/networking/ip-sysctl.txt +0 -0
index d3d653a..81734c0 100644
@@ -1465,10 +1465,23 @@ sctp_mem - vector of 3 INTEGERs: min, pressure, max
 	Default is calculated at boot time from amount of available memory.
 

Documentation/networking/ip-sysctl.txt sctp_mem - vector of 3 INTEGERs: min, pressure, max · line 1475

Quoted 10 lines
Documentation/networking/ip-sysctl.txt +8 -1
 sctp_rmem - vector of 3 INTEGERs: min, default, max
-	See tcp_rmem for a description.
+	Only the first value ("min") is used, "default" and "max" are
+	ignored and may be removed in the future versions.
+
+	min: Minimal size of receive buffer used by SCTP socket.
+	It is guaranteed to each STCP socket (but not association) even 
+	under moderate memory pressure.
+
+	Default: 1 page

how about 4K?

Documentation/networking/ip-sysctl.txt sctp_mem - vector of 3 INTEGERs: min, pressure, max · line 1478

Quoted 5 lines
Documentation/networking/ip-sysctl.txt +2 -1
 sctp_wmem  - vector of 3 INTEGERs: min, default, max
-	See tcp_wmem for a description.
+	Only the first value ("min") is used, "default" and "max" are
+	ignored and may be removed in the future versions.

sctp_wmem parameter include all three fields never be used by sctp protocol. The min value is not used.

Quoted 11 lines
Documentation/networking/ip-sysctl.txt +5 -0
+
+	min: Amount of memory reserved for send buffers for SCTP sockets.
+	Each SCTP socket has rights to use it due to fact of its birth.
+
+	Default: 1 page
 
 addr_scope_policy - INTEGER
 	Control IPv4 address scoping - draft-stewart-tsvwg-sctp-ipv4-00
 
Signature · 3 lines
Best Regards
-----
Shan Wei
#5 lore raw

Re: [PATCH] Update description of net.sctp.sctp_rmem and net.sctp.sctp_wmem

In reply to Max Matveev

On Mon, 20 Jun 2011 17:41:07 +0800, Shan Wei wrote:

shanwei> Max Matveev wrote, at 06/20/2011 04:36 PM:

Quoted 3 lines

Review

Quoted 3 lines · Shan Wei
(quoted diff) +1 -0
+	Default: 1 page

shanwei> how about 4K?

Not everybody uses 4K pages. I can change it to 4K but it will be (technically) incorrect.

Quoted 5 lines

Review

Quoted 5 lines

sctp_wmem - vector of 3 INTEGERs: min, default, max

(quoted diff) +2 -1
-	See tcp_wmem for a description.
+	Only the first value ("min") is used, "default" and "max" are
+	ignored and may be removed in the future versions.

shanwei> sctp_wmem parameter include all three fields never be used shanwei> by sctp protocol. The min value is not used.

I was trying to avoid the embarrassment of admitting that there is a tunable which does nothing. Should I add another patch to remove the tunable?

max

#6 lore raw

Re: [PATCH] Update description of net.sctp.sctp_rmem and net.sctp.sctp_wmem

In reply to Max Matveev

Max Matveev wrote, at 06/21/2011 09:29 AM:

Quoted 11 lines · Shan Wei

shanwei> Max Matveev wrote, at 06/20/2011 04:36 PM:

Quoted 3 lines

Review

Quoted 3 lines · Shan Wei
(quoted diff) +1 -0
+	Default: 1 page

shanwei> how about 4K?

Not everybody uses 4K pages. I can change it to 4K but it will be (technically) incorrect.

Use "1 Page" is more exact.

Other parameters(tcp_rmem, tcp_rmem, udp_rmem_min) directly use magic number(4K or 4096).
So also need same change.

Quoted 10 lines
Quoted 6 lines

Review

Quoted 6 lines

sctp_wmem - vector of 3 INTEGERs: min, default, max

(quoted diff) +2 -1
-	See tcp_wmem for a description.
+	Only the first value ("min") is used, "default" and "max" are
+	ignored and may be removed in the future versions.

shanwei> sctp_wmem parameter include all three fields never be used shanwei> by sctp protocol. The min value is not used.

Quoted 3 lines

I was trying to avoid the embarrassment of admitting that there is a tunable which does nothing. Should I add another patch to remove the tunable?

No.
Currently, sctp protocol does't implement tunable memory management. Just provide an interface to user, but no function.
What we need is to implement it, not remove the interface simply.

Quoted 3 lines

max

Signature · 3 lines
Best Regards
-----
Shan Wei