From: "YOSHIFUJI Hideaki / 吉藤英明" <yoshfuji@linux-ipv6.org>
To: herbert@gondor.apana.org.au, meissner@suse.de
Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org
Subject: Re: [patch] do not readlock all buckets in /proc/net/tcp
Date: Mon, 05 Jul 2004 21:25:22 +0900 (JST) [thread overview]
Message-ID: <20040705.212522.126409437.yoshfuji@linux-ipv6.org> (raw)
In-Reply-To: <20040705120610.GA5728@gondor.apana.org.au>
In article <20040705120610.GA5728@gondor.apana.org.au> (at Mon, 5 Jul 2004 22:06:10 +1000), Herbert Xu <herbert@gondor.apana.org.au> says:
> On Mon, Jul 05, 2004 at 01:35:55PM +0200, Marcus Meissner wrote:
> >
> > Oh, and NETLINK+TCP_DIAG seems to have the same readlock contention problem,
> > see tcpdiag_dump().
>
> Then you wouldn't mind adding this optimisation for tcp_diag as well,
> right? :)
here it is. :-)
Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
===== net/ipv4/tcp_diag.c 1.15 vs edited =====
--- 1.15/net/ipv4/tcp_diag.c 2004-06-08 07:27:58 +09:00
+++ edited/net/ipv4/tcp_diag.c 2004-07-05 21:18:17 +09:00
@@ -522,9 +522,13 @@
if (i > s_i)
s_num = 0;
- read_lock_bh(&head->lock);
-
num = 0;
+
+ if (hlist_empty(&head->chain) &&
+ (!(r->tcpdiag_states&TCPF_TIME_WAIT) || hlist_empty(&head->chain)))
+ continue;
+
+ read_lock_bh(&head->lock);
sk_for_each(sk, node, &head->chain) {
struct inet_opt *inet = inet_sk(sk);
--
Hideaki YOSHIFUJI @ USAGI Project <yoshfuji@linux-ipv6.org>
GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA
next prev parent reply other threads:[~2004-07-05 12:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-05 11:09 [patch] do not readlock all buckets in /proc/net/tcp Marcus Meissner
2004-07-05 11:27 ` Herbert Xu
2004-07-05 11:35 ` Marcus Meissner
2004-07-05 12:06 ` Herbert Xu
2004-07-05 12:25 ` YOSHIFUJI Hideaki / 吉藤英明 [this message]
2004-07-05 12:45 ` Marcus Meissner
2004-07-05 13:25 ` YOSHIFUJI Hideaki / 吉藤英明
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=20040705.212522.126409437.yoshfuji@linux-ipv6.org \
--to=yoshfuji@linux-ipv6.org \
--cc=herbert@gondor.apana.org.au \
--cc=meissner@suse.de \
--cc=netdev@oss.sgi.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).