Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2462038pxb; Fri, 29 Oct 2021 01:44:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzB4OEicmScVDkHEmFsJIv+n1RzMa9vCAWWlrjmXsobeuqKFJsiqj67/Ioc85E61yBUljVs X-Received: by 2002:a63:f05:: with SMTP id e5mr7075752pgl.226.1635497083813; Fri, 29 Oct 2021 01:44:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635497083; cv=none; d=google.com; s=arc-20160816; b=Oxm3h5SUdZJ3BVgREiruGa3aE3x/39GxSPB3uUAYZIvXPWKg3DUdnFYhab3na8gPgn we53h6ff0QyUZ1xbUvztJZyaW46k3kHQWxnvesRzg0BjwUJu58nug7ifVX/AVdUeFTHG +W/o1kxg4/NldCPnfZNEi9EQN9HayLvQZblRiX7vphBgQAijQ4QzukV78XWV9S3DiX+h DRpYY/Ul4ooNktOFudJXRXoXdMJC5H/FwlzF9BvE71rbBQdMSS7RMjcLVTeLcevzGrSS tDj8VrzFz+QKJ17XnEJhKImCro7sppV8NMI6gKpvengzDi2mEJbr6LlNXHb998dJYfHZ QIdQ== 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=CMsOq10EUvOsB/eooUwmWfShEwXfFqF3UBtWinXRScY=; b=LBKstYKveJURkAwIPUfKv13SwnGc+fJhbZFMljR9+Op4pZL0qu5fWEm8Qo0Wn+GN2w qwC4EcGGZmzfbHz75+LN6WOXW1mfkTGndhslP80eQ5wQEP9BgkEMQOokGOGFp6DzZu0Y 7LoIF3I0Hh68n8OZAX0FocDLPSTh1mPC5Q8Xn9AJ93qRY3/1Yb6XH99/eb44pK+Ni3+u J57c+YE+lKMkRqvZ2mpMwF16HtzkPiP5+H8T4+zJR6IEJhHfadcE6vdNbF6sbHLsG+1L ylPCix912zfE0E5suE5cSIBLs6MXZRSgRofV4b/IUwIoqKxiw4BYDT14eVSpW+FXwcK2 LN6g== 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 m5si2286104plx.300.2021.10.29.01.44.29; Fri, 29 Oct 2021 01:44:43 -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 S232501AbhJ2Iov (ORCPT + 99 others); Fri, 29 Oct 2021 04:44:51 -0400 Received: from outbound-smtp37.blacknight.com ([46.22.139.220]:57087 "EHLO outbound-smtp37.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232504AbhJ2Iou (ORCPT ); Fri, 29 Oct 2021 04:44:50 -0400 Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp37.blacknight.com (Postfix) with ESMTPS id 1F46717FB for ; Fri, 29 Oct 2021 09:42:21 +0100 (IST) Received: (qmail 7036 invoked from network); 29 Oct 2021 08:42:20 -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); 29 Oct 2021 08:42:20 -0000 Date: Fri, 29 Oct 2021 09:42:19 +0100 From: Mel Gorman To: Tao Zhou Cc: Peter Zijlstra , Ingo Molnar , Vincent Guittot , 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: <20211029084219.GV3959@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 12:19:48AM +0800, Tao Zhou wrote: > Hi Mel, > > On Thu, Oct 28, 2021 at 10:48:33AM +0100, Mel Gorman wrote: > > > @@ -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++; > > current->last_wakee = p; > > current->wakee_flips++; > > } > > @@ -5895,7 +5903,7 @@ static int wake_wide(struct task_struct *p) > > > > if (master < slave) > > swap(master, slave); > > - if (slave < factor || master < slave * factor) > > + if ((slave < factor && master < (factor>>1)*factor) || master < slave * factor) > > So, the check like this include the above range: > > if ((slave < factor && master < slave * factor) || > master < slave * factor) > > That "factor>>1" filter some. > > If "slave < factor" is true and "master < (factor>>1)*factor" is false, > then we check "master < slave * factor".(This is one path added by the > check "&& master < (factor>>1)*factor"). > In the latter check "slave < factor" must be true, the result of this > check depend on slave in the range [factor, factor>>1] if there is possibility > that "master < slave * factor". If slave in [factor>>1, 0], the check of > "master < slave * factor" is absolutly false and this can be filtered if > we use a variable to load the result of master < (factor>>1)*factor. > > My random random inputs and continue confusing to move on. > I'm not sure what point you're trying to make. -- Mel Gorman SUSE Labs