Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5520030rwb; Mon, 14 Nov 2022 06:00:23 -0800 (PST) X-Google-Smtp-Source: AA0mqf6Cla3VwP5K0hZVndlXUoyXSQkREUOaQyeo4R2emGKfdCkkr4eC4uOyN+0OGCmWaqPlXlyc X-Received: by 2002:a17:907:77d8:b0:78d:cea0:e87a with SMTP id kz24-20020a17090777d800b0078dcea0e87amr10688520ejc.178.1668434422836; Mon, 14 Nov 2022 06:00:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668434422; cv=none; d=google.com; s=arc-20160816; b=FPf2fRoNYc4z67dN4744fF4r6WIBHjnaysUlFnASOmmiTjGLXVnJSRlixAUte0vsoT VRwMtT446AnNYqPs+Yd4qawnjhqfP3B1JbPdoi6PE1+e1R4UPWCVwVe4RLvRIi+jvNuo 79/FI8wbi6dSWC7W0VYwe/Mgj90ox9TTtgMlw+/ilgoLzrH2iMeVeDBgesUlR4rcTFQ+ MvKxbPQUaqxJC+myNIqJD1/ZwY4N+FGQ5Wl7khWZsx4sSrtI//CtEwkGguV4ZnyDwa8g GHeAZBu7Rx4IIj7XKqPDEKRKJ9/vZW+z9WAnSadkXWBDBKl82viaptRL7qACGRPtU2wc QP6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=CDz1JCLczMhDi2LrK6WGK6Zsq3Zf63Do2UbYkLI2Ods=; b=dQkTn9+FmLlDSTBKyH6b7WeGNtJ4PIFvCaF4qJ9M4A6GGmEk8yiT330K4BpVgvu+pe +M2SfhVfGJ3odNlfWxICAAnRUo07J3oNjWZUB/DxaDPUnEYQahNsD07X9ouKFbvc5R8o dGe9jVMwQa/WEKRNOBQeUQAcjHL5dZLAxvWcxoD4P6xNBu5+yhQsNzze5bEtKM4Ng8AT tFOLlhY46z51b5c86h4USVQo8ctJOdesZXFHHSpS3n9lyyVwuKzKqcDy3gousLmspPiJ gucjz14K654u2lJlDggZtZQp+EGisgQIesCjM9HReSdYKEA2rstKAk5VKeBZEzTt7Znw 66sw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hs34-20020a1709073ea200b0078c8dadd4bbsi9360066ejc.742.2022.11.14.05.59.58; Mon, 14 Nov 2022 06:00:22 -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 S236819AbiKNNgA (ORCPT + 87 others); Mon, 14 Nov 2022 08:36:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236810AbiKNNf7 (ORCPT ); Mon, 14 Nov 2022 08:35:59 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BD38193D4 for ; Mon, 14 Nov 2022 05:35:58 -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 CEA62B80EBD for ; Mon, 14 Nov 2022 13:35:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 879B4C433D7; Mon, 14 Nov 2022 13:35:54 +0000 (UTC) Date: Mon, 14 Nov 2022 08:36:35 -0500 From: Steven Rostedt To: Thomas Gleixner Cc: linux-kernel@vger.kernel.org, Linus Torvalds , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Julia Lawall Subject: Re: [PATCH v6 4/6] timers: Add timer_shutdown_sync() to be called before freeing timers Message-ID: <20221114083635.60e23559@gandalf.local.home> In-Reply-To: <87sfims7ca.ffs@tglx> References: <20221110064101.429013735@goodmis.org> <20221110064147.343514404@goodmis.org> <875yfitpdu.ffs@tglx> <20221113191518.0a3b29b1@rorschach.local.home> <87sfims7ca.ffs@tglx> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Mon, 14 Nov 2022 01:33:25 +0100 Thomas Gleixner wrote: > On Sun, Nov 13 2022 at 19:15, Steven Rostedt wrote: > > Thomas Gleixner wrote: > >> You surely have spent a massive amount of analysis on this! > >> > >> Can you please explain how you came up with the brilliant idea of asking > >> Linus to pull this post -rc4 without a review from the timer maintainers > >> or anyone else who understands concurrency? > > > > I trusted the source of this code: > > > > https://lore.kernel.org/all/87pmlrkgi3.ffs@tglx/ > > Sure because uncomplied suggestions are the ultimate source of truth and > correctness, right? Well, I figured it covered the race conditions. > > I'm terribly sorry that I misled you on this, but OTOH it's pretty > obvious that you decided to ignore: > > https://lore.kernel.org/all/87v8vjiaih.ffs@tglx/ > I'm not sure what you mean by that. The idea is that once timer_shutdown() is called, we still warn on re-arming the timer. Yeah, I did not follow Linus's suggestion that we just use shutdown to prevent the race and let it re-arm if it wants. That is, I did not blindly convert all del_timer_sync() to timer_shutdown(). The script only converts it if there's an immediate free of the object that holds the timer in the same function without any paths to avoid it. The final patch series (https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/) works to make sure that after the shutdown is called, it does not get re-armed. -- Steve