All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ananyev, Konstantin" <konstantin.ananyev-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: Neil Horman <nhorman-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
Cc: "dev-VfR2kkLFssw@public.gmane.org" <dev-VfR2kkLFssw@public.gmane.org>
Subject: Re: [PATCH v2] Change alarm cancel function to thread-safe:
Date: Fri, 26 Sep 2014 18:07:14 +0000	[thread overview]
Message-ID: <2601191342CEEE43887BDE71AB9772582137D95F@IRSMSX104.ger.corp.intel.com> (raw)
In-Reply-To: <20140926162134.GE5619-B26myB8xz7F8NnZeBjwnZQMhkBWG/bsMQH7oEaQurus@public.gmane.org>



> > As I remember the purpose of the patch was to fix the race condition inside rte_alarm library.
> > I believe that the patch provided by Michal & Pawel fixes the issues you discovered.
> > If you think, that is not the case, could you please provide a list of remaining issues?
> > Excluding ones that you just don't like it, and you are not happy with rte_alarm API in total?


> Gladly.  As Pawel explained the race, its possible that, after calling
> rte_eal_alarm_cancel, an in-flight execution of an alarm callback may still be
> running.  The problem with that ostensibly is that data which is being accessed
> by the callback might be then accessed in parallel with another process leading
> to data corruption or some other problem. The issue I have with his patch is
> that it doesn't completely close the race.  While it does close the race for the
> condition in whcih thread B is running the alarm callback while thread A is
> executing the cancel operation, it does not close the case for when a single
> thread B is running the cancel operation, as the in-flight execution itself is
> still active.

A bit puzzled here:
Are you saying that calling alarm_cancel() for itself inside eal_alarm_callback() might cause a problem?
I still don't see how.

>  If such a cancellation occurs via an intermediary function (i.e.
> one which is not aware that it is explicitly running an alarm callback, which
> signals another thread to execute via some other method (ipc communication,
> etc), the same data corruption may occur, because the canceled and complete
> guarantee has been violated.
> 

  parent reply	other threads:[~2014-09-26 18:07 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-25 12:56 [PATCH v2] Change alarm cancel function to thread-safe: Michal Jastrzebski
     [not found] ` <1411649768-8084-1-git-send-email-michalx.k.jastrzebski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-09-25 13:11   ` Ananyev, Konstantin
2014-09-25 15:08   ` Neil Horman
     [not found]     ` <20140925150807.GD32725-B26myB8xz7F8NnZeBjwnZQMhkBWG/bsMQH7oEaQurus@public.gmane.org>
2014-09-25 16:03       ` Ananyev, Konstantin
     [not found]         ` <2601191342CEEE43887BDE71AB977258213769DE-kPTMFJFq+rEu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-09-25 17:23           ` Neil Horman
     [not found]             ` <20140925172358.GG32725-B26myB8xz7F8NnZeBjwnZQMhkBWG/bsMQH7oEaQurus@public.gmane.org>
2014-09-25 23:24               ` Ananyev, Konstantin
     [not found]                 ` <2601191342CEEE43887BDE71AB97725821378B50-kPTMFJFq+rGvNW/NfzhIbrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-09-26 11:46                   ` Neil Horman
     [not found]                     ` <20140926114630.GA3930-B26myB8xz7F8NnZeBjwnZQMhkBWG/bsMQH7oEaQurus@public.gmane.org>
2014-09-26 12:37                       ` Wodkowski, PawelX
     [not found]                         ` <F6F2A6264E145F47A18AB6DF8E87425D12B39EB5-kPTMFJFq+rFP9JyJpTNKArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-09-26 13:40                           ` Neil Horman
     [not found]                             ` <20140926134014.GB3930-B26myB8xz7F8NnZeBjwnZQMhkBWG/bsMQH7oEaQurus@public.gmane.org>
2014-09-26 14:01                               ` Wodkowski, PawelX
     [not found]                                 ` <F6F2A6264E145F47A18AB6DF8E87425D12B39F15-kPTMFJFq+rFP9JyJpTNKArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-09-26 15:01                                   ` Neil Horman
     [not found]                                     ` <20140926150156.GB5619-B26myB8xz7F8NnZeBjwnZQMhkBWG/bsMQH7oEaQurus@public.gmane.org>
2014-09-26 15:41                                       ` Ananyev, Konstantin
     [not found]                                         ` <2601191342CEEE43887BDE71AB9772582137D88E-kPTMFJFq+rGvNW/NfzhIbrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-09-26 16:21                                           ` Neil Horman
     [not found]                                             ` <20140926162134.GE5619-B26myB8xz7F8NnZeBjwnZQMhkBWG/bsMQH7oEaQurus@public.gmane.org>
2014-09-26 18:07                                               ` Ananyev, Konstantin [this message]
     [not found]                                                 ` <2601191342CEEE43887BDE71AB9772582137D95F-kPTMFJFq+rGvNW/NfzhIbrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-09-26 19:39                                                   ` Neil Horman
     [not found]                                                     ` <20140926193905.GH5619-B26myB8xz7F8NnZeBjwnZQMhkBWG/bsMQH7oEaQurus@public.gmane.org>
2014-09-28 16:12                                                       ` Ananyev, Konstantin
     [not found]                                                         ` <2601191342CEEE43887BDE71AB9772582138410B-kPTMFJFq+rGvNW/NfzhIbrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-09-28 20:47                                                           ` Neil Horman
     [not found]                                                             ` <20140928204754.GC4012-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2014-09-29  6:40                                                               ` Wodkowski, PawelX
     [not found]                                                                 ` <F6F2A6264E145F47A18AB6DF8E87425D12B3A553-kPTMFJFq+rFP9JyJpTNKArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-09-29  9:50                                                                   ` Ananyev, Konstantin
     [not found]                                                                     ` <2601191342CEEE43887BDE71AB977258213874C5-kPTMFJFq+rGvNW/NfzhIbrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-09-29 10:11                                                                       ` Wodkowski, PawelX
     [not found]                                                                         ` <F6F2A6264E145F47A18AB6DF8E87425D12B3A80F-kPTMFJFq+rFP9JyJpTNKArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-09-29 10:33                                                                           ` Bruce Richardson
2014-09-30 11:13                                                                             ` Wodkowski, PawelX
     [not found]                                                                               ` <F6F2A6264E145F47A18AB6DF8E87425D12B3B0AC-kPTMFJFq+rFP9JyJpTNKArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-09-30 12:05                                                                                 ` Wodkowski, PawelX
     [not found]                                                                                   ` <F6F2A6264E145F47A18AB6DF8E87425D12B3B1A8-kPTMFJFq+rFP9JyJpTNKArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-09-30 12:30                                                                                     ` Ananyev, Konstantin
     [not found]                                                                                       ` <2601191342CEEE43887BDE71AB9772582138DE32-kPTMFJFq+rEu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-09-30 12:54                                                                                         ` Neil Horman
2014-09-29 11:35                                                                           ` Neil Horman
2014-09-26 14:13                               ` Ananyev, Konstantin
     [not found]                                 ` <2601191342CEEE43887BDE71AB9772582137D7F1-kPTMFJFq+rGvNW/NfzhIbrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-09-29 10:37                                   ` Bruce Richardson
2014-09-26  6:33               ` Wodkowski, PawelX
     [not found]                 ` <F6F2A6264E145F47A18AB6DF8E87425D12B39AFE-kPTMFJFq+rFP9JyJpTNKArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
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=2601191342CEEE43887BDE71AB9772582137D95F@IRSMSX104.ger.corp.intel.com \
    --to=konstantin.ananyev-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.org \
    --cc=nhorman-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.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.