Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2249682rwd; Fri, 16 Jun 2023 01:02:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ57FKolMCy5cfRI5iL7YJSxpyq/WNKaTlgfxDV4BAqmFmWOI84FgzQmOvar4X/iMgSOBWjn X-Received: by 2002:a17:90a:341:b0:25b:f1f0:1204 with SMTP id 1-20020a17090a034100b0025bf1f01204mr1141241pjf.28.1686902522207; Fri, 16 Jun 2023 01:02:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686902522; cv=none; d=google.com; s=arc-20160816; b=r0RDyNL6zkubMVreBiO8G+sbg3uYjKVfKa25gd9LZw3QmGS+ITuOS2Vhp43ZCof6lJ 6NuHbVLnjLD2uA5TAVcxPvgYbnbH1U12pRzaWJqw7UwnYxeL3J3mIL7jLBJzC4Odrvfc Voav+DlmvkFdX2yrSOgCSvWcjCfjMRnl3ISspCjrwV2CxTzrozE+9aFbv9/89paUU43D 9P72LHt2cj5n2R+yNcPm0qhW5TSJgeCdtqA0/+/R1PliB9OeD8Z7A95MuNrzMO1XWm16 Qm9z30Pzr5k1Rp6/2OM20i2wFn09CY7JlLI10amy9wYP9eUCQ0pjz21VsPj/7UGYAufr HzGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=b7akhRlrAotjAIYUI4yTq+8R48vhHEwOUnsry9EsS18=; b=I+ZYcIKmrZAeCex9BQwfViWcHyIYmpNDClZ8J8uPrFnbLijYu0IgJEmzGwUgl/Yptw VPfr9Ew3Sh2qs09dRRQ6gRK3+pgQvBKDtw+h8fULl10TfNEs+lNDwvYIkcfvmodRll6a jxJBLdNae3992o2dXIGt2BodwyOgVXTP6S8shAgFw0PK7BYnidgDK1Ey0tvjpOoH6j2R AmWrHnyUQ5Y68s+mXIs+9JS8aqE4MdKjx81Kt4/CRxCM/w9WP+eLZCJzYXcgclqWQ0xk BrGKQoKOoWb0zK2krs7W9hcZ8/4HtsPBhwtN4VrFoXGsiYiuqI5BXq2dnro4HIsMMXsW 71qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=coR3DHhV; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mw7-20020a17090b4d0700b0025defcc6e75si1108577pjb.172.2023.06.16.01.01.47; Fri, 16 Jun 2023 01:02:02 -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=@gmail.com header.s=20221208 header.b=coR3DHhV; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245278AbjFPHji (ORCPT + 99 others); Fri, 16 Jun 2023 03:39:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231671AbjFPHjg (ORCPT ); Fri, 16 Jun 2023 03:39:36 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79CAF1FE2; Fri, 16 Jun 2023 00:39:35 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-66643830ab3so541512b3a.0; Fri, 16 Jun 2023 00:39:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686901175; x=1689493175; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=b7akhRlrAotjAIYUI4yTq+8R48vhHEwOUnsry9EsS18=; b=coR3DHhVCV63O2jHgnP8FOfFjrEI7Vn3UwLEdsaTlC4zdYT2te1IF+EhrIMzG/XPCJ dSy6+zDZeAEq0/yZSGxol9NjgcXAXHR+0RYzSmjIVJyWcEplG9+jLszotI+CY60UrruN 4NGBQaHHVW1xet1QyqVc7Ed2mDmok0eUgHs6UvZNvqfWOJrN9mb0ByF8ar0cUbINNKGZ 2WOalAO7282mD+Z0TfIaIN0lnm1+m696pAsSe7/enO/O3RWHx7peWazLs1PBM5Q5RVEO 8d6z94qr7lW6aNZVhf0yV9PHfcW0Sv7kqBDzeZXxZ4bhUs0JS2kSNVbQDTBOLxrE2fmu us3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686901175; x=1689493175; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b7akhRlrAotjAIYUI4yTq+8R48vhHEwOUnsry9EsS18=; b=faQWZXlMGBXLTVcQw5xsEVuoVm4tRTiWekE7Vy+uVsiGTblGBua6gw/d08iPgb4q3D EGL2TtBzxPW4iwAn3B2ISxKgcfEEz2rWf/TDwlBXS6aRIpQhTknhRrRti3cU8XmY9aJ4 dWHut4VeKKDzkiPKIexIR556mpaZpIn+MWVYehP5e0zmG7DlKZ2EIEfHMW2c2Opkz9Ei 9JyVv2wLg01i1htafA1li8fUzi0sGp5SZkuHQdGyYfSwbI8t9TnN9Jh4yW8yqwx/UGkT BysFtdo36/xZud4JHZnM84IUB7N4i5G2wyYmK3ziWVl6X6sBOgd1vUamVg0EklImfQ9O CyPw== X-Gm-Message-State: AC+VfDyqHd6yF6mCqM9GTl/tWK6J2xOUMzc+HnhfOi6nDigT1x5Ag+gF 14VJUt4fyNXpXrA394LR9D0= X-Received: by 2002:a05:6a00:1a56:b0:65b:38b2:8d4b with SMTP id h22-20020a056a001a5600b0065b38b28d4bmr1509585pfv.29.1686901174778; Fri, 16 Jun 2023 00:39:34 -0700 (PDT) Received: from MSCND1355B05.fareast.nevint.com ([183.242.39.186]) by smtp.gmail.com with ESMTPSA id i21-20020aa78d95000000b0064d34ace753sm13134736pfr.114.2023.06.16.00.39.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jun 2023 00:39:34 -0700 (PDT) From: Zqiang To: paulmck@kernel.org, frederic@kernel.org, joel@joelfernandes.org, quic_neeraju@quicinc.com, qiang.zhang1211@gmail.com Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rcuscale: Move schedule_timeout _uninterruptible to _idle in rcu_scale_writer() Date: Fri, 16 Jun 2023 15:39:26 +0800 Message-Id: <20230616073926.24462-1-qiang.zhang1211@gmail.com> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,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 The rcuscale.holdoff can be used to delay the start of rcu_scale_writer kthread, however, if the rcuscale.holdoff is set and the timeout is greater than the hung_task_timeout_secs, can trigger the hung-task timeout: runqemu kvm nographic slirp qemuparams="-smp 4 -m 2048M" bootparams="rcuscale.shutdown=0 rcuscale.holdoff=300" [ 247.071753] INFO: task rcu_scale_write:59 blocked for more than 122 seconds. [ 247.072529] Not tainted 6.4.0-rc1-00134-gb9ed6de8d4ff #7 [ 247.073400] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 247.074331] task:rcu_scale_write state:D stack:30144 pid:59 ppid:2 flags:0x00004000 [ 247.075346] Call Trace: [ 247.075660] [ 247.075965] __schedule+0x635/0x1280 [ 247.076448] ? __pfx___schedule+0x10/0x10 [ 247.076967] ? schedule_timeout+0x2dc/0x4d0 [ 247.077471] ? __pfx_lock_release+0x10/0x10 [ 247.078018] ? enqueue_timer+0xe2/0x220 [ 247.078522] schedule+0x84/0x120 [ 247.078957] schedule_timeout+0x2e1/0x4d0 [ 247.079447] ? __pfx_schedule_timeout+0x10/0x10 [ 247.080032] ? __pfx_rcu_scale_writer+0x10/0x10 [ 247.080591] ? __pfx_process_timeout+0x10/0x10 [ 247.081163] ? __pfx_sched_set_fifo_low+0x10/0x10 [ 247.081760] ? __pfx_rcu_scale_writer+0x10/0x10 [ 247.082287] rcu_scale_writer+0x6b1/0x7f0 [ 247.082773] ? mark_held_locks+0x29/0xa0 [ 247.083252] ? __pfx_rcu_scale_writer+0x10/0x10 [ 247.083865] ? __pfx_rcu_scale_writer+0x10/0x10 [ 247.084412] kthread+0x179/0x1c0 [ 247.084759] ? __pfx_kthread+0x10/0x10 [ 247.085098] ret_from_fork+0x2c/0x50 [ 247.085433] This commit therefore replaces schedule_timeout_uninterruptible() with schedule_timeout_idle(). Signed-off-by: Zqiang --- 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 a0eae1900708..ffdb30495e3c 100644 --- a/kernel/rcu/rcuscale.c +++ b/kernel/rcu/rcuscale.c @@ -469,7 +469,7 @@ rcu_scale_writer(void *arg) sched_set_fifo_low(current); if (holdoff) - schedule_timeout_uninterruptible(holdoff * HZ); + schedule_timeout_idle(holdoff * HZ); /* * Wait until rcu_end_inkernel_boot() is called for normal GP tests -- 2.17.1