netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: peter.p.waskiewicz.jr@intel.com
Cc: netdev@vger.kernel.org, jeff@garzik.org,
	auke-jan.h.kok@intel.com, hadi@cyberus.ca, kaber@trash.net
Subject: Re: [PATCH 3/3] NET: [CORE] Stack changes to add multiqueue hardware support API
Date: Tue, 19 Jun 2007 15:37:58 -0700 (PDT)	[thread overview]
Message-ID: <20070619.153758.84956272.davem@davemloft.net> (raw)
In-Reply-To: <D5C1322C3E673F459512FB59E0DDC329031117B0@orsmsx414.amr.corp.intel.com>

From: "Waskiewicz Jr, Peter P" <peter.p.waskiewicz.jr@intel.com>
Date: Tue, 19 Jun 2007 13:01:18 -0700

> I've been thinking about this more today, so please bear with me if I'm
> missing something.  Right now, with how qdisc_restart() is running, we'd
> definitely call netif_subqueue_stopped(dev, skb->queue_mapping) for all
> multi-ring and single-ring devices.  However, with Jamal's and Krishna's
> qdisc_restart() rewrite patch, the checks for netif_queue_stopped() and
> netif_subqueue_stopped() would be pushed into the qdisc's ->dequeue()
> functions.  If that's the case, then the only checks on
> egress_subqueue[x] would be for multi-ring adapters, or if someone was
> silly enough to load sch_{rr|prio} onto a single-ring device with
> multiqueue hardware support compiled in.  Given all of that, I'm not
> sure allocating egress_subqueue[0] at compile time or runtime would make
> any difference either way.  If I'm missing something, please let me know
> - I'd like to reduce any unnecessary pointer dereferences if possible,
> but given the proposed qdisc_restart(), I think the code as-is would be
> ok.

It's not being allocated at "compile time", it's being allocated
linearly into one block of ram in order to avoid pointer
derefs but it's still "dynamic" in that the size isn't known
until the alloc_netdev() call.

We do this trick all over the networking, TCP sockets are 3 or 4
different structures, all allocated into a linear block of
memory so that:

1) only one memory allocation needs to be done for each object
   create, this is not relevant for the net_device case
   except in extreme examples bringing thousands of devices
   up and down which I suppose someone can give a realistic
   example of :-)

2) each part can be accessed as an offset from the other instead
   of a pointer deref which costs a cpu memory read

Please change the allocation strategy as I recommended, thanks.

  reply	other threads:[~2007-06-19 22:37 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-18 18:42 [PATCH] NET: Multiple queue hardware support PJ Waskiewicz
2007-06-18 18:42 ` [PATCH 1/3] NET: [DOC] Multiqueue hardware support documentation PJ Waskiewicz
2007-06-18 18:42 ` [PATCH 2/3] NET: [SCHED] Qdisc changes and sch_rr added for multiqueue PJ Waskiewicz
2007-06-18 19:05   ` Patrick McHardy
2007-06-18 20:36     ` Waskiewicz Jr, Peter P
2007-06-18 20:54       ` Patrick McHardy
2007-06-18 21:04         ` Waskiewicz Jr, Peter P
2007-06-18 21:11           ` Patrick McHardy
2007-06-21 17:55         ` Waskiewicz Jr, Peter P
2007-06-21 18:04           ` Patrick McHardy
2007-06-21 18:12             ` Waskiewicz Jr, Peter P
2007-06-21 18:17               ` Patrick McHardy
2007-06-21 18:23                 ` Waskiewicz Jr, Peter P
2007-06-21 19:10                   ` Patrick McHardy
2007-06-21 20:15                     ` Waskiewicz Jr, Peter P
2007-06-18 18:42 ` [PATCH 3/3] NET: [CORE] Stack changes to add multiqueue hardware support API PJ Waskiewicz
2007-06-18 19:10   ` Patrick McHardy
2007-06-18 20:26     ` Waskiewicz Jr, Peter P
2007-06-18 20:28       ` Patrick McHardy
2007-06-19  6:28   ` David Miller
2007-06-19 17:31     ` Waskiewicz Jr, Peter P
2007-06-19 20:01     ` Waskiewicz Jr, Peter P
2007-06-19 22:37       ` David Miller [this message]
2007-06-19 23:11         ` Waskiewicz Jr, Peter P

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=20070619.153758.84956272.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=auke-jan.h.kok@intel.com \
    --cc=hadi@cyberus.ca \
    --cc=jeff@garzik.org \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --cc=peter.p.waskiewicz.jr@intel.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).