From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752749AbbJFUoc (ORCPT ); Tue, 6 Oct 2015 16:44:32 -0400 Received: from talus.maths.usyd.edu.au ([129.78.68.1]:39942 "EHLO talus.maths.usyd.edu.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752432AbbJFUob (ORCPT ); Tue, 6 Oct 2015 16:44:31 -0400 X-smtpdoor-from: psz@maths.usyd.edu.au X-smtpdoor-want-Message-ID: <201510062044.t96KiGXd021728@como.maths.usyd.edu.au> Date: Wed, 7 Oct 2015 07:44:16 +1100 From: paul.szabo@sydney.edu.au Message-Id: <201510062044.t96KiGXd021728@como.maths.usyd.edu.au> To: umgwanakikbuti@gmail.com Subject: Re: CFS scheduler unfairly prefers pinned tasks Cc: linux-kernel@vger.kernel.org In-Reply-To: <1444133838.2832.141.camel@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear Mike, >> ... the CFS is meant to be fair, using things like vruntime >> to preempt, and throttling. Why are those pinned tasks not preempted or >> throttled? > > Imagine you own a 8192 CPU box for a moment, all CPUs having one pinned > task, plus one extra unpinned task, and ponder what would have to happen > in order to meet your utilization expectation. ... Sorry but the kernel contradicts. As per my original report, things are "fair" in the case of: - with CGROUP controls and the two kinds of processes run by different users, when there is just one un-pinned process and that is so on my quad-core i5-3470 baby or my 32-core 4*E5-4627v2 server (and everywhere that I tested). The kernel is smart and gets it right for one un-pinned process: why not for two? Now re-testing further (on some machines with CGROUP): on the i5-3470 things are fair still with one un-pinned (become un-fair with two), on the 4*E5-4627v2 are fair still with 4 un-pinned (become un-fair with 5). Does this suggest that the kernel does things right within each physical CPU, but breaks across several (or exact contrary)? Maybe not: on a 2*E5530 machine, things are fair with just one un-pinned and un-fair with 2 already. > What you're seeing is not a bug. No task can occupy more than one CPU > at a time, making space reservation on multiple CPUs a very bad idea. I agree that pinning may be bad... should not the kernel penalize the badly pinned processes? Cheers, Paul Paul Szabo psz@maths.usyd.edu.au http://www.maths.usyd.edu.au/u/psz/ School of Mathematics and Statistics University of Sydney Australia