From patchwork Sun Jun 18 20:50:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 109682 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2648249vqr; Sun, 18 Jun 2023 14:34:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6sTmQRFOJ1eepss/B+gXMR4baBnPOppcgC9x+5Ppzz1fHhbMRtwosRtxlnCx6Ssao1CgXT X-Received: by 2002:a92:cd41:0:b0:33f:dfd1:fe4a with SMTP id v1-20020a92cd41000000b0033fdfd1fe4amr6655224ilq.8.1687124062258; Sun, 18 Jun 2023 14:34:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687124062; cv=none; d=google.com; s=arc-20160816; b=XzxCoef8HU/1dv/g/0kGki9667klCe7LB4CtD/Cv8W2qQBpZfd/5rfnoBz1Ek/58Qw Ljx7pUTFVPba5/v3c07WclcnGoDQayqUp5J3eR1UCpHrLl2GjtP0z1WvQnEZQITSL8Qr 7WAE23pZ4AoifcgSUNlpoodLltravaDyaZDl82rFLU5XKGDHK0gKfWO/6Pv2D2Ezowes VHTUJBj6fNE8fyn0hsAWxrEEnMFu+Fwe5VO+RX0Q8wGiuewN+y+xnCekBcCBUJ6FlOcL Lm0h/WoVCUl1DtZR2GqsN3Bus1qDE4lhM03JqFMHg83y80SGZYm8xNfwSrpyJn/M86vv mICA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=xCFs+WVBnorywR4TvQ0Vs07yRWRFxviJoCcGWxR8i4o=; b=i6RSNUX27UEaXfliX8scQxQYs3dc/11re2H+7cCcsCDv3ZiwecEV4/t6cHSBctP97+ uGFEWiFRTLP0KuP3vFHopnGJd97t25Y1o4570tYqYl2fK8e/R8ugHkrFrVe5gE1C0B6V Jq3mP7I3Gs9fmVJ148qeX+DsvICcVLBNLhoSP0gHk+VZQsLbBgqRxUg99g7tHRZ6ahDq pMcJEbNUw52ruVtzUdcHF4p9Xu4i6Y0ayqXGL8NxkLZ7iZRva7uR+AjPjzLQyqA6kzh4 ujggjOAovKipOxcTGtdXWaYJXSevNkXV1ZYabexBxC6MOydE6LWvurSQ333yoXRnYPDc gjpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=dr6VuJCJ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z6-20020a170903018600b001aaf78f7a95si9457741plg.101.2023.06.18.14.34.03; Sun, 18 Jun 2023 14:34:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=dr6VuJCJ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229876AbjFRUvW (ORCPT + 99 others); Sun, 18 Jun 2023 16:51:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229639AbjFRUuI (ORCPT ); Sun, 18 Jun 2023 16:50:08 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA378E4F; Sun, 18 Jun 2023 13:50:06 -0700 (PDT) Date: Sun, 18 Jun 2023 20:50:05 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1687121405; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xCFs+WVBnorywR4TvQ0Vs07yRWRFxviJoCcGWxR8i4o=; b=dr6VuJCJMG8S3etF6Cv8OnPGfwx8CRDwLePE8XB1n1T1xUoovV7b6DFpZMu6IMEAM0R7pf LjvOol0vl/4IGApnJT4Bf0k3MqLZe9w61/0EPaIPHu639d6WlnH8GxZ/lx7BwjF9BKhfv3 AMnUeU2Ir+n2rRlABgaaxLbzxUJ20kDehwa5w3ZQheswuTyz9iphg+8TkegcW7VkUIksrr TA0bzmzt4Fbpcg/lssogGWGHHlYhAfHpNORrkrC1OGRReM0Mbg8zrLP/K+B+jCXBU6uTdM 9GkadbeRFzLejmH6O3fPoEQbGx9x8sDxqEp+YAMO/mBns6Rphxq6yoiPBK9Gew== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1687121405; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xCFs+WVBnorywR4TvQ0Vs07yRWRFxviJoCcGWxR8i4o=; b=w8E7cdYNq8CU0uElrDq2+JEKOLewAiolrOzHagCcYNxRrR5Wg9gRf7vzO1HHY/fhxSx+ph aF7xG0e26PGHBTDA== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] posix-timers: Set k_itimer:: It_signal to NULL on exit() Cc: Thomas Gleixner , Frederic Weisbecker , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230425183313.196462644@linutronix.de> References: <20230425183313.196462644@linutronix.de> MIME-Version: 1.0 Message-ID: <168712140508.404.13177458639953476257.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767875867188926609?= X-GMAIL-MSGID: =?utf-8?q?1769077800705689604?= The following commit has been merged into the timers/core branch of tip: Commit-ID: 72786ff23d5acb7bf3e2535831b2f1dc55c7f44e Gitweb: https://git.kernel.org/tip/72786ff23d5acb7bf3e2535831b2f1dc55c7f44e Author: Thomas Gleixner AuthorDate: Tue, 25 Apr 2023 20:49:06 +02:00 Committer: Thomas Gleixner CommitterDate: Sun, 18 Jun 2023 22:41:49 +02:00 posix-timers: Set k_itimer:: It_signal to NULL on exit() Technically it's not required to set k_itimer::it_signal to NULL on exit() because there is no other thread anymore which could lookup the timer concurrently. Set it to NULL for consistency sake and add a comment to that effect. Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20230425183313.196462644@linutronix.de --- kernel/time/posix-timers.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c index de3fca8..c1b77c5 100644 --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c @@ -1101,6 +1101,14 @@ retry_delete: } list_del(&timer->list); + /* + * Setting timer::it_signal to NULL is technically not required + * here as nothing can access the timer anymore legitimately via + * the hash table. Set it to NULL nevertheless so that all deletion + * paths are consistent. + */ + WRITE_ONCE(timer->it_signal, NULL); + spin_unlock_irqrestore(&timer->it_lock, flags); release_posix_timer(timer, IT_ID_SET); }