From: Neil Horman <nhorman@tuxdriver.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: Tue, 30 Sep 2014 08:54:02 -0400 [thread overview]
Message-ID: <20140930125402.GD2193@hmsreliant.think-freely.org> (raw)
In-Reply-To: <2601191342CEEE43887BDE71AB9772582138DE32@IRSMSX105.ger.corp.intel.com>
On Tue, Sep 30, 2014 at 12:30:08PM +0000, Ananyev, Konstantin wrote:
>
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wodkowski, PawelX
> > Sent: Tuesday, September 30, 2014 1:05 PM
> > To: Wodkowski, PawelX; Richardson, Bruce
> > Cc: dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH v2] Change alarm cancel function to thread-safe:
> >
> > > -----Original Message-----
> > > Paweł
> > >
> > > > On Mon, Sep 29, 2014 at 10:11:38AM +0000, Wodkowski, PawelX wrote:
> > > > > > >
> > > > > > > Image how you will be damned by someone that not even notice you
> > > > change
> > > > > > > and he Is managing some kind of resource based on returned number of
> > > > > > > set/canceled timers. If you suddenly start returning negative values how
> > > > those
> > > > > > > application will behave? Silently changing returned value domain is evil in
> > > > its
> > > > > > > pure form.
> > > > > >
> > > > > > As I can see the impact is very limited.
> > > > >
> > > > > It is small impact to DPDK but can be huge to user application:
> > > >
> > > > This is why we traditionally have in the release-notes for each release a
> > > > section dedicated to calling out changes from one release to another. [See
> > > > http://dpdk.org/doc/intel/dpdk-release-notes-1.7.0.pdf section 5]. Since
> > > > from release-to-release there are generally only a couple of changes -
> > > > though our next release may be a little different - the actual changes are
> > > > clear enough to read about without wading through pages of documentation.
> > > I
> > > > thinking calling out the change in both the release notes and the API docs
> > > > is sufficient even for a change like this.
> > > >
> > > > Basically, I wouldn't let API stability factor in too much in trying to get
> > > > a proper fix for this issue.
> > > >
> > > > /Bruce
> > > >
> > >
> > > Summarizing all proposed solutions and to be able to produce final patch - what
> > > Is desired behavior after fix?
> > >
> > > 1. do we leave as is in Patch v2:
> > > 1.1 if canceling from other thread - if one of the alarms is executing, wait to
> > > finish its execution and then cancel any rearmed alarms.
> > > 1.2 if canceling from alarm handler and one of the alarms to cancel is this
> > > executing callback do no wait for it to finish and cancel anything else.
> > >
> > > in both cases return number of canceled callbacks.
> > >
> > > 2. Do exactly like in 1. but return -EINPROGRESS instead of canceled alarms
> > > if one of the alarms to cancel is currently executing callback from alarm thread
> > > (information about number of canceled alarms will be lost).
> >
> > Or instead of returning -EINPROGRESS set errno to EINPROGRESS (replace
> > returning error value by setting errno and function can always return number
> > of canceled callbacks - in error condition 0)?
>
> Yes that's looks like a better option.
> As I remember, inside DPDK we have our own rte_errno, that we can probably use here.
> My vote would be for that approach.
>
You'll want to document that interface to make sure callers understand that a
non-zero return code doesn't automatically mean complete success, but yes, in
this case that seems like a pretty reasonable solution.
Neil
> Konstantin
>
> >
> > >
> > > 3. refuse to cancel anything if canceling currently executing alarm from alarm
> > > callback and return -EINPROGRESS otherwise do like in 1.1.
> > >
> > > 4. Implement behaviour 1/2/3 (which?) and add API call to interrogate list of
> > > alarms and retrun state of given alarms(s).
> > >
> > > 5. other solutions?
> > >
> > > Pawel
>
next prev parent reply other threads:[~2014-09-30 12:47 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 [this message]
2014-09-29 11:35 ` Neil Horman
2014-09-26 14:13 ` Ananyev, Konstantin
2014-09-29 10:37 ` Bruce Richardson
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=20140930125402.GD2193@hmsreliant.think-freely.org \
--to=nhorman@tuxdriver.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).