Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2271979pxb; Mon, 19 Apr 2021 01:22:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxp69vO6AfxL4enwfj2L6tWsCnCP/XKKVtppcFj+9SHEtTlEzI9JmGU5runsM7XVV3wPOv6 X-Received: by 2002:a17:906:c148:: with SMTP id dp8mr20897849ejc.193.1618820551282; Mon, 19 Apr 2021 01:22:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618820551; cv=none; d=google.com; s=arc-20160816; b=r9oUZ0WwCPp6W4s46GPMo/Ly9UWksLqIoZVCAYOn2+CR6UYDIVse1QCWqD8kGTzpaI EV7RrKv8eEve9fIGHYEHdBQhscRpa5KAwvhNSeGsUJLpD2jUah5CX6H39ZGoi1tqHwhT ry4lKuijywaMnR/ILbVcgpP1lPgqgG2Jr1eAQD7H5gQYYw7S3bRHvltQpz2wTQ7K4bvg jyq89uxz43XA871ZD6c06RC8ZehSc+oG7iL1+CW6NGgspSS92mRvVU0SdApCBmO3IOye Qpq3O+MNOTsslQ319CEsNCDXoEV46uBvkmXjTO7qhD7mY5uuYKsMtThiUu6lvNeVsn3o vYJw== 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:message-id:subject:cc:to:from:date:dkim-signature; bh=DaNq6zWtjWZorbR3r409ar08WrQWjCzN9DdV4P4P3o8=; b=iUo7CtZcbKrpDJFVAzxyERuB2xhZfT8vYGSNMFDVB4hp7Pjepftd7LGjXaQA4oz6Tm mA2m9E5e5foqktPrZKe4GAYn/j2pbJmpzl0Rm6Em1yfHA/ahdTscpKDkE/zlK1pRu1Wd Z9zdf/Vw8O/Z9snjjjFJV60fulv/SX26SxuHlCBjO7fmiVWnsZAyRWgN+Cou8GBMf0RI 9WQ9iCXDql/0/fhtiI7dZ1Ab59tB+p4eSSrzVcnWNha/ZumUp9v97g+2ZXGgtQVrP/Iy /uIXeMrycab8bw9iam3Yp8BLAfaG4/J9P/mmN6s4oEirRFYl1UAvGclazJD7H0BJHeMh lFEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=B20+9x+X; 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 p13si12262115edt.516.2021.04.19.01.22.07; Mon, 19 Apr 2021 01:22:31 -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; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=B20+9x+X; 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 S231742AbhDSIJF (ORCPT + 99 others); Mon, 19 Apr 2021 04:09:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229630AbhDSIJD (ORCPT ); Mon, 19 Apr 2021 04:09:03 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E829C06174A for ; Mon, 19 Apr 2021 01:08:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=DaNq6zWtjWZorbR3r409ar08WrQWjCzN9DdV4P4P3o8=; b=B20+9x+XqvxqyvmCiWtxsA7tUZ MFx7ZbVN43JoHVG44ljMcfNInQUhP0ZstyxbfY+qKVcIZ8Xip50DD9dKcqWQBK2wPk8wwjV72FK85 dw+p83bMULfwJo5GinL+B/TWD2AF7ZUD6HBUicyc3okyVSpU6LTkbQp0dGwrlWu5qFo9QE0zBvBZ3 CNu+NRpr3O1X7dlGj4zrSi2OcovTgBM92JBSHK5QHwpz8p22mvM3yzvbBs12vyUpxlLQbKR9WZ6Fo hgWNR23elZZG9pj/7j/q7745yxlggBRsvoOG3Z+YlkpOSJSfXRiqpEFrQZX9Wo5zM5KB3I1Tos25p GpXx6d1g==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lYOxK-009PHS-An; Mon, 19 Apr 2021 08:08:30 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id ECD60300212; Mon, 19 Apr 2021 10:08:29 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C7B1828591522; Mon, 19 Apr 2021 10:08:29 +0200 (CEST) Date: Mon, 19 Apr 2021 10:08:29 +0200 From: Peter Zijlstra To: Josh Don Cc: Mel Gorman , Ingo Molnar , linux-kernel@vger.kernel.org, Paul Turner Subject: Re: [PATCH v2 resubmit] sched: Warn on long periods of pending need_resched Message-ID: References: <20210416212936.390566-1-joshdon@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210416212936.390566-1-joshdon@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 16, 2021 at 02:29:36PM -0700, Josh Don wrote: > From: Paul Turner > > CPU scheduler marks need_resched flag to signal a schedule() on a > particular CPU. But, schedule() may not happen immediately in cases > where the current task is executing in the kernel mode (no > preemption state) for extended periods of time. > > This patch adds a warn_on if need_resched is pending for more than the > time specified in sysctl resched_latency_warn_ms. If it goes off, it is > likely that there is a missing cond_resched() somewhere. Monitoring is > done via the tick and the accuracy is hence limited to jiffy scale. This > also means that we won't trigger the warning if the tick is disabled. > > This feature (LATENCY_WARN) is default disabled. > > Signed-off-by: Paul Turner > Signed-off-by: Josh Don > Signed-off-by: Peter Zijlstra (Intel) > Link: https://lkml.kernel.org/r/20210323035706.572953-1-joshdon@google.com Thanks!