All of lore.kernel.org
 help / color / mirror / Atom feed
From: Satoshi OSHIMA <satoshi.oshima.fk@hitachi.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: netdev@vger.kernel.org, haoki@redhat.com,
	???? <yoshfuji@linux-ipv6.org>,
	"Yumiko SUGITA" <yumiko.sugita.yf@hitachi.com>
Subject: Re: [RFC/PATCH 2/3] UDP memory usage accounting: accounting unit and variable
Date: Fri, 28 Sep 2007 22:24:43 +0900	[thread overview]
Message-ID: <46FD009B.1010904@hitachi.com> (raw)
In-Reply-To: <p734pho9nb9.fsf@bingen.suse.de>

Hi,

Thank you for your comment.

Andi Kleen wrote:
> Satoshi OSHIMA <satoshi.oshima.fk@hitachi.com> writes:
>
>> This patch introduces global variable for UDP memory accounting.
>> The unit is page.
>
> The global variable doesn't seem to be very MP scalable, especially
> if you change it for each packet. This will be a very hot cache line,
> in the worst case bouncing around a large machine.

I understand what you pointed out. But I think the accounting
method I'm proposing is very similar to TCP accounting and per
socket accounting.
How do you think of it?


> Possible alternatives:
> - Per CPU variables

I'm afraid that sockets and socket buffers are handled on
various CPUs. I mean that socket creation might be done
on CPU-A but socket receiving might be done on CPU-B.

And per CPU variables must be counted up when socket
cap is checked. I'm afraid that per CPU vaiables are
also costly enough.


> - You only change the global on socket creation time (by pre
allocating a large
> amount) or when the system comes under memory pressure.
> - Batching of the global updates for multiple packets [that's a variant
> of the previous one, might be still too costly though]
>
> Also for such variables it's usually good to cache line pad them on SMP
> to avoid false sharing with something else.

I believe that memory usage accounting should be done accurately.
Currently I couldn't see how can we know the accurate memory
accounting only when the system is under memory pressure.

But I revised the patch to avoid some atomic operations.

If I could find the good way to avoid atomic operation more,
I will add it.

Satoshi Oshima

  parent reply	other threads:[~2007-09-28 13:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-21 12:26 [RFC/PATCH 2/3] UDP memory usage accounting: accounting unit and variable Satoshi OSHIMA
2007-09-21 13:10 ` Andi Kleen
2007-09-27 18:54   ` Hideo AOKI
2007-09-28 13:24   ` Satoshi OSHIMA [this message]
2007-09-29  3:22     ` Herbert Xu
  -- strict thread matches above, loose matches on Subject: below --
2007-09-28 13:40 Satoshi OSHIMA

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=46FD009B.1010904@hitachi.com \
    --to=satoshi.oshima.fk@hitachi.com \
    --cc=andi@firstfloor.org \
    --cc=haoki@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.org \
    --cc=yumiko.sugita.yf@hitachi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.