Received: by 10.213.65.68 with SMTP id h4csp263394imn; Wed, 28 Mar 2018 03:09:31 -0700 (PDT) X-Google-Smtp-Source: AIpwx48NW6ln8XE7U1Dm3k/8MzFXL3TbY8t8toY4yg/00Ep6KHLO3+M/BHQCswiEavP5cnD5e8Uv X-Received: by 2002:a17:902:9696:: with SMTP id n22-v6mr3125094plp.29.1522231771012; Wed, 28 Mar 2018 03:09:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522231770; cv=none; d=google.com; s=arc-20160816; b=JoJGBgm4czG4IwYUGZ6Rmk2iU1jKNcf/t7VfT67P1jkC7I88b6BM5jScnQ5DN892T8 btqKj+/cZT8MK4/FE4HTmSzgzyFBHDe51nBUSIX+Ay/v/DovGPGy0iqkiTrK1IIGBnhF ZY2CS7rZfvD+V2tWhfkeontLpFni2r6Vr2VEez6hnriOVmc6loy2eG7BjBPuVKxJ4WZ9 Mqh8Y00vv8wT7pFdI8Xmnb4Pe+jovNvlCJx0F+5QB+yaLQs8TftY5+Bh+s5g8dmfsHoe 1ub5wQBjZ05s/2hnsfZjUrK16pRWDYtR2f7cNG4egW9ntJfI2UHy2dMoy7mL+7K4JF5s Thhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Mu2BpFPl6jZMiA/rJxXhkT1EZwqbSuNGS6UKn2CyD1c=; b=asGsjQQrQDWogfhLFuJfXfhYegb36HJeViU94eS5EoolTsFKvOjFesDIFYCxvNatDd fSw2cWuRdbeORt8W0SMPav6kB2jrzyepyGBIPfSILKI9Ux/dH9SiApyIElSAt+S6R8xu 3kqChcZooveCWAqTAYHYPAQLR70+rs84SyFzhFNbCBO0jOumaU4mMlVUruy+euKfkT3a e/Zb/JXTWD0+NHtnVD4saLGnlvHA3cZLiqzTcAdbss0fEnd4oKsUiv6CtPszwDJkwBUD COF8rdTOMp02DOr/h817S1qefCJZmQ8LdOMM1kjxn62ccFXLPUUCF4dPqama/OtYDbIu NUzw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q74si2563607pfg.295.2018.03.28.03.09.16; Wed, 28 Mar 2018 03:09:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752942AbeC1KHy (ORCPT + 99 others); Wed, 28 Mar 2018 06:07:54 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:50183 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752756AbeC1KHw (ORCPT ); Wed, 28 Mar 2018 06:07:52 -0400 Received: from localhost ([127.0.0.1] helo=bazinga.breakpoint.cc) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1f17zi-00017s-Fv; Wed, 28 Mar 2018 12:07:50 +0200 From: Sebastian Andrzej Siewior To: linux-rt-users@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Steven Rostedt , Sebastian Andrzej Siewior , stable-rt@vger.kernel.org Subject: [PATCH RT 3/3] posix-timers: move the rcu head out of the union Date: Wed, 28 Mar 2018 12:07:46 +0200 Message-Id: <20180328100746.18668-3-bigeasy@linutronix.de> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180328100746.18668-1-bigeasy@linutronix.de> References: <20180328100746.18668-1-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On RT the timer can be preempted while running and therefore we wait with timer_wait_for_callback() for the timer to complete (instead of busy looping). The RCU-readlock is held to ensure that this posix timer is not removed while we wait on it. If the timer is removed then it invokes call_rcu() with a pointer that is shared with the hrtimer because it is part of the same union. In order to avoid any possible side effects I am moving the rcu pointer out of the union. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- include/linux/posix-timers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h index 672c4f32311e..4754eb4298b1 100644 --- a/include/linux/posix-timers.h +++ b/include/linux/posix-timers.h @@ -101,8 +101,8 @@ struct k_itimer { struct { struct alarm alarmtimer; } alarm; - struct rcu_head rcu; } it; + struct rcu_head rcu; }; =20 void run_posix_cpu_timers(struct task_struct *task); --=20 2.16.3