From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751606AbcETVYM (ORCPT ); Fri, 20 May 2016 17:24:12 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:35384 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750836AbcETVYJ (ORCPT ); Fri, 20 May 2016 17:24:09 -0400 Date: Fri, 20 May 2016 22:24:05 +0100 From: Matt Fleming To: Peter Zijlstra Cc: mingo@kernel.org, linux-kernel@vger.kernel.org, Pavan Kondeti , Ben Segall , Morten Rasmussen , Paul Turner , Thomas Gleixner , byungchul.park@lge.com, Andrew Hunter , Mike Galbraith , Mel Gorman Subject: Re: [PATCH 2/3] sched,fair: Fix local starvation Message-ID: <20160520212405.GL21993@codeblueprint.co.uk> References: <20160510174314.355953085@infradead.org> <20160510174613.902178264@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160510174613.902178264@infradead.org> User-Agent: Mutt/1.5.24+41 (02bc14ed1569) (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 May, at 07:43:16PM, Peter Zijlstra wrote: > Mike reported that the recent commit 3a47d5124a95 ("sched/fair: Fix > fairness issue on migration") broke interactivity and the signal > starve test. > > The problem is that I assumed ENQUEUE_WAKING was only set when we do a > cross-cpu wakeup (migration), which isn't true. This means we now > destroy the vruntime history of tasks and wakeup-preemption suffers. > > Cure this by making my assumption true, only call > sched_class::task_waking() when we do a cross-cpu wakeup. This avoids > the indirect call in the case we do a local wakeup. > > Cc: Pavan Kondeti > Cc: Ben Segall > Cc: Matt Fleming > Cc: Morten Rasmussen > Cc: Paul Turner > Cc: Thomas Gleixner > Cc: byungchul.park@lge.com > Cc: Andrew Hunter > Fixes: 3a47d5124a95 ("sched/fair: Fix fairness issue on migration") > Reported-by: Mike Galbraith > Signed-off-by: Peter Zijlstra (Intel) > --- > kernel/sched/core.c | 29 +++++++++++++++++++++-------- > kernel/sched/fair.c | 41 ++++++++++++++++++++++++++++++++++++++++- > 2 files changed, 61 insertions(+), 9 deletions(-) This patch appears to cause a regression for hackbench -pipe of between ~8% and ~10% with groups >= NR_CPU. I haven't probed much yet, but it looks like the vruntime of tasks has gone nuts.