From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Max Kellermann <max@duempel.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [conntrack-utils PATCH r7285 04/11] added alarm_pending()
Date: Wed, 23 Jan 2008 13:16:48 +0100 [thread overview]
Message-ID: <47973030.40704@netfilter.org> (raw)
In-Reply-To: <20080123115831.GA14427@swift.blarg.de>
Max Kellermann wrote:
> On 2008/01/23 12:50, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
>> Max Kellermann wrote:
>>> +int alarm_pending(struct alarm_list *alarm, struct timeval *tv)
>>> +{
>>> + if (list_empty(&alarm->head))
>>> + return 0;
>>> +
>>> + if (tv != NULL)
>>> + *tv = alarm->tv;
>> This introduces an extra copy.
>
> I know. This patch should make transition to libevent smooth.
> libevent still has this copy in evtimer_pending() but it is called
> rarely
I have noticed it during the first loop review.
> and libevent does not do a lookup in 2048 lists in every main
> loop iteration.
>>> + if (!alarm_pending(alarm, &tmp))
>>> + return 0;
>> I cannot think of a situation where alarm_pending returns true at the
>> moment.
>
> You mean, where alarm_pending returns false? The check is just here
> for completeness, you could replace it with an assertion.
Indeed. I like this extra checking for completeness. Applied without the
tv parameter.
--
"Los honestos son inadaptados sociales" -- Les Luthiers
next prev parent reply other threads:[~2008-01-23 12:17 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-22 14:10 [conntrack-utils PATCH r7285 00/11] conntrackd with libevent Max Kellermann
2008-01-22 14:10 ` [conntrack-utils PATCH r7285 01/11] -1 means error, not 0 Max Kellermann
2008-01-23 10:16 ` Pablo Neira Ayuso
2008-01-22 14:10 ` [conntrack-utils PATCH r7285 11/11] remove the alarm library Max Kellermann
2008-01-22 14:10 ` [conntrack-utils PATCH r7285 07/11] use size_t Max Kellermann
2008-01-23 12:29 ` Pablo Neira Ayuso
2008-01-23 12:37 ` Max Kellermann
2008-01-23 12:58 ` Pablo Neira Ayuso
2008-01-22 14:10 ` [conntrack-utils PATCH r7285 02/11] added struct local_server Max Kellermann
2008-01-23 10:36 ` Pablo Neira Ayuso
2008-01-22 14:10 ` [conntrack-utils PATCH r7285 09/11] added handler callback to mcast_sock Max Kellermann
2008-01-22 14:10 ` [conntrack-utils PATCH r7285 10/11] use libevent Max Kellermann
2008-01-22 14:10 ` [conntrack-utils PATCH r7285 03/11] moved process function pointer to struct local_server Max Kellermann
2008-01-23 10:45 ` Pablo Neira Ayuso
2008-01-23 10:52 ` Max Kellermann
2008-01-22 14:10 ` [conntrack-utils PATCH r7285 05/11] added missing ntohs() Max Kellermann
2008-01-23 11:07 ` Pablo Neira Ayuso
2008-01-22 14:10 ` [conntrack-utils PATCH r7285 06/11] remove obsolete prototypes Max Kellermann
2008-01-23 11:15 ` Pablo Neira Ayuso
2008-01-22 14:10 ` [conntrack-utils PATCH r7285 04/11] added alarm_pending() Max Kellermann
2008-01-23 11:50 ` Pablo Neira Ayuso
2008-01-23 11:58 ` Max Kellermann
2008-01-23 12:16 ` Pablo Neira Ayuso [this message]
2008-01-22 14:10 ` [conntrack-utils PATCH r7285 08/11] check if the received packet is large enough Max Kellermann
2008-01-23 11:46 ` Pablo Neira Ayuso
2008-01-23 12:07 ` [conntrack-utils PATCH r7285 00/11] conntrackd with libevent Pablo Neira Ayuso
2008-01-23 12:26 ` Max Kellermann
2008-01-23 12:50 ` Pablo Neira Ayuso
2008-01-25 18:01 ` Pablo Neira Ayuso
2008-01-25 18:03 ` 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=47973030.40704@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.