Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752860AbdLDJ4K (ORCPT ); Mon, 4 Dec 2017 04:56:10 -0500 Received: from smtprelay0071.hostedemail.com ([216.40.44.71]:40096 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752431AbdLDJ4H (ORCPT ); Mon, 4 Dec 2017 04:56:07 -0500 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2553:2559:2562:3138:3139:3140:3141:3142:3165:3353:3622:3865:3866:3867:3868:3870:3871:3872:3874:4250:5007:6261:7875:10004:10400:10450:10455:10848:10967:11026:11232:11658:11914:12296:12740:12760:12895:13069:13311:13357:13439:14096:14097:14181:14659:14721:19904:19999:21080:21324:21434:21627:30012:30034:30054:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: basin67_3510060891049 X-Filterd-Recvd-Size: 2658 Date: Mon, 4 Dec 2017 04:55:59 -0500 From: Steven Rostedt To: Juri Lelli Cc: LKML , linux-rt-users , Ingo Molnar , Peter Zijlstra , Sebastian Andrzej Siewior , Daniel Wagner , Thomas Gleixner Subject: Re: [PATCH] sched/rt: Do not pull from current CPU if only one cpu to pull Message-ID: <20171204045559.190f707b@vmware.local.home> In-Reply-To: <20171204090757.GB26712@localhost.localdomain> References: <20171202130454.4cbbfe8d@vmware.local.home> <20171204074517.GA26712@localhost.localdomain> <20171204030916.0cf09b0f@vmware.local.home> <20171204090757.GB26712@localhost.localdomain> X-Mailer: Claws Mail 3.15.1 (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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1448 Lines: 33 On Mon, 4 Dec 2017 10:07:57 +0100 Juri Lelli wrote: > On 04/12/17 03:09, Steven Rostedt wrote: > > On Mon, 4 Dec 2017 08:45:17 +0100 > > Juri Lelli wrote: > > > > > Right. I was wondering however if for the truly UP case we shouldn't be > > > initiating/queueing callbacks (pull/push) at all? > > > > If !CONFIG_SMP then it's not compiled in. The issue came up when Daniel > > ran a CONFIG_SMP kernel on an arch that only supports UP. > > > > Right, sorry. I meant num_online_cpus() == 1. > Correct. But we need to disable the push/pull when CPUs go down to 1, or if we see "num_possible_cpus() == 1" at boot up. It woulld need to be re-enabled when CPUs are onlined and count goes greater than one. Which we could also add, and I started going that route first. My first patch had that check at each push/pull, but num_online_cpus() is a weight of the cpumask, and for machines with more than 64 CPUs, calculating that number becomes a bigger task and we want to keep that out of the scheduler fast path, which push/pull logic happens to be in. When looking at changing this code, I realized that rt_overloaded() returns the count of overloaded CPUs, and the check to see if the current CPU is overloaded is a single bit check of a cpumask (all very quick). This not only fixes the issue with what Daniel found, but also can help in certain cases on large CPU count machines. -- Steve