Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp211442rwo; Tue, 1 Aug 2023 15:47:18 -0700 (PDT) X-Google-Smtp-Source: APBJJlEcOtzjGv9xOok3HA2aBoFWPSbos1CJotg7gQg3ryIYfoSuNEIky5wPM9inuk8uQiyhxnAn X-Received: by 2002:a05:6a20:8e04:b0:12e:5f07:7ede with SMTP id y4-20020a056a208e0400b0012e5f077edemr1060883pzj.41.1690930038307; Tue, 01 Aug 2023 15:47:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690930038; cv=none; d=google.com; s=arc-20160816; b=LwYS9T6Z6AEvMU45EvVkzUjpjf+9cJ+3+UlG14X6NW+wmnBG2xfaXRZk6h+st55zAS fY1xWOSCkPTPsZU2uuKX8TmWpRwwtMP5n/7tXoTqeMkKJ7TDplsyX7TcDDIKTzqvqbQG pFY52FiKsOIdyh+ttt7cVGQtsEoenrw9qpYS1a3XhYVcH5ighM3ZEuPJtYOGkk2sMbdl fFbdE4JRz5v2nNMytsvRA1Vrer5GPhH5FVbHCJkfBiVbv5e5Mm6y1/sfs2opD8ZI/jn7 3k7u9uSxmBv8Zmttmku7cfZfaZvHvUmvWNwS1h7NSycWb9R+FFw8Cw7WiAqg0yYPglf/ 1otQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=pEmPIjBqTYznJQWZxEfL3Z9rLsk06S8+0eyK+b63Lhk=; fh=D+f0QqXmUwaQm1ALSoK5iaYlsUm0Ipa2CxBjih9cvi8=; b=jLuUKcVAhdhcajBVLA09JBHV0cboN07xOEWm0Rh30s8Trg7iFYH78b7BlBiPYM22Y4 29D78s0thLEFFiGTu3xFnaPNWSdGxVm0KKQ69QMqhSNFvWnokIS6erMrCL4kh5BqsJeY qftViirVbrPQr8OBqJRCbjg7eUtMYyAdAhT9vnFIFpc8k4N5mFFkFWT2axaiV9A8AxoL YRMUkBd2q/tg7s7d0kCM0yDu4wfv/cI51o7tBGox8plcWdfQyZZROnHsLXKducBx3/04 T3vd4ags0skMFqJMg3AYYGPLt5+jbtApMnPZpBPX57D/uK7nSbWUGHqPUc/zb57lF4Yo P5Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=l9XhNVJG; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s3-20020a63d043000000b00563b05b9ff9si9609402pgi.44.2023.08.01.15.47.06; Tue, 01 Aug 2023 15:47:18 -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=@kernel.org header.s=k20201202 header.b=l9XhNVJG; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232289AbjHAVcZ (ORCPT + 99 others); Tue, 1 Aug 2023 17:32:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231222AbjHAVcX (ORCPT ); Tue, 1 Aug 2023 17:32:23 -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 469B01B6; Tue, 1 Aug 2023 14:32:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BC6326170B; Tue, 1 Aug 2023 21:32:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1FAEEC433C7; Tue, 1 Aug 2023 21:32:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690925539; bh=mlLJwvIQ28in3hFDAHgMaBkqadXCSNy7GdeKaCPuqZE=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=l9XhNVJGckmHfYujiSYBsJ7YApijXQj8Jo0yIajaRkRGPyQNzi0llLBftY9lUu6V0 vzXfru2a+7ey7T7oNksxGnz2QDFBFwslI/sECS3OsqQoS0E75LuLbMoYIiq3vYLU5e RpSD9+k4MnTWJMNFD9KGcYsSmizswMw1fmTG9hIZjSSQeWpFASxd3EgUghuyoAqtn9 pSxOkPoMOwG8+iVLLXlhS+/ig5tyM4urfdSxAvhIk+7cmm9jU5GvOoh5or41yNzf3W mI3tk6AJ0Q3HNXS5WhdTd+FKXcTXYrxlo0/CXyGJx9BFDzn7YNgMxfNGM1gw+//rFN TwRX76lVadhsg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id B632ECE0908; Tue, 1 Aug 2023 14:32:18 -0700 (PDT) Date: Tue, 1 Aug 2023 14:32:18 -0700 From: "Paul E. McKenney" To: Peter Zijlstra Cc: Guenter Roeck , Roy Hopkins , Joel Fernandes , Pavel Machek , Greg Kroah-Hartman , stable@vger.kernel.org, patches@lists.linux.dev, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, shuah@kernel.org, patches@kernelci.org, lkft-triage@lists.linaro.org, jonathanh@nvidia.com, f.fainelli@gmail.com, sudipm.mukherjee@gmail.com, srw@sladewatkins.net, rwarsow@gmx.de, conor@kernel.org, rcu@vger.kernel.org, Ingo Molnar , Kees Cook , Marco Elver Subject: Re: scheduler problems in -next (was: Re: [PATCH 6.4 000/227] 6.4.7-rc1 review) Message-ID: <9154ee27-6f38-4efe-9391-ef626cdc2ff4@paulmck-laptop> Reply-To: paulmck@kernel.org References: <20230731141934.GK29590@hirez.programming.kicks-ass.net> <20230731143954.GB37820@hirez.programming.kicks-ass.net> <20230731145232.GM29590@hirez.programming.kicks-ass.net> <7ff2a2393d78275b14ff867f3af902b5d4b93ea2.camel@suse.de> <20230731161452.GA40850@hirez.programming.kicks-ass.net> <20230731211517.GA51835@hirez.programming.kicks-ass.net> <20230801190852.GG11704@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230801190852.GG11704@hirez.programming.kicks-ass.net> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,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 On Tue, Aug 01, 2023 at 09:08:52PM +0200, Peter Zijlstra wrote: > On Tue, Aug 01, 2023 at 10:32:45AM -0700, Guenter Roeck wrote: > > On 7/31/23 14:15, Peter Zijlstra wrote: > > > On Mon, Jul 31, 2023 at 09:34:29AM -0700, Guenter Roeck wrote: > > > > > Ha!, I was poking around the same thing. My hack below seems to (so far, > > > > > <20 boots) help things. > > > > > > > > > > > > > So, dumb question: > > > > How comes this bisects to "sched/fair: Remove sched_feat(START_DEBIT)" ? > > > > > > That commit changes the timings of things; dumb luck otherwise. > > > > Kind of scary. So I only experienced the problem because the START_DEBIT patch > > happened to be queued roughly at the same time, and it might otherwise have > > found its way unnoticed into the upstream kernel. That makes me wonder if this > > or other similar patches may uncover similar problems elsewhere in the kernel > > (i.e., either hide new or existing race conditions or expose existing ones). > > > > This in turn makes me wonder if it would be possible to define a test which > > would uncover such problems without the START_DEBIT patch. Any idea ? > > IIRC some of the thread sanitizers use breakpoints to inject random > sleeps, specifically to tickle races. I have heard of are some of these, arguably including KCSAN, but they would have a tough time on this one. They would have to inject many milliseconds between the check of ->kthread_ptr in synchronize_rcu_tasks_generic() and that mutex_lock() in rcu_tasks_one_gp(). Plus this window only occurs during boot shortly before init is spawned. On the other hand, randomly injecting delay just before acquiring each lock would cover this case. But such a sanitzer would still only get one shot per boot of the kernel for this particular bug. Thanx, Paul