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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no 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 16542C433E6 for ; Fri, 19 Mar 2021 09:03:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CD07064F6E for ; Fri, 19 Mar 2021 09:03:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229821AbhCSJDB (ORCPT ); Fri, 19 Mar 2021 05:03:01 -0400 Received: from mx2.suse.de ([195.135.220.15]:52422 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229644AbhCSJC5 (ORCPT ); Fri, 19 Mar 2021 05:02:57 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id D1383AC1F; Fri, 19 Mar 2021 09:02:55 +0000 (UTC) Date: Fri, 19 Mar 2021 09:02:52 +0000 From: Mel Gorman To: Josh Don Cc: Ingo Molnar , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Daniel Bristot de Oliveira , Luis Chamberlain , Kees Cook , Iurii Zaikin , linux-kernel , linux-fsdevel@vger.kernel.org, David Rientjes , Oleg Rombakh , Paul Turner Subject: Re: [PATCH] sched: Warn on long periods of pending need_resched Message-ID: <20210319090252.GF15768@suse.de> References: <20210317045949.1584952-1-joshdon@google.com> <20210317082550.GA3881262@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 17, 2021 at 05:06:31PM -0700, Josh Don wrote: > On Wed, Mar 17, 2021 at 1:25 AM Ingo Molnar wrote: > > > > * Josh Don wrote: > > > > > If resched_latency_warn_ms is set to the default value, only one warning > > > will be produced per boot. > > > > Looks like a value hack, should probably be a separate flag, > > defaulting to warn-once. > > Agreed, done. > > > > This warning only exists under CONFIG_SCHED_DEBUG. If it goes off, it is > > > likely that there is a missing cond_resched() somewhere. > > > > CONFIG_SCHED_DEBUG is default-y, so most distros have it enabled. > > To avoid log spam for people who don't care, I was considering having > the feature default disabled. Perhaps a better alternative is to only > show a single line warning and not print the full backtrace by > default. Does the latter sound good to you? > Default disabling and hidden behind a static branch would be useful because the majority of users are not going to know what to do about a need_resched warning and the sysctl is not documented. As Ingo said, SCHED_DEBUG is enabled by default a lot. While I'm not sure what motivates most distributions, I have found it useful to display topology information on boot and in rare cases, for the enabling/disabling of sched features. Hence, sched debug features should avoid adding too much overhead where possible. The static branch would mean splitting the very large inline functions adding by the patch. The inline section should do a static check only and do the main work in a function in kernel/sched/debug.c so it has minimal overhead if unused. -- Mel Gorman SUSE Labs