From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752690AbcKGUoH (ORCPT ); Mon, 7 Nov 2016 15:44:07 -0500 Received: from smtprelay0228.hostedemail.com ([216.40.44.228]:36941 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751512AbcKGUoF (ORCPT ); Mon, 7 Nov 2016 15:44:05 -0500 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::,RULES_HIT:41:355:379:541:599:800:960:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:1801:2393:2553:2559:2562:2693:3138:3139:3140:3141:3142:3354:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4250:4605:5007:6117:6261:7875:7903:10004:10400:10848:10967:11026:11232:11473:11658:11914:12296:12555:12663:12739:12740:12760:12986:13439:14096:14097:14181:14659:14721:21063:21080:21222:21451:30012:30054:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: mint69_406e65d25a62e X-Filterd-Recvd-Size: 3529 Date: Mon, 7 Nov 2016 15:44:01 -0500 From: Steven Rostedt To: Daniel Bristot de Oliveira Cc: Christoph Lameter , Daniel Bristot de Oliveira , Ingo Molnar , Peter Zijlstra , linux-rt-users , LKML Subject: Re: [PATCH] sched/rt: RT_RUNTIME_GREED sched feature Message-ID: <20161107154401.16f0214e@gandalf.local.home> In-Reply-To: References: <20161107133207.4282de69@gandalf.local.home> <20161107144738.4811a5dd@gandalf.local.home> <20161107150003.66777b43@gandalf.local.home> <1e79f711-95f1-da2f-f572-1ac4329c8be7@bristot.me> <20161107151617.486b1b42@gandalf.local.home> X-Mailer: Claws Mail 3.14.0 (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 On Mon, 7 Nov 2016 21:33:02 +0100 Daniel Bristot de Oliveira wrote: > On 11/07/2016 09:16 PM, Steven Rostedt wrote: > > I'm confused? Are you saying that RR tasks don't get throttled in the > > current code? That sounds like a bug to me. > > If the RT_RUNTIME_SHARING is enabled, the CPU in which the RR tasks are > running (and pinned) will borrow RT runtime from another CPU, allowing > the RR tasks to run forever. For example: > > [root@kiron debug]# cat /proc/sched_debug | grep rt_runtime > .rt_runtime : 950.000000 > .rt_runtime : 950.000000 > .rt_runtime : 950.000000 > .rt_runtime : 950.000000 > [root@kiron debug]# echo RT_RUNTIME_SHARE > sched_features > [root@kiron debug]# taskset -c 2 chrt -r 5 /home/bristot/f & > [1] 23908 > [root@kiron debug]# taskset -c 2 chrt -r 5 /home/bristot/f & > [2] 23915 > [root@kiron debug]# cat /proc/sched_debug | grep rt_runtime > .rt_runtime : 900.000000 > .rt_runtime : 950.000000 > .rt_runtime : 1000.000000 > .rt_runtime : 950.000000 > > You see? the rt_runtime of the CPU 2 was borrowed time from CPU 0. > > It is not a BUG but a feature (no jokes haha). With RT_RUNTIME_SHARE, > the rt_runtime is such a global runtime. It works fine for tasks that > can migrate... but that is not the case for per-cpu kworkers. This still looks like a bug, or not the expected result. Perhaps we shouldn't share when tasks are pinned. It doesn't make sense. It's like pinning two deadline tasks to the same CPU and giving them 100% of that CPU and saying that it's really just 1/nr_cpus of usage, which would have the same effect. OK, it appears this is specific to RT_RUNTIME_SHARE which is what causes this strange behavior, and even more rational to make this a default option and perhaps even turn RT_RUNTIME_SHARE off by default. -- Steve