Re: udp ping pong with various process bindings (and correct cpu mappings)

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Christoph Lameter <cl@...>
Cc: <jesse.brandeburg@...>, <netdev@...>, <bhutchiings@...>, <mchan@...>, David Miller <davem@...>
Date: Friday, April 24, 2009 - 5:18 pm

Christoph Lameter a écrit :

Thanks Christoph for doing this

I believe we can restore pre 2.6.25 performance level with litle changes.

[Problem is that on 2.6.25, UDP mem accounting forced us to add a callback
to sock_def_write_space() at skb TX completion time. This function
then wake up all thread(s) blocked in revfrom() syscall. Once awaken,
thread(s) block again because no frame was received]


Davide Libenzi added a 'key' opaque argument to wakeups so that eventpoll
can avoid unnecessary wakeups. This infrastructure could be used on other paths.
(Most important being this one : receivers, because writers are rarely blocked
because of sndbuffer filled)

commit 37e5540b3c9d838eb20f2ca8ea2eb8072271e403
Author: Davide Libenzi <davidel@xmailserver.org>
Date:   Tue Mar 31 15:24:21 2009 -0700

    epoll keyed wakeups: make sockets use keyed wakeups

    Add support for event-aware wakeups to the sockets code.  Events are
    delivered to the wakeup target, so that epoll can avoid spurious wakeups
    for non-interesting events.

commit : 2dfa4eeab0fc7e8633974f2770945311b31eedf6

    epoll keyed wakeups: teach epoll about hints coming with the wakeup key

    Use the events hint now sent by some devices, to avoid unnecessary wakeups
    for events that are of no interest for the caller.  This code handles both
    devices that are sending keyed events, and the ones that are not (and
    event the ones that sometimes send events, and sometimes don't).

We can add support for these key on regular socket code, so that a process
waiting on receive wont be scheduled because a TX completion occured.


Standard way is using autoremove_wake_function() :

int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key)
{
        int ret = default_wake_function(wait, mode, sync, key);

        if (ret)
                list_del_init(&wait->task_list);
        return ret;
}


/* this function ignores "key" argument */
int default_wake_function(wait_queue_t *curr, unsigned mode, int sync,
                          void *key)
{
        return try_to_wake_up(curr->private, mode, sync);
}


While new 'keyed' events can do better :

static int ep_poll_callback(wait_queue_t *wait, unsigned mode, int sync, void *key)
{
        int pwake = 0;
        unsigned long flags;
        struct epitem *epi = ep_item_from_wait(wait);
        struct eventpoll *ep = epi->ep;

        spin_lock_irqsave(&ep->lock, flags);


...
        /*
         * Check the events coming with the callback. At this stage, not
         * every device reports the events in the "key" parameter of the
         * callback. We need to be able to handle both cases here, hence the
         * test for "key" != NULL before the event match test.
         */
        if (key && !((unsigned long) key & epi->event.events))
                goto out_unlock;

}


I'll try to cook a patch in following days, unless someone beats me :)

Thanks

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
udp ping pong with various process bindings (and correct cpu..., Christoph Lameter, (Fri Apr 24, 4:10 pm)
[PATCH] poll: Avoid extra wakeups, Eric Dumazet, (Sun Apr 26, 6:46 am)
Re: [PATCH] poll: Avoid extra wakeups, Andi Kleen, (Tue Apr 28, 10:21 am)
[PATCH] poll: Avoid extra wakeups in select/poll, Eric Dumazet, (Tue Apr 28, 11:06 am)
Re: [PATCH] poll: Avoid extra wakeups in select/poll, Ingo Molnar, (Wed Apr 29, 5:16 am)
Re: [PATCH] poll: Avoid extra wakeups in select/poll, Eric Dumazet, (Wed Apr 29, 5:36 am)
Re: [PATCH] poll: Avoid extra wakeups in select/poll, Ingo Molnar, (Wed Apr 29, 6:27 am)
Re: [PATCH] poll: Avoid extra wakeups in select/poll, Eric Dumazet, (Wed Apr 29, 8:29 am)
Re: [PATCH] poll: Avoid extra wakeups in select/poll, Davide Libenzi, (Wed Apr 29, 11:53 am)
Re: [PATCH] poll: Avoid extra wakeups in select/poll, Ingo Molnar, (Wed Apr 29, 9:07 am)
Re: [PATCH] poll: Avoid extra wakeups in select/poll, Andrew Morton, (Wed Apr 29, 3:20 am)
Re: [PATCH] poll: Avoid extra wakeups in select/poll, Eric Dumazet, (Wed Apr 29, 3:39 am)
Re: [PATCH] poll: Avoid extra wakeups in select/poll, Eric Dumazet, (Wed Apr 29, 4:26 am)
Re: [PATCH] poll: Avoid extra wakeups in select/poll, Andi Kleen, (Wed Apr 29, 3:35 am)
Re: [PATCH] poll: Avoid extra wakeups in select/poll, Ingo Molnar, (Wed Apr 29, 5:22 am)
Re: [PATCH] poll: Avoid extra wakeups in select/poll, Eric Dumazet, (Wed Apr 29, 3:37 am)
Re: [PATCH] poll: Avoid extra wakeups in select/poll, Christoph Lameter, (Tue Apr 28, 3:05 pm)
Re: [PATCH] poll: Avoid extra wakeups in select/poll, Eric Dumazet, (Tue Apr 28, 4:05 pm)
Re: [PATCH] poll: Avoid extra wakeups in select/poll, Christoph Lameter, (Tue Apr 28, 4:14 pm)
Re: [PATCH] poll: Avoid extra wakeups in select/poll, Eric Dumazet, (Tue Apr 28, 4:33 pm)
Re: [PATCH] poll: Avoid extra wakeups in select/poll, Christoph Lameter, (Tue Apr 28, 4:49 pm)
Re: [PATCH] poll: Avoid extra wakeups in select/poll, Eric Dumazet, (Tue Apr 28, 5:04 pm)
Re: [PATCH] poll: Avoid extra wakeups in select/poll, Eric Dumazet, (Tue Apr 28, 5:11 pm)
Re: [PATCH] poll: Avoid extra wakeups in select/poll, Ingo Molnar, (Wed Apr 29, 5:11 am)
Re: [PATCH] poll: Avoid extra wakeups in select/poll, Eric Dumazet, (Thu Apr 30, 6:49 am)
Re: [PATCH] poll: Avoid extra wakeups in select/poll, Ingo Molnar, (Thu Apr 30, 7:57 am)
Re: [PATCH] poll: Avoid extra wakeups in select/poll, Eric Dumazet, (Thu Apr 30, 10:08 am)
Re: [PATCH] poll: Avoid extra wakeups in select/poll, Paul E. McKenney, (Thu Apr 30, 5:24 pm)
[BUG] perf_counter: change cpu frequencies , Eric Dumazet, (Thu Apr 30, 12:07 pm)
Re: [BUG] perf_counter: change cpu frequencies, Eric Dumazet, (Sun May 3, 2:06 am)
Re: [BUG] perf_counter: change cpu frequencies, Ingo Molnar, (Sun May 3, 3:25 am)
Re: [BUG] perf_counter: change cpu frequencies, Eric Dumazet, (Mon May 4, 6:39 am)
Re: [PATCH] poll: Avoid extra wakeups in select/poll, Christoph Lameter, (Tue Apr 28, 5:00 pm)
Re: [PATCH] poll: Avoid extra wakeups in select/poll, Eric Dumazet, (Tue Apr 28, 5:05 pm)
Re: [PATCH] poll: Avoid extra wakeups in select/poll, Christoph Lameter, (Tue Apr 28, 5:04 pm)
Re: [PATCH] poll: Avoid extra wakeups, Eric Dumazet, (Tue Apr 28, 10:58 am)
Re: [PATCH] poll: Avoid extra wakeups, David Miller, (Tue Apr 28, 5:15 am)
Re: [PATCH] poll: Avoid extra wakeups, Eric Dumazet, (Tue Apr 28, 5:24 am)
Re: [PATCH] poll: Avoid extra wakeups, Jarek Poplawski, (Sun Apr 26, 9:33 am)
Re: [PATCH] poll: Avoid extra wakeups, Eric Dumazet, (Sun Apr 26, 10:27 am)
Re: udp ping pong with various process bindings (and correct..., Eric Dumazet, (Fri Apr 24, 5:18 pm)