lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <49F149E5.1010304@cosmosbay.com>
Date:	Fri, 24 Apr 2009 07:11:01 +0200
From:	Eric Dumazet <dada1@...mosbay.com>
To:	David Miller <davem@...emloft.net>
CC:	jesse.brandeburg@...el.com, cl@...ux-foundation.org,
	netdev@...r.kernel.org, mchan@...adcom.com,
	bhutchings@...arflare.com
Subject: Re: about latencies

David Miller a écrit :
> From: Eric Dumazet <dada1@...mosbay.com>
> Date: Fri, 24 Apr 2009 01:07:06 +0200
> 
>> Brandeburg, Jesse a écrit :
>>> On Thu, 23 Apr 2009, Eric Dumazet wrote:
>>>> We could improve this.
>>>>
>>>> 1) dst_release at xmit time, should save a cache line ping-pong on general case
>>>> 2) sock_wfree() in advance, done at transmit time (generally the thread/cpu doing the send)
>>> how much does the effect socket accounting?  will the app then fill the 
>>> hardware tx ring all the time because there is no application throttling 
>>> due to delayed kfree?
>> tx ring is limited to 256 or 512 or 1024 elements, but yes this might
>> defeat udp mem accounting on sending side, unless using qdiscs...
> 
> I'm pretty sure you really can't do this.  It's been suggested
> countless times in the past.
> 
> The whole point of the socket send buffer limits is to eliminate
> the situation where one socket essentially hogs the TX queue of
> the device.


Yes agreed !

Without splitting sk_sleep and enlarging _again_ "struct sock",
cannot we make sock_def_write_space() smarter ? Avoiding scheduling
as the plague Your Honor :)

Dont we have a bit saying there is a sleeping writer ?

We dirty sk_callback_lock, and read "sk_wmem_alloc" and "sk_sndbuf",
we could first test a flag.



Actual function is : (not a patch, just as reference for convenience)

static void sock_def_write_space(struct sock *sk)
{
        read_lock(&sk->sk_callback_lock);

        /* Do not wake up a writer until he can make "significant"
         * progress.  --DaveM
         */
        if ((atomic_read(&sk->sk_wmem_alloc) << 1) <= sk->sk_sndbuf) {
                if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
                        wake_up_interruptible_sync_poll(sk->sk_sleep, POLLOUT |
                                                POLLWRNORM | POLLWRBAND);

                /* Should agree with poll, otherwise some programs break */
                if (sock_writeable(sk))
                        sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT);
        }

        read_unlock(&sk->sk_callback_lock);
}

Thank you

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ