From patchwork Thu Nov 10 06:41:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 1427 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp760596wru; Wed, 9 Nov 2022 22:42:15 -0800 (PST) X-Google-Smtp-Source: AMsMyM6l3mc3RlpdejVHTDnMoJC3xYJ3Oo5Az59znq/rH+341mK/F8LRGMqe6T6Elr6tgh0d64pj X-Received: by 2002:a17:90b:4d87:b0:212:d62a:8612 with SMTP id oj7-20020a17090b4d8700b00212d62a8612mr83872415pjb.35.1668062535420; Wed, 09 Nov 2022 22:42:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668062535; cv=none; d=google.com; s=arc-20160816; b=tAFdLcHvbCvc+UWeVNrIyT1uC4q3mzZuqNFovFzIHBaAYTuurZ1p4f4vHrz5kiK2jN KS/4wyT8YTrj3OlLJWLeRbD96NMoDAFJzgQZNjjMLVj4jmx0NjqCT96tcHetl4Cg1X3N xNdoXNzXriN2cOXxmeJUKH+Kbzr1D5eRGU6PlHck/2Fkbrk7hqLtigR4LETkoz1El5Ca NZXqFuiRMr2Tkht3iFo8RRJeyhhDP7m73hIFGh0AFZkqeV5lpxdX/DHUb/IE+5Ldl5LD TreQ4RCjNELGPmJJx5l8A15V7eMln0RwaPh8Gy1wf3gCb7PxNLeMehFgX0w1l4WVIoTr PKLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:user-agent:message-id; bh=eOxCfyJsboy/VWpualdT3RLgmQQsVpEtcYpuqm57HtU=; b=w8kR4MK2/giNolXJ5lMRJDbb58LkCX4T5Q0W7zBLyjJDyAXACA+abMiVz/Sutwneir NHm1l4c0Jja0/bMyvDmYiWRSrPSdzxc6R+Zp7rnKzw3LRzAp04o7arcqqmMIiowbuOSJ fg8EJnqNWp+hrOQw/w0qM5b5dayGQXMQgor42RzT78eIAwZh6elotuPgQPiwNU5xaC/J iFTlOTx4MJXq0T+CiPPdd/K1wICjwcxNRmhxQ1j3AuxKGdFZzvs4ySN7+TU0jj1BiRNB 7KD5hXwDwEt4XmjA9rRs0swEx5CKYohkLClLczCxCFT15ZOaK7qDrOI+Yx1QjN3Ojypy uKEQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s16-20020a635250000000b00460ea4393c9si20584460pgl.448.2022.11.09.22.42.00; Wed, 09 Nov 2022 22:42:15 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232513AbiKJGll (ORCPT + 99 others); Thu, 10 Nov 2022 01:41:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232713AbiKJGl1 (ORCPT ); Thu, 10 Nov 2022 01:41:27 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C7F32F640 for ; Wed, 9 Nov 2022 22:41:14 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CE53EB820D8 for ; Thu, 10 Nov 2022 06:41:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52745C433D7; Thu, 10 Nov 2022 06:41:11 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1ot1Fy-009EdE-2X; Thu, 10 Nov 2022 01:41:46 -0500 Message-ID: <20221110064101.429013735@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 10 Nov 2022 01:41:01 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Julia Lawall Subject: [PATCH v6 0/6] timers: Use timer_shutdown*() before freeing timers X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS 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?1749090341057345835?= X-GMAIL-MSGID: =?utf-8?q?1749090341057345835?= This is just the patches to implement the infrastructure of the timer_shutdown_sync() and timer_shutdown(). I'll leave the scripting for the second stage if this is approved. Changes since the v5a: https://lore.kernel.org/all/20221106054535.709068702@goodmis.org/ - Broke up the implementation patch into three patches: 1. The code taken from Thomas and tweaked to compile and added comments, as well as changing the name to timer_shutdown_sync(): https://lore.kernel.org/all/20221106054535.709068702@goodmis.org/ 2. Addition of timer_shutdown() that is like del_timer() but uses the same logic as timer_shutdown_sync() to disable the timer after it is called. 3. Update the documentation to reflect the new APIs. Steven Rostedt (Google) (6): ARM: spear: Do not use timer namespace for timer_shutdown() function clocksource/drivers/arm_arch_timer: Do not use timer namespace for timer_shutdown() function clocksource/drivers/sp804: Do not use timer namespace for timer_shutdown() function timers: Add timer_shutdown_sync() to be called before freeing timers timers: Add timer_shutdown() to be called before freeing timers timers: Update the documentation to reflect on the new timer_shutdown() API ---- .../RCU/Design/Requirements/Requirements.rst | 2 +- Documentation/core-api/local_ops.rst | 2 +- Documentation/kernel-hacking/locking.rst | 5 ++ arch/arm/mach-spear/time.c | 8 +-- drivers/clocksource/arm_arch_timer.c | 12 ++-- drivers/clocksource/timer-sp804.c | 6 +- include/linux/timer.h | 62 +++++++++++++++++++-- kernel/time/timer.c | 64 ++++++++++++---------- 8 files changed, 110 insertions(+), 51 deletions(-)