Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5492457ybl; Tue, 14 Jan 2020 09:49:22 -0800 (PST) X-Google-Smtp-Source: APXvYqwoqkh68IsV2CBhXo8txezo2Zoqbk/TVmpl+Ez1K1mFQgZ5Aye5dExnjw7RdmvK269cw07n X-Received: by 2002:a9d:53c4:: with SMTP id i4mr18742674oth.48.1579024162081; Tue, 14 Jan 2020 09:49:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579024162; cv=none; d=google.com; s=arc-20160816; b=h4oTqInyaJ1Ji8QqbzgZlUlknuQ82bhIeJyhcOr0/anWoTp43fnRmAzAuCL8mQUl3Y kF0rrRnqofRwpUpSmEXzcJbc6itzvPt+OBvC9+XdF6EfAN5hSM6ypsRaQenTORwX5xxR 2yOtsbrEZUHE9ZP266OpGZYG1WHJDBjABaN4Gq9dUzz8Y8GPNCfOmRjyjvE6mZ0yK1uf QKTgBwuKYQssZa9FwCjJBZ97arftLqaAGS90pD8kihdmmtr82CUT6fQMcM7mt4F/BNo0 rkuVD8Mepy+xOcsU+Z0boe7sqE8KlPkChhl2fHu3xdpKgWKhAVyUWC9l8aWMLjdJYS/m +cFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=aw/iN99pkCh+GDU0JOvc2sYyWY5MK9f9fjq0kLUsGFM=; b=xbSKLqRTwMzYH7kJVppcztpd2gsEHtk/W5Q7uGuTFGMoLU5cG887TAFvYOz57oXi5t hxc2K/Gwm6LLwah0rOEUDxaNjFtRYnZEC972+Y0a3DMTKZaz47itRYEy3wOBxQHwFJNs Dze1kVPDVm4tGFGPuTIxLNIRB0CMrPjJS4T5UkA+y93D+BDKN4VjcF5eTTmE9JHcxvpo hk40PlNjKH0uyEyMn6/6BwZ1LaflMwjmlzQy/zzWf/iqMXe4JYCD35TDGent1NbkVlUe NwAJqgJCWVYYsH/3EVUIq5JbQTjVn0d8cAxuxPRz1qlw+6uT1snrGEQJ/VFi7RKLfvQR HaNw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s6si8518938otp.126.2020.01.14.09.49.10; Tue, 14 Jan 2020 09:49:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728753AbgANRsQ (ORCPT + 99 others); Tue, 14 Jan 2020 12:48:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:54842 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726053AbgANRsP (ORCPT ); Tue, 14 Jan 2020 12:48:15 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6C52924676; Tue, 14 Jan 2020 17:48:14 +0000 (UTC) Date: Tue, 14 Jan 2020 12:48:12 -0500 From: Steven Rostedt To: David Laight Cc: 'Vincent Guittot' , Peter Zijlstra , Viresh Kumar , Ingo Molnar , Juri Lelli , Dietmar Eggemann , Ben Segall , Mel Gorman , linux-kernel Subject: Re: sched/fair: scheduler not running high priority process on idle cpu Message-ID: <20200114124812.4d5355ae@gandalf.local.home> In-Reply-To: <5ba2ae2d426c4058b314c20c25a9b1d0@AcuMS.aculab.com> References: <212fabd759b0486aa8df588477acf6d0@AcuMS.aculab.com> <20200114115906.22f952ff@gandalf.local.home> <5ba2ae2d426c4058b314c20c25a9b1d0@AcuMS.aculab.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; 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 Tue, 14 Jan 2020 17:33:50 +0000 David Laight wrote: > I have added a cond_resched() to the offending loop, but a close look implies > that code is called with a lock held in another (less common) path so that > can't be directly committed and so CONFIG_PREEMPT won't help. > > Indeed requiring CONFIG_PREEMPT doesn't help when customers are running > the application, nor (probably) on AWS since I doubt it is ever the default. > > Does the same apply to non-RT tasks? > I can select almost any priority, but RT ones are otherwise a lot better. > > I've also seen RT processes delayed by the network stack 'bh' that runs > in a softint from the hardware interrupt. > That can take a while (clearing up tx and refilling rx) and I don't think we > have any control over the cpu it runs on? Yes, even with CONFIG_PREEMPT, Linux has no guarantees of latency for any task regardless of priority. If you have latency requirements, then you need to apply the PREEMPT_RT patch (which may soon make it to mainline this year!), which spin locks and bh wont stop a task from scheduling (unless they need the same lock). > > The cost of ftrace function call entry/exit (about 200 clocks) makes it > rather unsuitable for any performance measurements unless only > a very few functions are traced - which rather requires you know > what the code is doing :-( > Well, when I use function tracing, I start all of them, analyze the trace, then the functions I don't care about (usually spin locks and other utils), I add to the set_ftrace_notrace file, which keeps them from being part of the trace. I keep doing this until I find a set of functions that doesn't hurt overhead as much and gives me enough information to know what is happening. It also helps to enable all or most events (at least scheduling events). -- Steve