From patchwork Mon Jun 5 15:08:30 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: 103326 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2753307vqr; Mon, 5 Jun 2023 08:10:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6J6hN1RZwhucuUt1IYKMgxWxS4lDuLDPlS5M4jaRZwOjkBjpi2GCi3blITrALAVz9qfSmq X-Received: by 2002:a05:6a00:194b:b0:65a:8d8d:b6b3 with SMTP id s11-20020a056a00194b00b0065a8d8db6b3mr1726351pfk.8.1685977809373; Mon, 05 Jun 2023 08:10:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685977809; cv=none; d=google.com; s=arc-20160816; b=AD8f8vqF9s2ZSX4XVc1GthXYk5tdc4KNaQVyJWtU02bZAlhqsm5TbeVkLxpvdsW31Y 7Ml6BXHFSo/k120STLdo4I2p1Jcb7FgxodUyWUFVDDpIP2DKlgqB/rS08pa00MZXwpa/ dOnd6GmwDxN4qgBQziv4Zv48Fp6OY/bHPMJKiM+Fzo7csHwWN7xAGuP24bo50ntHxj3f zK32TditKp+acEhZWCYQlax3sqgX/W/bc3vJYNIRdQ5s7WUwSs1S80KOPrpEXA53bpEv b8iJm2BmMKdzpPJ0lWcuSREV5iHmjMvK5oyFibA0xnCVhCasBi2o+DV+ip+4z+UXnEC9 ZjKg== 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=IszN7i8LvGZZtTT7DK5LZSM3FMAKJ2IdsnqEYQqg2vM=; b=yK7l6YFsHB/o09HQhpX8qdCPRDIP0CcosUOTg2p2AKe5O+bH1pMLtP7BDQNA+EiO6A +Aqr5BZUiT067Z/5hX+5+gvJGW5V3rSMH4fdbbmB8Anj+dBj1QmmeouLw4a2KnX/MXI8 uPwbBy4sZLoqwXowkeWXFNTkGLOeyhkmIoHuUrCeov+GvgZt/s+81pgVhfU1oqSqGU9U whyrpgpCQ1TUahFmOa9zjMxwaio2uV5cUFoTHs6Z0GcCgEAu94au4/18LU3Ji3TIIITI xwrDUx+x5mHw0//GDLHOEgQT34XW82EjvuvCVRyeXFF/qcOhvejTf/xrlrGxmNz3VWT2 byPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=UFsgXEn8; 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 c24-20020aa79538000000b0063b356e36fesi5450019pfp.372.2023.06.05.08.09.54; Mon, 05 Jun 2023 08:10:09 -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=UFsgXEn8; 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 S234709AbjFEPJH (ORCPT + 99 others); Mon, 5 Jun 2023 11:09:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234177AbjFEPId (ORCPT ); Mon, 5 Jun 2023 11:08:33 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13994EE; Mon, 5 Jun 2023 08:08:32 -0700 (PDT) Date: Mon, 05 Jun 2023 15:08:30 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1685977710; 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=IszN7i8LvGZZtTT7DK5LZSM3FMAKJ2IdsnqEYQqg2vM=; b=UFsgXEn8RVQEhFIeSiiPTLKQ9SC+RRvCLj+I0FIA19cl4A5VPbFU3bU3vulPbWxzgnLtaa MznT4avcOAOwxUxaRv6m2EUv9v1ClvFrscnKpiFhkArfx+EGYq+ShtuqcK4zNBu5IhxeYw 1hGcFWjMWqKNBEV54+c+rqq2VYZ51ZtLLIzGZabmX0zCxk33bhd7L1V4XdT3iptQ7/0DQh +KHSnWGdkd7ikKo/jtrs/yDQcKWgpOddJKMI2pl49lsHKFFXk2GfaVAnkBlmBdQTRoKC/a Y8fAfjJekAFAYn5hvrTMWpjqQtLyzACqqanMangNchR0qAJHRFQ8wXlrivHUyA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1685977710; 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=IszN7i8LvGZZtTT7DK5LZSM3FMAKJ2IdsnqEYQqg2vM=; b=8Tmc+eTf+wubwlp0PxjO+vNyXSlsXhU7lw3qu34tJDFm/P14YLHQ62SbTcubE5H42lbGto XVsPvwKxvacEuiCw== 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: <168597771022.404.18097593323774926958.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?1767875867188926609?= The following commit has been merged into the timers/core branch of tip: Commit-ID: 515eeda177b797d9a7d0c496739f0bdc02c73093 Gitweb: https://git.kernel.org/tip/515eeda177b797d9a7d0c496739f0bdc02c73093 Author: Thomas Gleixner AuthorDate: Tue, 25 Apr 2023 20:49:06 +02:00 Committer: Thomas Gleixner CommitterDate: Mon, 05 Jun 2023 17:03:37 +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 4333334..e8d877f 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); }