From patchwork Fri Nov 4 05:41:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15364 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp192322wru; Thu, 3 Nov 2022 22:56:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Y44Yr24xTBVWIYipUZ5DBLHWiKOwH4Iguy+y569RlCpgxkKa8giP3f0WWn+1WEBIQjsdw X-Received: by 2002:a17:906:5d10:b0:7ad:e132:bb85 with SMTP id g16-20020a1709065d1000b007ade132bb85mr21948707ejt.367.1667541385872; Thu, 03 Nov 2022 22:56:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667541385; cv=none; d=google.com; s=arc-20160816; b=NztgbbhwgCCVyhJ0TxL307iFjgC0GXlQHlIhLEPKhYYJnxhrV8FPmOlLXNY4CkFDz0 UmhWEwZg0IoHk63mO8iPQBop/nUtz5Nf2nR2KzTnzIOAWEHqjyaeLva9/upDNiQD7USW YzD47stFlbmB0GxJAEd4q5JHB69bsU6o9URlqu+bfeeDbvsEX6lGzeOkFJMaq1AUeSKF aRy1lJ5fV/Qpff0RLIXg2YGGlgq9t4VaXwCCW6UOS1jNJB6UGlrAFA0mhsVDuR01bCF5 hNkuGSH0CZRt0lMlWDE9G5faZYmrOUuUVloAZ7NJimMAJkoBVuFt0LcBzTm5l3tuhxIe ji+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=YtXoqWp2uAo4rvcnU0eqN+iDqmmb3a63vxGCZUc38Zg=; b=Z+Uejz5vVWFF2NvMCD8ikTw1G2IjnVUvMID0CmeX1buUs5P92lpCRttvabFem080Zx ehQzFR4NxajZXLBAyA8wHhAAXGFRbajEWchg7BuQ6FX2kcmpkWW9gY8HsUYMfcFV4T62 VZpv5ua/P629IJ/TeB5w/ReMkmybbMAL6wXlpIP5vYJSz8FLdJBzGylwPNxFo863vnkX Mzm0NfCuylpt2ypA0ZLBV862wmi5aXB21p2RPjR2u4tHnh444zdvgQ6RMHrbei/4rd3A MH9U/D2BkNkMMAp8DLVul8XmrjZHLoyHlMxbOF+ukDFyF+SZi5q1DBA0HMo8Ywvw7iUq l8BA== 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 hq10-20020a1709073f0a00b007adca6532d5si4057756ejc.708.2022.11.03.22.56.02; Thu, 03 Nov 2022 22:56:25 -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; 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 S231309AbiKDFuy (ORCPT + 99 others); Fri, 4 Nov 2022 01:50:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231338AbiKDFsy (ORCPT ); Fri, 4 Nov 2022 01:48:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7846D2873B for ; Thu, 3 Nov 2022 22:48:53 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id C15E0620DB for ; Fri, 4 Nov 2022 05:48:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C1DEC433D6; Fri, 4 Nov 2022 05:48:51 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZt-0071FH-2I; Fri, 04 Nov 2022 01:49:17 -0400 Message-ID: <20221104054917.543373979@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:24 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Johannes Weiner , Suren Baghdasaryan , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider Subject: [RFC][PATCH v3 31/33] timers: sched/psi: Use timer_shutdown_sync() before freeing timer References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 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?1748543876578344976?= X-GMAIL-MSGID: =?utf-8?q?1748543876578344976?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: Johannes Weiner Cc: Suren Baghdasaryan Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Juri Lelli Cc: Vincent Guittot Cc: Dietmar Eggemann Cc: Ben Segall Cc: Mel Gorman Cc: Daniel Bristot de Oliveira Cc: Valentin Schneider Signed-off-by: Steven Rostedt (Google) Acked-by: Johannes Weiner Reviewed-by: Suren Baghdasaryan --- kernel/sched/psi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c index ee2ecc081422..f5f2613c4292 100644 --- a/kernel/sched/psi.c +++ b/kernel/sched/psi.c @@ -1033,6 +1033,7 @@ void psi_cgroup_free(struct cgroup *cgroup) cancel_delayed_work_sync(&cgroup->psi->avgs_work); free_percpu(cgroup->psi->pcpu); + timer_shutdown_sync(&cgroup->psi->poll_timer); /* All triggers must be removed by now */ WARN_ONCE(cgroup->psi->poll_states, "psi: trigger leak\n"); kfree(cgroup->psi);