netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <dada1@cosmosbay.com>
To: David Miller <davem@davemloft.net>
Cc: haoki@redhat.com, herbert@gondor.apana.org.au,
	vladislav.yasevich@hp.com, netdev@vger.kernel.org,
	lksctp-developers@lists.sourceforge.net, tyasui@redhat.com,
	mhiramat@redhat.com, satoshi.oshima.fk@hitachi.com,
	billfink@mindspring.com, andi@firstfloor.org,
	johnpol@2ka.mipt.ru, shemminger@linux-foundation.org,
	yoshfuji@linux-ipv6.org, yumiko.sugita.yf@hitachi.com
Subject: Re: [PATCH 0/4] New interface for memory accounting (take 1)
Date: Mon, 31 Dec 2007 16:17:37 +0100	[thread overview]
Message-ID: <47790811.9080004@cosmosbay.com> (raw)
In-Reply-To: <20071230.233413.117211235.davem@davemloft.net>

[-- Attachment #1: Type: text/plain, Size: 1645 bytes --]

David Miller a écrit :
> From: Hideo AOKI <haoki@redhat.com>
> Date: Sun, 30 Dec 2007 03:47:33 -0500
> 
>> Hello,
>>
>> This patch set introduces new memory accounting interface.
>> Current interface is written for stream protocols only.
>> To enable memory accounting in other protocols (e.g. UDP),
>> I enhanced the interface and updated TCP and SCTP memory
>> accounting.
>>
>> The patch set consists of the following 4 patches.
>>
>> [1/4] introducing new memory accounting interface
>> [2/4] adding memory accounting points to consolidate functions
>> [3/4] updating TCP to use new interface
>> [4/4] updating SCTP to use new interface
>>
>> The patch set was tested on net-2.6.25 tree.
> 
> I like this work very much and will add this to net-2.6.25
> But I will have to combine it all into one patch.
> 
> You cannot have one patch which breaks the build in any way.  All of
> the kernel must build properly after each patch in your patchset is
> applied.
> 
> Since patch 1 renames all of the sk_stream_*() functions, TCP and SCTP
> stop building.
> 
> We enforce this rule, otherwise when users try to use "git bisect" to
> find out where regressions are added, they will get stuck in places
> like this where the tree will not build due to such careless
> changesets.

Hi David

Could you add the following patch, because it apparently was lost
during the battle :)

Thank you

[PATCH] use SK_MEM_QUANTUM_SHIFT in __sk_mem_reclaim()

Avoid an expensive divide (as done in commit 
18030477e70a826b91608aee40a987bbd368fec6 but lost in commit 
23821d2653111d20e75472c8c5003df1a55309a8)


Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>

[-- Attachment #2: __sk_mem_reclaim.patch --]
[-- Type: text/plain, Size: 413 bytes --]

diff --git a/net/core/sock.c b/net/core/sock.c
index 8c184c4..3804e7d 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1476,7 +1476,7 @@ void __sk_mem_reclaim(struct sock *sk)
 {
 	struct proto *prot = sk->sk_prot;
 
-	atomic_sub(sk->sk_forward_alloc / SK_MEM_QUANTUM,
+	atomic_sub(sk->sk_forward_alloc >> SK_MEM_QUANTUM_SHIFT,
 		   prot->memory_allocated);
 	sk->sk_forward_alloc &= SK_MEM_QUANTUM - 1;
 

  reply	other threads:[~2007-12-31 15:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-30  8:47 [PATCH 0/4] New interface for memory accounting (take 1) Hideo AOKI
2007-12-30  8:51 ` [PATCH 1/4] [CORE]: introducing new memory accounting interface Hideo AOKI
2007-12-30  8:51 ` [PATCH 2/4] [CORE]: adding memory accounting points Hideo AOKI
2007-12-31  7:58   ` David Miller
2007-12-31 18:52     ` Hideo AOKI
2007-12-30  8:53 ` [PATCH 3/4] [TCP]: using new interface Hideo AOKI
2007-12-30  8:54 ` [PATCH 4/4] [SCTP]: " Hideo AOKI
2007-12-31  7:34 ` [PATCH 0/4] New interface for memory accounting (take 1) David Miller
2007-12-31 15:17   ` Eric Dumazet [this message]
2007-12-31 19:03     ` Hideo AOKI
2007-12-31 23:01     ` David Miller
2007-12-31 18:46   ` Hideo AOKI

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=47790811.9080004@cosmosbay.com \
    --to=dada1@cosmosbay.com \
    --cc=andi@firstfloor.org \
    --cc=billfink@mindspring.com \
    --cc=davem@davemloft.net \
    --cc=haoki@redhat.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=johnpol@2ka.mipt.ru \
    --cc=lksctp-developers@lists.sourceforge.net \
    --cc=mhiramat@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=satoshi.oshima.fk@hitachi.com \
    --cc=shemminger@linux-foundation.org \
    --cc=tyasui@redhat.com \
    --cc=vladislav.yasevich@hp.com \
    --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 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).