Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6872178rwr; Tue, 2 May 2023 06:43:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6FuiT7iVbraeFUD7Y1oPKuJETiZYpuzStIvN4eWjcJtnUo5Rt+q44uBmtQGUXZYBo6CCw2 X-Received: by 2002:a17:90a:ea92:b0:24d:fee5:6e3e with SMTP id h18-20020a17090aea9200b0024dfee56e3emr6389528pjz.25.1683035006585; Tue, 02 May 2023 06:43:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683035006; cv=none; d=google.com; s=arc-20160816; b=hw7Bjyhxgh2Bl2ablg40/StViYFDrKy6V2owKfjzWOl9+geydCCZK9wvE2WGM92ViE FliQSnY+19zsjsPop0U5ivDgB7ddPjArGQlqB8ePnCu2vMGBJgWbSWvY70SZiFB2hOC/ 3jixv4cHZStESgJA31HRG1lK/SzEyx8eyWnxdMnHWc4n1DQKNiSGDDYUyAaz5d3lQt4k ODUzCkBy9WJKjC0jWdY+uowvrLD5/kIddYK7oX2rU3l5kAj9/UBxKENoQLi8/KbctaUJ rAdSxQKfQtm4M2hPmwdpJNjVCLPwSeLXiIh+l6w1EczW3hdXmDgtunzU/aEoRSm99DHG FHpA== 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=QD8JaPrB7tHidIYjlq4aI4cng134Uul9VoPUCM+BGkk=; b=HiPilvzSWBimOchvE+17eVO2bcMnR/RHcyWwiJ+kLS/Yd0EIEYxWMvgOj+Mi9EN7yt j/Cb61mgV4m6577LLkeGl0KFvFm+PXx6PlEuzSRORERQkv04yjYDCar0Ya//4RBmA22B GBOzxiqdLvU4Wu+X+x0Tm1/EXw95uvp10408V/MiYPbZi1nQBGk9TxT9d5cZsF6wWIFm 2ECaVrnZjL0v1KefbQxH5FVmd56lJ0ES20nkQqAna4Yf/mi3+9Vo/lE/q723vYvICfiI XGbUJlHT+fzpKuEtz9gPiZYCwXPSYddjOx3dvRZk8a7RQM9yI4BWQOHhArz6aDwbP76J BNhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JgZBjw47; 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 rm2-20020a17090b3ec200b0024742007433si11990472pjb.19.2023.05.02.06.43.14; Tue, 02 May 2023 06:43:26 -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=JgZBjw47; 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 S234473AbjEBNmQ (ORCPT + 99 others); Tue, 2 May 2023 09:42:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234519AbjEBNl6 (ORCPT ); Tue, 2 May 2023 09:41:58 -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 D250A6E94; Tue, 2 May 2023 06:41:11 -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 B3211624B0; Tue, 2 May 2023 13:40:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24A7AC433D2; Tue, 2 May 2023 13:40:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683034819; bh=kkOAvtB147zyYeIk9DHSpxKkoZSq/1ixzv0pWWTPA0A=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=JgZBjw47jwJCQ3q1712ittRHOs1GJnaJKnNUYnrxe9KkqhHw7avOmZ18wctzrZ3nY /AWbfuptRm+xJb30elet85pEX9EGaWBZvutGMWgVDnp2YfSRupOiQcQBAanmBekO3M el+2plAKDxP4+wXTJ78t1wEd5fr1bQ1DNMAIVDTCbUFgrCK2K+44nkpv8G1qbenVvz Xx1iaShLQ/sfCj7QJtZdbEGxdFLQQaoEjcsHd5hNviUUTzHjBy5ThXatBCPDqAnzky rC7jrfqf6Uth4UIEpexuqvbToxoQqM1bHNd+XjpDQYkBk5R3j+q5ku7Qoa6WsfLWA3 B1tSLGkWw3+8g== Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id B3F3B15405AD; Tue, 2 May 2023 06:40:18 -0700 (PDT) Date: Tue, 2 May 2023 06:40:18 -0700 From: "Paul E. McKenney" To: zhouzhouyi@gmail.com Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org, lance@osuosl.org Subject: Re: [PATCH V2] rcu/torture replace wait_event with wait_event_idle Message-ID: <783a1e86-d625-4d8b-9b7c-0531b11b9290@paulmck-laptop> Reply-To: paulmck@kernel.org References: <1682985701-19914-1-git-send-email-zhouzhouyi@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1682985701-19914-1-git-send-email-zhouzhouyi@gmail.com> X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, 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 On Tue, May 02, 2023 at 08:01:41AM +0800, zhouzhouyi@gmail.com wrote: > From: Zhouyi Zhou > > In kfree_rcu_test, kfree_scale_shutdown will be detected as hung task > if kfree_loops is too big. Replace wait_event with wait_event_idle > to avoid false positive. > > Tested in the PPC VM of Open Source Lab of Oregon State University. > > Suggested-by: Paul E. McKenney > Signed-off-by: Zhouyi Zhou Good catch, thank you! However, this commit beat you to it: ef1ef3d47677 ("rcuscale: Move shutdown from wait_event() to wait_event_idle()") Thanx, Paul > --- > kernel/rcu/rcuscale.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/rcu/rcuscale.c b/kernel/rcu/rcuscale.c > index 91fb5905a008..d99c586939d1 100644 > --- a/kernel/rcu/rcuscale.c > +++ b/kernel/rcu/rcuscale.c > @@ -771,7 +771,7 @@ kfree_scale_cleanup(void) > static int > kfree_scale_shutdown(void *arg) > { > - wait_event(shutdown_wq, > + wait_event_idle(shutdown_wq, > atomic_read(&n_kfree_scale_thread_ended) >= kfree_nrealthreads); > > smp_mb(); /* Wake before output. */ > -- > 2.34.1 >