Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>
Subject: [RFC] socket sk_sndmsg_page waste
Date: Tue, 06 Dec 2011 07:53:36 +0100	[thread overview]
Message-ID: <1323154416.2467.27.camel@edumazet-laptop> (raw)

TCP can steer one page of memory per socket to cook outgoing frames.

This means a machine handling long living sockets can consume a lot of
ram.

1.000.000 tcp sockets : up to 4GB of allocated memory, if some writes
had been done on these sockets.

It would make sense to use a per thread page as a pool, instead of a per
socket pool, and remove sk_sndmsg_page/off fields.

Problem with this strategy is impact outside of net tree, and a cost at
thread creation/destruction.

[ But this could be used in fs/pipe.c or fs/splice.c code..., so that
small writes() dont allocate a full page but try to reuse the "per
task_struct" page ]

             reply	other threads:[~2011-12-06  6:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-06  6:53 Eric Dumazet [this message]
2011-12-06 16:15 ` [RFC] socket sk_sndmsg_page waste Eric Dumazet
2011-12-06 19:01   ` 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=1323154416.2467.27.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /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