Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1225585pxf; Fri, 19 Mar 2021 02:04:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbl+DBoLzbhz/rhUcr4muWLwBEOXJQT0I80sAAKu8pP0fpH1CAEnhwFjYcegwtkRyrn3yj X-Received: by 2002:a05:6402:35d3:: with SMTP id z19mr8257043edc.143.1616144659345; Fri, 19 Mar 2021 02:04:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616144659; cv=none; d=google.com; s=arc-20160816; b=TBpepoBGIeYtu4pTg9vOs9ve1vT+IQuPnyeakZMQZOVt7z0wSvE7AV3Xafwq3V5RuD FxwHgmJGA8yqzp2R+ZVoGLOSRgnRHTN/z/pbia4tstX6oC/9JpJWaaCvCjEkCb6vg1xc KojQ9HlsuPJ+ASX2edzTmcbCCEcBgLLGkGQ8Skr9w1/KgsjBk9LCVvJRMHE6HwpK/PPt s6Nw1DEWwyx97sQ1b32H/sy4GGqZqXi85b6Fosj1DkAHOXWnZHgkQgLLibQaNtdZErRA 7mjo2jbSQj86qUpKJlC3eXoiC6eFGsR9EN0WtW6rAAJmwwY0Szrf7bX8q08gEU+M/+7s 2nDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=3+ThyrazCRt8o2ype9gl54Psq6aR5IWfIsyBKn4i21c=; b=PdcSus8eJr/0x4caA5zT4BdaVs4lql8WBhqQdKSsB5LfwphWWgxW+nIWNgPN1bVO82 7aHdpJF8Q7+sYwAGXvPHL3PBo5QiuSCgdiznQPyFOc5hPTEnAwq8f79lYDWY4Rz2RFBh IHx5wEemggNCagDWLRfoAO+e0+Id+cKLxB4nWkZtStpBFJFZCPs5s5e0wOtuXhHwF3H9 VxpfDehaNLbKixo+nDqK/kth2vkpI0szqa1+Wb9gcFIGRnVBmiizlRZtHyoxHhpayeXV p9t8WNc7d8cGvagnqXXWsUvVmlOmEc7CLbZLyxBOge7FU9kquG/iKWyGbErbvqdwh1go OOew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q17si3742028eju.412.2021.03.19.02.03.56; Fri, 19 Mar 2021 02:04:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229863AbhCSJC7 (ORCPT + 99 others); Fri, 19 Mar 2021 05:02:59 -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