From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE3A2C43387 for ; Fri, 14 Dec 2018 20:31:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 11EEB2080F for ; Fri, 14 Dec 2018 20:31:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730969AbeLNUbP (ORCPT ); Fri, 14 Dec 2018 15:31:15 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:48730 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730787AbeLNUbO (ORCPT ); Fri, 14 Dec 2018 15:31:14 -0500 Received: from akpm3.svl.corp.google.com (unknown [104.133.8.65]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 73B92C9E; Fri, 14 Dec 2018 20:31:13 +0000 (UTC) Date: Fri, 14 Dec 2018 12:31:11 -0800 From: Andrew Morton To: Tetsuo Handa Cc: Petr Mladek , Sergey Senozhatsky , "Paul E. McKenney" , Dmitry Vyukov , "Rafael J. Wysocki" , Vitaly Kuznetsov , linux-kernel@vger.kernel.org Subject: Re: [PATCH] kernel/hung_task.c: Break RCU locks based on jiffies. Message-Id: <20181214123111.266cae10f71ea6b277d634c6@linux-foundation.org> In-Reply-To: <1544800658-11423-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp> References: <1544800658-11423-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 15 Dec 2018 00:17:38 +0900 Tetsuo Handa wrote: > check_hung_uninterruptible_tasks() is currently calling rcu_lock_break() > for every 1024 threads. But check_hung_task() is very slow if printk() > was called, and is very fast otherwise. If many threads within some 1024 > threads called printk(), the RCU grace period might be extended enough > to trigger RCU stall warnings. Therefore, calling rcu_lock_break() for > every some fixed jiffies will be safer. > > --- a/kernel/hung_task.c > +++ b/kernel/hung_task.c > @@ -34,7 +34,7 @@ > * is disabled during the critical section. It also controls the size of > * the RCU grace period. So it needs to be upper-bound. > */ > -#define HUNG_TASK_BATCHING 1024 > +#define HUNG_TASK_LOCK_BREAK (HZ / 10) This won't work correctly if rcu_cpu_stall_timeout is set to something stupidly small. Perhaps is would be better to make this code aware of the current rcu_cpu_stall_timeout setting?