Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1572675

Re: [PATCH] timerfd: Protect the might cancel mechanism proper

From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH] timerfd: Protect the might cancel mechanism proper
Date 2017-02-02 20:00 +0100
Message-ID <t6uLV-7JC-33@gated-at.bofh.it> (permalink)
References <t5HBw-1Ll-23@gated-at.bofh.it> <t62wh-62p-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, 1 Feb 2017, Dmitry Vyukov wrote:
> 
> Can't we still end up with an inconsistently setup timer?
> do_timerfd_settime executes timerfd_setup_cancel and timerfd_setup as
> two separate non-atomic actions. So if there are 2 concurrent
> timerfd_settime calls, one that needs cancel and another that does not
> need cancel, can't we end up with inconsistent setup? E.g. setup timer
> that needs cancel, but it won't be in cancel_list. Or vice versa.

Do we really care? If an application arms the timer with cancel in one
thread and the same timer without cancel in another thread, then it's
probably completely irrelevant whether the state pair timeout/cancel is
correct or not. That's clearly an application bug and I don't want to add
more locking just to make something which is broken by definition pseudo
'atomic'.

Thanks,

	tglx

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] timerfd: Protect the might cancel mechanism proper Thomas Gleixner <tglx@linutronix.de> - 2017-01-31 15:30 +0100
  Re: [PATCH] timerfd: Protect the might cancel mechanism proper Dmitry Vyukov <dvyukov@google.com> - 2017-02-01 13:50 +0100
    Re: [PATCH] timerfd: Protect the might cancel mechanism proper Thomas Gleixner <tglx@linutronix.de> - 2017-02-02 20:00 +0100
      Re: [PATCH] timerfd: Protect the might cancel mechanism proper Dmitry Vyukov <dvyukov@google.com> - 2017-02-02 20:10 +0100
        Re: [PATCH] timerfd: Protect the might cancel mechanism proper Dmitry Vyukov <dvyukov@google.com> - 2017-02-10 11:30 +0100
          Re: [PATCH] timerfd: Protect the might cancel mechanism proper Thomas Gleixner <tglx@linutronix.de> - 2017-02-10 12:40 +0100
        Re: [PATCH] timerfd: Protect the might cancel mechanism proper Thomas Gleixner <tglx@linutronix.de> - 2017-02-10 12:40 +0100
  [tip:timers/core] timerfd: Protect the might cancel mechanism  proper tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-02-10 11:30 +0100

csiph-web