public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Davide Libenzi <davidel@xmailserver.org>
Cc: Alban Crequy <alban.crequy@collabora.co.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Stephen Hemminger <shemminger@vyatta.com>,
	Cyrill Gorcunov <gorcunov@openvz.org>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	netdev@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Pauli Nieminen <pauli.nieminen@collabora.co.uk>,
	Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: [PATCH 0/1] RFC: poll/select performance on datagram sockets
Date: Fri, 29 Oct 2010 22:20:14 +0200	[thread overview]
Message-ID: <1288383614.2680.10.camel@edumazet-laptop> (raw)
In-Reply-To: <alpine.DEB.2.00.1010291306390.8517@davide-lnx1>

Le vendredi 29 octobre 2010 à 13:08 -0700, Davide Libenzi a écrit :

> Yeah, epoll does check for event hints coming with the callback wakeup, 
> and avoid waking up epoll_wait() waiters, for non matching events.
> Most of the devices we care about, have been modified to report the event 
> mask with the wakeup call.

Alban test program is _very_ pathological :

All the time is consumed in do_select() because of false sharing between
two tasks.

We can probably rearrange variables in do_select() to make this false
sharing less problematic. I am taking a look at this.

Events: 3K cycles
+     26.14%  uclient  [kernel.kallsyms]  [k] do_raw_spin_lock              
+     21.11%  uclient  [kernel.kallsyms]  [k] do_select                     
+     13.38%  uclient  [kernel.kallsyms]  [k] pollwake                      
+      9.22%  uclient  [kernel.kallsyms]  [k] unix_dgram_poll               
+      5.24%  uclient  [kernel.kallsyms]  [k] unix_peer_get                 
+      3.04%  uclient  [kernel.kallsyms]  [k] _raw_spin_unlock_irqrestore   
+      3.03%  uclient  [kernel.kallsyms]  [k] task_rq_lock                  
+      2.85%  uclient  [kernel.kallsyms]  [k] do_raw_spin_unlock            
+      1.84%  uclient  [kernel.kallsyms]  [k] try_to_wake_up                
+      1.55%  uclient  [kernel.kallsyms]  [k] fget_light                    
+      1.34%  uclient  [kernel.kallsyms]  [k] core_kernel_text              


annotate :

   5.66 :        410fb342:       85 ff                   test   %edi,%edi                  
    0.00 :        410fb344:       74 1f                   je     410fb365 <do_select+0x3d5> 
    0.13 :        410fb346:       85 b5 6c fd ff ff       test   %esi,-0x294(%ebp)          
    0.00 :        410fb34c:       74 17                   je     410fb365 <do_select+0x3d5> 
         :                                                        res_out |= bit;           
    0.00 :        410fb34e:       09 b5 5c fd ff ff       or     %esi,-0x2a4(%ebp)          
         :                                                        retval++;                 
    0.00 :        410fb354:       83 85 64 fd ff ff 01    addl   $0x1,-0x29c(%ebp)          
         :                                                        wait = NULL;              
    0.00 :        410fb35b:       c7 85 7c fd ff ff 00    movl   $0x0,-0x284(%ebp)          
    0.00 :        410fb362:       00 00 00                                                  
         :                                               }            
         :                                                if ((mask & POLLEX_SET) && (ex & bit)) {
   43.27 :        410fb365:       85 d2                   test   %edx,%edx                 
    0.00 :        410fb367:       0f 84 f3 fe ff ff       je     410fb260 <do_select+0x2d0>
    0.00 :        410fb36d:       85 b5 74 fd ff ff       test   %esi,-0x28c(%ebp)         
    0.00 :        410fb373:       0f 84 e7 fe ff ff       je     410fb260 <do_select+0x2d0>
         :                                                        res_ex |= bit;           
    0.00 :        410fb379:       09 b5 58 fd ff ff       or     %esi,-0x2a8(%ebp)         
         :                                if (all_bits == 0) {   
         :                                        i += __NFDBITS;
         :                                        continue;
         :                                }

  reply	other threads:[~2010-10-29 20:20 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-29 18:18 [PATCH 0/1] RFC: poll/select performance on datagram sockets Alban Crequy
2010-10-29 18:21 ` [PATCH] " Alban Crequy
2010-10-29 19:27 ` [PATCH 0/1] RFC: " Eric Dumazet
2010-10-29 20:08   ` Davide Libenzi
2010-10-29 20:20     ` Eric Dumazet [this message]
2010-10-29 20:46     ` Davide Libenzi
2010-10-29 21:05       ` Eric Dumazet
2010-10-29 21:57         ` Davide Libenzi
2010-10-29 22:08           ` Eric Dumazet
2010-10-30  9:53       ` [PATCH] af_unix: optimize unix_dgram_poll() Eric Dumazet
2010-10-30 17:45         ` Davide Libenzi
2010-10-29 20:20   ` [PATCH 0/1] RFC: poll/select performance on datagram sockets Jesper Juhl
2010-10-29 20:40     ` David Miller
2010-10-29 20:45       ` Eric Dumazet
2010-10-30  6:44   ` [PATCH] af_unix: unix_write_space() use keyed wakeups Eric Dumazet
2010-10-30 15:03     ` Davide Libenzi
2010-11-08 21:44       ` David Miller
2010-10-30 21:36     ` Alban Crequy
     [not found]       ` <1290554876.2158.5.camel@Nokia-N900-51-1>
2010-11-24  0:20         ` Alban Crequy
2010-11-24  0:28           ` Eric Dumazet
2010-10-30 11:34   ` [PATCH 0/1] RFC: poll/select performance on datagram sockets Alban Crequy
2010-10-30 12:53     ` Eric Dumazet
2010-10-30 13:17       ` Eric Dumazet
     [not found]         ` <20101030224703.065e70f6@chocolatine.cbg.collabora.co.uk>
2010-10-31 15:36           ` [PATCH 1/2] af_unix: fix unix_dgram_poll() behavior for EPOLLOUT event Eric Dumazet
2010-10-31 19:07             ` Davide Libenzi
2010-11-08 21:44             ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1288383614.2680.10.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=adobriyan@gmail.com \
    --cc=alban.crequy@collabora.co.uk \
    --cc=davem@davemloft.net \
    --cc=davidel@xmailserver.org \
    --cc=gorcunov@openvz.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pauli.nieminen@collabora.co.uk \
    --cc=rweikusat@mssgmbh.com \
    --cc=shemminger@vyatta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox