From: Bruce Richardson <bruce.richardson@intel.com>
To: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2] Change alarm cancel function to thread-safe:
Date: Mon, 29 Sep 2014 11:37:47 +0100 [thread overview]
Message-ID: <20140929103747.GC12072@BRICHA3-MOBL> (raw)
In-Reply-To: <2601191342CEEE43887BDE71AB9772582137D7F1@IRSMSX104.ger.corp.intel.com>
On Fri, Sep 26, 2014 at 02:13:55PM +0000, Ananyev, Konstantin wrote:
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Neil Horman
> > Sent: Friday, September 26, 2014 2:40 PM
> > To: Wodkowski, PawelX
> > Cc: dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH v2] Change alarm cancel function to thread-safe:
> >
> > On Fri, Sep 26, 2014 at 12:37:54PM +0000, Wodkowski, PawelX wrote:
> > > > So basically cancel() just set ALARM_CANCELLED and leaves actual alarm
> > > > deletion to the callback()?
> > > > That was the thought, yes.
> > > >
> > > > > I think it is doable - but I don't see any real advantage with that approach.
> > > > > Yes, code will become a bit simpler, as we'll have one point when we remove
> > > > alarm from the list.
> > > > Yes, that would be the advantage, that the code would be much simpler.
> > > >
> > > > > But from other side, imagine such simple test-case:
> > > > >
> > > > > for (i = 0; i < 0x100000; i++) {
> > > > > rte_eal_alarm_set(ONE_MIN, cb_func, (void *)i);
> > > > > rte_eal_alarm_cancel(cb_func, (void *)i);
> > > > > }
> > > > >
> > > > > We'll endup with 1M of cancelled, but still not removed entries in the
> > > > alarm_list.
> > > > > With current implementation that means - few MBs of wasted memory,
> > > > Thats correct, and the tradeoff to choose between. Do you want simpler code
> > > > that is easier to maintain, or do you want a high speed cancel and set
> > > > operation. I'm not aware of all the use cases, but I have a hard time seeing
> > > > a use case in which the in-flight alarm list grows unboundedly large, which in
> > > > my mind mitigates the risk of deferred removal, but I'm perfectly willing to
> > > > believe that there are use cases which I'm not aware of.
>
> After executing example above - from user perspective there is no active alarms in the system at all.
> Though in fact alarm_list contains 1M entries.
This would concern me. It's likely that in applications, e.g. those with a
network stack for instance, timers could be used for timeouts e.g. on
connections, which would mean that the common case by far would be for
timers to be cancelled or rescheduled without ever timing out.
/Bruce
next prev parent reply other threads:[~2014-09-29 10:31 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-25 12:56 Michal Jastrzebski
2014-09-25 13:11 ` Ananyev, Konstantin
2014-09-25 15:08 ` Neil Horman
2014-09-25 16:03 ` Ananyev, Konstantin
2014-09-25 17:23 ` Neil Horman
2014-09-25 23:24 ` Ananyev, Konstantin
2014-09-26 11:46 ` Neil Horman
2014-09-26 12:37 ` Wodkowski, PawelX
2014-09-26 13:40 ` Neil Horman
2014-09-26 14:01 ` Wodkowski, PawelX
2014-09-26 15:01 ` Neil Horman
2014-09-26 15:41 ` Ananyev, Konstantin
2014-09-26 16:21 ` Neil Horman
2014-09-26 18:07 ` Ananyev, Konstantin
2014-09-26 19:39 ` Neil Horman
2014-09-28 16:12 ` Ananyev, Konstantin
2014-09-28 20:47 ` Neil Horman
2014-09-29 6:40 ` Wodkowski, PawelX
2014-09-29 9:50 ` Ananyev, Konstantin
2014-09-29 10:11 ` Wodkowski, PawelX
2014-09-29 10:33 ` Bruce Richardson
2014-09-30 11:13 ` Wodkowski, PawelX
2014-09-30 12:05 ` Wodkowski, PawelX
2014-09-30 12:30 ` Ananyev, Konstantin
2014-09-30 12:54 ` Neil Horman
2014-09-29 11:35 ` Neil Horman
2014-09-26 14:13 ` Ananyev, Konstantin
2014-09-29 10:37 ` Bruce Richardson [this message]
2014-09-26 6:33 ` Wodkowski, PawelX
2014-09-26 9:49 ` Wodkowski, PawelX
2014-09-26 13:43 ` Neil Horman
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=20140929103747.GC12072@BRICHA3-MOBL \
--to=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=konstantin.ananyev@intel.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).