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


Groups > linux.kernel > #1517444

Re: [PATCH v3 4/4] posix-timers: make it configurable

From Nicolas Pitre <nicolas.pitre@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH v3 4/4] posix-timers: make it configurable
Date 2016-11-08 19:20 +0100
Message-ID <sBja1-4re-1@gated-at.bofh.it> (permalink)
References <sB0qJ-OG-1@gated-at.bofh.it> <sB0qJ-OG-15@gated-at.bofh.it> <sBiGZ-3WR-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 8 Nov 2016, John Stultz wrote:

> One spot of concern is that the
> tools/testing/selftests/timers/posix_timers.c test hangs testing
> virtual itimers. Looking through the code I'm not seeing where an
> error case is missed.
> 
> The strace looks like:
> ...
> write(1, "Testing posix timers. False nega"..., 66Testing posix
> timers. False negative may happen on CPU execution
> ) = 66
> write(1, "based timers if other threads ru"..., 48based timers if
> other threads run on the CPU...
> ) = 48
> write(1, "Check itimer virtual... ", 24Check itimer virtual... ) = 24
> rt_sigaction(SIGVTALRM, {0x400a80, [VTALRM], SA_RESTORER|SA_RESTART,
> 0x7fb73306ccb0}, {SIG_DFL, [], 0}, 8) = 0
> gettimeofday({1478710402, 937476}, NULL) = 0
> setitimer(ITIMER_VIRTUAL, {it_interval={0, 0}, it_value={2, 0}}, NULL) = 0
> <Hang>
> 
> 
> Where as with posix timers enabled:
> ...
> write(1, "Testing posix timers. False nega"..., 138Testing posix
> timers. False negative may happen on CPU execution
> based timers if other threads run on the CPU...
> Check itimer virtual... ) = 138
> rt_sigaction(SIGVTALRM, {0x400a80, [VTALRM], SA_RESTORER|SA_RESTART,
> 0x7f231ba8ccb0}, {SIG_DFL, [], 0}, 8) = 0
> gettimeofday({1478626751, 904856}, NULL) = 0
> setitimer(ITIMER_VIRTUAL, {it_interval={0, 0}, it_value={2, 0}}, NULL) = 0
> --- SIGVTALRM {si_signo=SIGVTALRM, si_code=SI_KERNEL} ---
> rt_sigreturn()                          = 0

I'll have a look.

> So I suspect you were a little too aggressive with the #ifdefs around
> the itimers/signal code, or we need to make sure we return an error on
> the setitimer ITIMER_VIRTUAL case as well.

Well, it seemed to me that with POSIX_TIMERS=n, all the code that would 
set up that signal is gone, so there was no point keeping the code to 
deliver it.

Now... would it make more sense to remove itimer support as well when 
POSIX_TIMERS=n?  The same reasoning would apply.


Nicolas

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


Thread

[PATCH v3 0/4] make POSIX timers optional with some Kconfig help Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-11-07 23:20 +0100
  [PATCH v3 3/4] ptp_clock: allow for it to be optional Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-11-07 23:20 +0100
    Re: [PATCH v3 3/4] ptp_clock: allow for it to be optional Edward Cree <ecree@solarflare.com> - 2016-11-08 14:20 +0100
  [PATCH v3 4/4] posix-timers: make it configurable Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-11-07 23:20 +0100
    Re: [PATCH v3 4/4] posix-timers: make it configurable John Stultz <john.stultz@linaro.org> - 2016-11-08 18:50 +0100
      Re: [PATCH v3 4/4] posix-timers: make it configurable Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-11-08 19:20 +0100
        Re: [PATCH v3 4/4] posix-timers: make it configurable John Stultz <john.stultz@linaro.org> - 2016-11-08 20:00 +0100
  [PATCH v3 1/4] kconfig: introduce the "imply" keyword Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-11-07 23:20 +0100
  Re: [PATCH v3 0/4] make POSIX timers optional with some Kconfig  help Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-11-07 23:40 +0100
  Re: [PATCH v3 2/4] kconfig: regenerate *.c_shipped files after  previous changes Josh Triplett <josh@joshtriplett.org> - 2016-11-07 23:40 +0100
    Re: [PATCH v3 2/4] kconfig: regenerate *.c_shipped files after  previous changes Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-11-07 23:50 +0100
      Re: [PATCH v3 2/4] kconfig: regenerate *.c_shipped files after  previous changes Josh Triplett <josh@joshtriplett.org> - 2016-11-08 00:20 +0100
  Re: [PATCH v3 0/4] make POSIX timers optional with some Kconfig  help Thomas Gleixner <tglx@linutronix.de> - 2016-11-08 18:00 +0100

csiph-web