All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Max Kellermann <max@duempel.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: conntrackd: questions about the new alarm implementation
Date: Mon, 21 Jan 2008 14:18:39 +0100	[thread overview]
Message-ID: <47949BAF.6020203@netfilter.org> (raw)
In-Reply-To: <20080121130520.GB29741@swift.blarg.de>

Max Kellermann wrote:
> On 2008/01/21 13:55, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
>> Max Kellermann wrote:
>>> I have had a look at your new alarm.c.  I have a few questions about
>>> it:
>>>
>>> - Please explain why you now have 2048 (!) alarm queues, where the
>>>   correct one is determined by hashing the alarm struct.  I fail to
>>>   imagine how this hashing might be useful.  I can only see that it
>>>   makes the code more complex and 2048 times slower - except for
>>>   add_alarm(), which becomes a little bit faster, but there are only
>>>   few add_alarm() invocations compared with get_next_alarm_run() and
>>>   do_alarm_run().
>> This assumption is true for stats and sync-ftfw. However, it's not for
>> the sync-alarm implementation. The previous approach sucks up CPU in
>> add_alarm() with 25000 connections. Current the benchmarks report
>> smoother results.
> 
> I wasn't aware that the alarm library has to scale up to so many alarm
> objects.  Of course, linear search in a linked list is slow in these
> dimensions, but there *has* to be a better algorithm. 

Sure. Current approach gives good results to my benchmarks and I can
make peace since it's not linear anymore ;).

> I will send a patch as soon as I have time to think about that.

Great. I bet that this will be a win for conntrackd.

-- 
"Los honestos son inadaptados sociales" -- Les Luthiers

  reply	other threads:[~2008-01-21 13:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-21  6:20 conntrackd: questions about the new alarm implementation Max Kellermann
2008-01-21 12:55 ` Pablo Neira Ayuso
2008-01-21 13:05   ` Max Kellermann
2008-01-21 13:18     ` Pablo Neira Ayuso [this message]
2008-01-21 13:33       ` Max Kellermann
2008-01-21 13:52         ` Pablo Neira Ayuso

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=47949BAF.6020203@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=max@duempel.org \
    --cc=netfilter-devel@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 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.