From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751185AbdE3VqT (ORCPT ); Tue, 30 May 2017 17:46:19 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:55696 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751272AbdE3VmD (ORCPT ); Tue, 30 May 2017 17:42:03 -0400 Message-Id: <20170530211533.216608851@linutronix.de> User-Agent: quilt/0.63-1 Date: Tue, 30 May 2017 23:15:33 +0200 From: Thomas Gleixner To: LKML Cc: John Stultz , Peter Zijlstra , Ingo Molnar Subject: [patch 00/26] alarmtimers/posixtimers: Bug fixes and spec conformity changes Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The syzkaller folks reported an RCU stall while fuzzing the posix timer interface with CLOCK_ALARMTIMER_*. While fixing this issue, I noticed that the posix timer implementation of alarm timers lacks quite some of the features of the regular hrtimer based posix timers. That makes alarm timer bases posix timer not conform to the spec and also the unconditional self rearming of those timer is suboptimal. Instead of copying the posix timer hrtimer based mechanism over to alarm timers with the risk of getting out of sync sooner than later, I decided to add a few callbacks to the kclock struct which describes the different posix timer clocks, so the existing and proven to be correct implementation can be reused and we have only one implementation to maintain, aside of the special magic which handles the CPU/PROCESS/THREAD clock ids. Patch 1/2 are the bugfixes addressing the reported problem (#1) and a similar one (#2) which I detected in review. Patch 3-8 are cleanups which I put in front of the actual rework, including the removal of unused and prone to be implemnted wrong posix timer callbacks for the dynamic posix clocks. Patch 9-20 prepare the code in posix-timer.c for sharing and reuse and the remaining patches 21-26 switch the alarm timers over. Passes LTP and GLIBC tests and a few other test cases I have around. Thanks, tglx --- b/kernel/time/posix-timers.h | 13 + include/asm-generic/siginfo.h | 2 include/linux/posix-clock.h | 22 -- include/linux/posix-timers.h | 117 ++++++----- kernel/signal.c | 2 kernel/time/alarmtimer.c | 200 +++++++++----------- kernel/time/posix-clock.c | 115 ----------- kernel/time/posix-cpu-timers.c | 36 +-- kernel/time/posix-timers.c | 410 ++++++++++++++++++++++------------------- 9 files changed, 429 insertions(+), 488 deletions(-)