public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Lee Revell <rlrevell@joe-job.com>
Cc: Mark_H_Johnson@raytheon.com, "K.R. Foley" <kr@cybsft.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Felipe Alfaro Solana <lkml@felipe-alfaro.com>,
	Daniel Schmitt <pnambic@unu.nu>,
	alsa-devel <alsa-devel@lists.sourceforge.net>,
	Rusty Russell <rusty@rustcorp.com.au>,
	netfilter-devel@lists.netfilter.org
Subject: Re: [patch] voluntary-preempt-2.6.9-rc1-bk4-Q8
Date: Thu, 2 Sep 2004 09:46:04 +0200	[thread overview]
Message-ID: <20040902074604.GA21144@elte.hu> (raw)
In-Reply-To: <1094110289.11364.32.camel@krustophenia.net>


* Lee Revell <rlrevell@joe-job.com> wrote:

> > these all seem to be single-packet processing latencies - it would be
> > quite hard to make those codepaths preemptible.
> 
> I suspected as much, these are not a problem.  The large latencies
> from reading the /proc filesystem are a bit worrisome (trace1.txt), I
> will report these again if they still happen with Q8.

conntrack's ct_seq ops indeed seems to have latency problems - the quick
workaround is to disable conntrack.

The reason for the latency is that ct_seq_start() does a read_lock() on
ip_conntrack_lock and only ct_seq_stop() releases it - possibly
milliseconds later. But the whole conntrack /proc code is quite flawed:

        READ_LOCK(&ip_conntrack_lock);

        if (*pos >= ip_conntrack_htable_size)
                return NULL;

        bucket = kmalloc(sizeof(unsigned int), GFP_KERNEL);
        if (!bucket) {
                return ERR_PTR(-ENOMEM);
        }
        *bucket = *pos;
        return bucket;

#1: we kmalloc(GFP_KERNEL) with a spinlock held and softirqs off - ouch!

#2: why does it do the kmalloc() anyway? It could store the position in
    the seq pointer just fine. No need to alloc an integer pointer to
    store the value in ...

#3: to fix the latency, ct_seq_show() could take the ip_conntrack_lock 
    and could check the current index against ip_conntrack_htable_size. 
    There's not much point in making this non-preemptible, there's 
    a 4K granularity anyway.

Rusty, what's going on in this code?

	Ingo

  reply	other threads:[~2004-09-02  7:44 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-30 19:13 [patch] voluntary-preempt-2.6.9-rc1-bk4-Q5 Mark_H_Johnson
2004-08-30 19:21 ` Ingo Molnar
2004-09-01 12:31   ` [patch] voluntary-preempt-2.6.9-rc1-bk4-Q5 - netdev_max_back_log is too small P.O. Gaillard
2004-09-01 13:05     ` Ingo Molnar
2004-09-02 11:24       ` [patch] voluntary-preempt-2.6.9-rc1-bk4-Q6 - network is no longer smooth P.O. Gaillard
2004-09-02 11:28         ` Ingo Molnar
2004-09-02 15:26           ` P.O. Gaillard
2004-08-31  8:49 ` [patch] voluntary-preempt-2.6.9-rc1-bk4-Q5 Ingo Molnar
2004-09-02  6:33 ` Ingo Molnar
2004-09-02  6:55   ` [patch] voluntary-preempt-2.6.9-rc1-bk4-Q8 Ingo Molnar
2004-09-02  7:04     ` Lee Revell
2004-09-02  7:15       ` Ingo Molnar
2004-09-02  7:31         ` Lee Revell
2004-09-02  7:46           ` Ingo Molnar [this message]
2004-09-03  1:10             ` Rusty Russell
2004-09-02 23:25         ` Lee Revell
2004-09-02 23:28           ` Ingo Molnar
2004-09-02 23:32             ` Lee Revell
2004-09-02  7:17       ` Ingo Molnar
2004-09-02  8:23     ` Ingo Molnar
2004-09-02 11:10     ` [patch] voluntary-preempt-2.6.9-rc1-bk4-Q9 Ingo Molnar
2004-09-02 12:14       ` Thomas Charbonnel
2004-09-02 13:16       ` Thomas Charbonnel
2004-09-02 13:23         ` Ingo Molnar
2004-09-02 14:38           ` Thomas Charbonnel
2004-09-02 21:57       ` [patch] voluntary-preempt-2.6.9-rc1-bk4-R0 Ingo Molnar
2004-09-02 22:06         ` Lee Revell
2004-09-02 22:14           ` Ingo Molnar
2004-09-02 22:15             ` Lee Revell
2004-09-03  0:24             ` Lee Revell
2004-09-03  3:17               ` Eric St-Laurent
2004-09-03  6:26                 ` Lee Revell
2004-09-03  6:36                   ` Ingo Molnar
2004-09-03  6:49                     ` Lee Revell
2004-09-03  7:01                       ` Ingo Molnar
2004-09-03  7:05                       ` Ingo Molnar
2004-09-03  7:40                         ` Lee Revell
2004-09-03  7:50                           ` Free Ekanayaka
2004-09-03  8:05                             ` Lee Revell
2004-09-03  9:05                               ` Free Ekanayaka
2004-09-03  9:25                               ` [patch] voluntary-preempt-2.6.9-rc1-bk4-R1 Ingo Molnar
2004-09-03  9:50                                 ` Luke Yelavich
2004-09-03 10:29                                   ` Ingo Molnar
2004-09-03 10:43                                     ` Luke Yelavich
2004-09-03 11:33                                 ` Thomas Charbonnel
2004-09-03 11:49                                   ` Ingo Molnar
2004-09-03 12:05                                     ` Thomas Charbonnel
2004-09-03 16:14                                     ` Thomas Charbonnel
2004-09-03 17:36                                       ` Thomas Charbonnel
2004-09-03 11:36                                 ` [patch] voluntary-preempt-2.6.9-rc1-bk4-R2 Ingo Molnar
2004-09-03  8:09                           ` [patch] voluntary-preempt-2.6.9-rc1-bk4-R0 Luke Yelavich
2004-09-03  8:13                             ` Lee Revell
2004-09-03  8:21                               ` Luke Yelavich
2004-09-03 12:52                               ` Luke Yelavich
2004-09-03 18:09                         ` K.R. Foley
2004-09-03 11:04         ` K.R. Foley
2004-09-03 17:02         ` K.R. Foley
2004-09-03 20:40           ` Lee Revell
2004-09-03 17:10         ` K.R. Foley
2004-09-03 18:17           ` Ingo Molnar
2004-09-03 18:36             ` K.R. Foley
2004-09-03 19:30             ` [patch] voluntary-preempt-2.6.9-rc1-bk4-R3 Ingo Molnar
2004-09-03 19:49               ` K.R. Foley
2004-09-04  3:39               ` K.R. Foley
2004-09-04  3:43               ` K.R. Foley
2004-09-04  6:41                 ` Ingo Molnar
2004-09-04 12:28                   ` K.R. Foley
2004-09-04  8:57                 ` Ingo Molnar
2004-09-04 10:16                   ` Lee Revell
2004-09-04 14:35                   ` K.R. Foley
2004-09-04 20:05                     ` Ingo Molnar
2004-09-03 18:39           ` [patch] voluntary-preempt-2.6.9-rc1-bk4-R0 Ingo Molnar
2004-09-03 18:41             ` K.R. Foley
  -- strict thread matches above, loose matches on Subject: below --
2004-09-02  7:57 [patch] voluntary-preempt-2.6.9-rc1-bk4-Q8 mika.penttila
2004-09-02  8:32 ` Ingo Molnar
2004-09-02  9:06   ` Peter Zijlstra

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=20040902074604.GA21144@elte.hu \
    --to=mingo@elte.hu \
    --cc=Mark_H_Johnson@raytheon.com \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=kr@cybsft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkml@felipe-alfaro.com \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=pnambic@unu.nu \
    --cc=rlrevell@joe-job.com \
    --cc=rusty@rustcorp.com.au \
    /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