linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eliezer Tamir <eliezer.tamir@linux.intel.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Eliezer Tamir <eliezer.tamir@linux.jf.intel.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	Dave Miller <davem@davemloft.net>,
	Jesse Brandeburg <jesse.brandeburg@intel.com>,
	e1000-devel@lists.sourceforge.net,
	Willem de Bruijn <willemb@google.com>,
	Andi Kleen <andi@firstfloor.org>, HPA <hpa@zytor.com>,
	Eliezer Tamir <eliezer@tamir.org.il>
Subject: Re: [RFC PATCH 1/5] net: implement support for low latency socket polling
Date: Mon, 04 Mar 2013 10:43:36 +0200	[thread overview]
Message-ID: <51345EB8.9050309@linux.intel.com> (raw)
In-Reply-To: <1362335704.15793.81.camel@edumazet-glaptop>

On 03/03/2013 20:35, Eric Dumazet wrote:
> On Wed, 2013-02-27 at 09:55 -0800, Eliezer Tamir wrote:
>
>> index 821c7f4..d1d1016 100644
>> --- a/include/linux/skbuff.h
>> +++ b/include/linux/skbuff.h
>> @@ -408,6 +408,10 @@ struct sk_buff {
>>   	struct sock		*sk;
>>   	struct net_device	*dev;
>>
>> +#ifdef CONFIG_INET_LL_RX_POLL
>> +	struct napi_struct	*dev_ref; /* where this skb came from */
>> +#endif
>> +
>>   	/*
>>   	 * This is the control buffer. It is free to use for every
>>   	 * layer. Please put your private variables there. If you
>
> Yes, thats the killer, because :
>
> 1) It adds 8 bytes per skb, and we are going to reach the 256 bytes per
> sk_buff boundary. cloned skbs will use an extra cache line.
>
> It might make sense to union this on dma_cookie, as dma_cookie is only
> used on TX path.

I will try this out.

> 2) We need to reference count napi structs.
>
> For 2) , we would need to add a percpu ref counter (a bit like struct
> netdevice -> pcpu_refcnt)
>
> Alternative to 2) would be to use a generation id, incremented every
> time a napi used in spin polling enabled driver is dismantled (and freed
> after RCU grace period)

I like this option, because one would assume that the life expectancy of 
a napi is rather long. We can just increment the generation id any time 
any napi is disabled, which simplifies things.

There could be other configuration changes that would make our notion on 
where to poll outdated, for example, someone may have reprogrammed an RX 
filter. This is not as catastrophic as a napi going away but still.

Would it make sense to make this a generic mechanism?
One could for example increment the generation id every time the RTNL is 
taken. or is this too much?

Thanks,
Eliezer

  parent reply	other threads:[~2013-03-04  8:44 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-27 17:55 [RFC PATCH 0/5] net: low latency Ethernet device polling Eliezer Tamir
2013-02-27 17:55 ` [RFC PATCH 1/5] net: implement support for low latency socket polling Eliezer Tamir
2013-03-03 18:35   ` Eric Dumazet
2013-03-03 19:21     ` Andi Kleen
2013-03-03 21:20       ` Eric Dumazet
2013-03-04  3:55         ` Andi Kleen
2013-03-04  8:43     ` Eliezer Tamir [this message]
2013-03-04 14:52       ` Eric Dumazet
2013-03-04 15:28         ` Eliezer Tamir
2013-03-04 16:15           ` Eric Dumazet
2013-03-04  7:23   ` Cong Wang
2013-03-05 16:43   ` Ben Hutchings
2013-03-05 17:15     ` Eliezer Tamir
2013-03-05 19:57       ` David Miller
2013-03-05 19:55     ` David Miller
2013-03-05 20:03       ` H. Peter Anvin
2013-02-27 17:56 ` [RFC PATCH 2/5] tcp: add TCP support for low latency receive poll Eliezer Tamir
2013-03-05 17:13   ` Ben Hutchings
2013-02-27 17:56 ` [RFC PATCH 3/5] ixgbe: Add support for ndo_ll_poll Eliezer Tamir
2013-02-27 18:41   ` Eric Dumazet
2013-02-27 19:20     ` Eliezer Tamir
2013-03-05 17:26   ` Ben Hutchings
2013-03-05 17:28     ` Ben Hutchings
2013-03-05 17:36       ` Eric Dumazet
2013-02-27 17:56 ` [RFC PATCH 4/5] ixgbe: add extra stats " Eliezer Tamir
2013-02-27 17:56 ` [RFC PATCH 5/5] ixgbe: kprobes latency test module Eliezer Tamir
2013-02-27 18:07 ` [RFC PATCH 0/5] net: low latency Ethernet device polling Eliezer Tamir
2013-02-27 18:13 ` Stephen Hemminger
2013-02-27 18:47   ` Tom Herbert
2013-02-27 19:17     ` Eliezer Tamir
2013-03-04 22:34       ` Ben Hutchings
2013-02-27 19:58 ` Rick Jones
2013-02-27 20:40   ` Eliezer Tamir
2013-02-27 21:42     ` Ben Greear
2013-02-28  8:38       ` Eliezer Tamir
2013-03-01 21:24 ` David Miller
2013-03-01 22:57   ` Tom Herbert
2013-03-02 17:02   ` Eliezer Tamir
2013-03-04  7:37 ` Cong Wang
2013-03-04  8:19   ` Eliezer Tamir
2013-03-04  8:46     ` Eliezer Tamir
2013-03-04 17:19 ` Stephen Hemminger

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=51345EB8.9050309@linux.intel.com \
    --to=eliezer.tamir@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=davem@davemloft.net \
    --cc=e1000-devel@lists.sourceforge.net \
    --cc=eliezer.tamir@linux.jf.intel.com \
    --cc=eliezer@tamir.org.il \
    --cc=eric.dumazet@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=willemb@google.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;
as well as URLs for NNTP newsgroup(s).