Re: Get rid of /proc/sys/net/unix/max_dgram_qlen

2006-08-22 Thread Indan Zupancic
On Wed, August 23, 2006 1:32, Alexey Kuznetsov said: >> Isn't a socket freed until all skb are handled? In which case the limit on >> the number of open >> files limits the total memory usage? (Same as with streaming sockets?) > > Alas. Number of closed sockets is not limited. Actually, it is lim

Re: Get rid of /proc/sys/net/unix/max_dgram_qlen

2006-08-22 Thread Alexey Kuznetsov
Hello! > Isn't a socket freed until all skb are handled? In which case the limit on > the number of open > files limits the total memory usage? (Same as with streaming sockets?) Alas. Number of closed sockets is not limited. Actually, it is limited by sk_max_ack_backlog*max_files, which is a lot

Re: Get rid of /proc/sys/net/unix/max_dgram_qlen

2006-08-22 Thread Indan Zupancic
On Wed, August 23, 2006 0:34, Alexey Kuznetsov said: >> > It is the only protection of commiting infinite amount of memory to a >> > socket. >> >> Doesn't the "if (atomic_read(&sk->sk_wmem_alloc) < sk->sk_sndbuf)" check in >> sock_alloc_send_pskb() >> limit things already? > > Unfortunately, it do

Re: Get rid of /proc/sys/net/unix/max_dgram_qlen

2006-08-22 Thread Alexey Kuznetsov
Hello! > > It is the only protection of commiting infinite amount of memory to a > > socket. > > Doesn't the "if (atomic_read(&sk->sk_wmem_alloc) < sk->sk_sndbuf)" check in > sock_alloc_send_pskb() > limit things already? Unfortunately, it does not. You can open a socket, send something to a s

Re: Get rid of /proc/sys/net/unix/max_dgram_qlen

2006-08-22 Thread Indan Zupancic
On Tue, August 22, 2006 22:39, Alexey Kuznetsov said: > Feel free to do this correctly. :-) > Deleting "wrong" code rarely helps. > > It is the only protection of commiting infinite amount of memory to a socket. Doesn't the "if (atomic_read(&sk->sk_wmem_alloc) < sk->sk_sndbuf)" check in sock_allo

Re: Get rid of /proc/sys/net/unix/max_dgram_qlen

2006-08-22 Thread Alexey Kuznetsov
Hello! > Either this, or it should be implemented correctly, which means poll needs > to be fixed to also check for max_dgram_qlen, Feel free to do this correctly. :-) Deleting "wrong" code rarely helps. It is the only protection of commiting infinite amount of memory to a socket. Alexey - To u

Get rid of /proc/sys/net/unix/max_dgram_qlen

2006-08-22 Thread Indan Zupancic
Hello, Here's a patch to get rid of max_dgram_qlen proc option. All it does is slow down unix datagram packet sending, without giving the program any control over it. Applying it decreases code size, simplifies the code and makes poll behaviour more logical for connected datagram sockets in regar