Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2799412pxb; Mon, 1 Nov 2021 02:01:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/nd9OJMA6j5lrzdL/Vggxlghhi5hjXb210+GCVNs9x/i0JBijm3U0DFzGxcDnDaXylWPq X-Received: by 2002:aa7:c941:: with SMTP id h1mr40042396edt.128.1635757265994; Mon, 01 Nov 2021 02:01:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635757265; cv=none; d=google.com; s=arc-20160816; b=F2aiLbmFZZad/iXCNa/10Bh7F4nTscA0vUgm4c6sMwMISHxg6JU92HzmPYKdpyRwxV 8O0MH3n9uxXWpIPnAsNddmOtEgQA2K29gnAuNYEb/D09R80IVDf+PEIXDXtBCAxF3VCo nDxwefNXQlbds+lPT76BU56EWgLd3MWvwzljFyd58gxv6GS4tMUZbEZk7FiF3PBsWUKq 4ypJulY/vI3oRw9vqfbbyYqDdllWciZf0xd1zmu1vJR+u8U2TKbIGKyuxRpN41VDQkAY eS9+Nuh5OBDr2cGuHvEbENFfiBedGbeLhjb8RCkgRHPp4fl7AxFruPBjfT+pWpmiPK6W Walw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=mSJnVG7baxXQn3BxbXokcdg7lUkFbjeXeM2zDnuq3Zs=; b=Td3gqoRMUeOFRIWRkwDaLVK+tFQXxVbpMF0D+hiYft+GJYtd0bQRyq647cjdR7cuU9 P4xWPNzddomNd1MXYMk5sASW8GX3zKy3Y+iy5wdWkfdA9QSr2GC4Y7fD3EiWVLRc2iaY y1rZC9zP9hHOh3uFnM4awgivLL0mujGIR6E70zzIQEq8df6L0jLNbqPcEA8NVsrAN3TZ OymWPedFli2TuHtPESUvhq5cZGF+aXFZAR5FuxulXTJWqpGr0ukKGnK+8BoSWJmVYjAS tQmfyUt4f0NV9s9kFhNH0XlT1tWSAp84ag0OdTXP+ns7VPqKcFN1kNopFXhCSyCXXzLn DqEQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p4si25646732edj.221.2021.11.01.02.00.41; Mon, 01 Nov 2021 02:01:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231695AbhKAI7N (ORCPT + 99 others); Mon, 1 Nov 2021 04:59:13 -0400 Received: from outbound-smtp35.blacknight.com ([46.22.139.218]:58977 "EHLO outbound-smtp35.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231663AbhKAI7K (ORCPT ); Mon, 1 Nov 2021 04:59:10 -0400 Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp35.blacknight.com (Postfix) with ESMTPS id 1A1D027ED for ; Mon, 1 Nov 2021 08:56:35 +0000 (GMT) Received: (qmail 19541 invoked from network); 1 Nov 2021 08:56:34 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.17.29]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 1 Nov 2021 08:56:34 -0000 Date: Mon, 1 Nov 2021 08:56:33 +0000 From: Mel Gorman To: Vincent Guittot Cc: Peter Zijlstra , Ingo Molnar , Valentin Schneider , Aubrey Li , Barry Song , Mike Galbraith , Srikar Dronamraju , LKML Subject: Re: [PATCH 1/2] sched/fair: Couple wakee flips with heavy wakers Message-ID: <20211101085633.GW3959@techsingularity.net> References: <20211028094834.1312-1-mgorman@techsingularity.net> <20211028094834.1312-2-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 29, 2021 at 05:17:38PM +0200, Vincent Guittot wrote: > > index ff69f245b939..d00af3b97d8f 100644 > > --- a/kernel/sched/fair.c > > +++ b/kernel/sched/fair.c > > @@ -5865,6 +5865,14 @@ static void record_wakee(struct task_struct *p) > > } > > > > if (current->last_wakee != p) { > > + int min = __this_cpu_read(sd_llc_size) << 1; > > + /* > > + * Couple the wakee flips to the waker for the case where it > > + * doesn't accrue flips, taking care to not push the wakee > > + * high enough that the wake_wide() heuristic fails. > > + */ > > + if (current->wakee_flips > p->wakee_flips * min) > > + p->wakee_flips++; > > I have a hard time understanding the rationale behind these changes > and the one below. Could you provide more details about why to > increase p->wakee_flips here ? Also would be good to add such > explanation in the commit message The changelog covers it in the first two paragraphs but would the following be better as a comment? /* * Couple the wakee flips to the waker for the case where the * wakee doesn't accrue any flips during a short interval where * there are many wakeups without cpu load average being updated. * Otherwise, it is possible for wake_wide to not trigger followed * by an affine wake stacking multiple tasks on the same CPU due * to a stale cpu_load() value checked in wake_affine_weight. * This heuristic reduces excessive stacking of tasks while taking * care to not push the wakee high enough that the wake_wide * heuristic fails differently. */ Is that any better? I know this is a heuristic that is a bit on the fuzzy side as it's trying to clamp the worst of a corner case. Ideally "wake_wide" would be replaced with a more straight-forward heuristic but I'm not aware of any alternatives being proposed (and I don't have one of my own). -- Mel Gorman SUSE Labs