Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp299232pxh; Wed, 10 Nov 2021 01:55:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJzx+pzqo4WZIYlyw0r6QfXn4O9Kw5udQ/FvnTmSkF8MFtmVrCDZm8hwqRLvIZrfskpDtY4f X-Received: by 2002:a6b:d20f:: with SMTP id q15mr9352926iob.39.1636538132935; Wed, 10 Nov 2021 01:55:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636538132; cv=none; d=google.com; s=arc-20160816; b=P+ZS4ZlroPMyxwmB028S5O2HE7+wnaLtY8ruU4QEiI7OJtUgHNmMSVKq2IYUGG+i/7 MOhV8cve40VYJUWo4hXqqEQwJzUHbER38z+jkKZTgifX7/+i9X2uns/TiZnnfhnL539R 1nuPRh3bqseKf9PO4LNNYsl2xyfOeV6uVaWr7Q9M3MH3hBL/1UIuWcnzd/ujCLzPRLjb HtTtrqWyoa/mg99bXeDOtgfRwOCjftdjYII42sykSav7gjFbU+oLLzFGiXJe29wrCRM6 LnlByIWcAr+IbdbWHXsXcvw9T2aJNfZaw+mGOTrvZMxvUGxxZpsKIlePfu+ldgKZejct THow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=ZUAU49u0de/GblU7PLi+j9y9Qvhf4Zz1YEtn3bAYdUU=; b=qA5F75cb/wtNfVWvW4N8ujLNy2lJn0uaO3R1nz2oGNFfHjqnjAdr0JJSsI5uI/m5Sz wzvCZkjyYLrawDep6gbJ14VCFRHIXi/EwicQvw1KinoZyHROEdX9JN1gICIqq/wyommn 2ex5WH0hwjtJOJEF7aCWobEXaBQiOI3mZGLIRLidwOY3e2zBCHR3Jt5Ocfz+GFctILFc ZqxHRjtj0NpKkwSEq6FvtEN3jSQele529T+kd6cOkJCSKUGM2eQqkvfnGYZFW7IkVdym UtisWzJMP+6ecuM7Yaa5z5mDNsaozOIRk9CrdnC/hJhHfVr5WXc/9q3MB9vVcP7Vcjw+ fn/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=pKkXSsrt; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d19si14919829iow.54.2021.11.10.01.55.19; Wed, 10 Nov 2021 01:55:32 -0800 (PST) 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; dkim=pass header.i=@linux.dev header.s=key1 header.b=pKkXSsrt; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230440AbhKJJzl (ORCPT + 99 others); Wed, 10 Nov 2021 04:55:41 -0500 Received: from out0.migadu.com ([94.23.1.103]:17010 "EHLO out0.migadu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229653AbhKJJzk (ORCPT ); Wed, 10 Nov 2021 04:55:40 -0500 Date: Wed, 10 Nov 2021 17:53:27 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1636537969; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZUAU49u0de/GblU7PLi+j9y9Qvhf4Zz1YEtn3bAYdUU=; b=pKkXSsrtOKd3UG3a0cvN77dBukGPHnt2oiQtUoTqR1nZISNvEIp3hbU34ih9mb9nIn2tn4 bdmBAElMC3KyJrl2r6yjZGpyrSKn+SNClPHO2HeQ7EmEerbiuqtqf62Vd+ivtyzTCkIGDp PdyqSOSB6N/ICiAaQcdefVbQC7xJa+0= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Tao Zhou To: Mel Gorman Cc: Peter Zijlstra , Ingo Molnar , Vincent Guittot , Valentin Schneider , Aubrey Li , Barry Song , Mike Galbraith , Srikar Dronamraju , LKML , Tao Zhou Subject: Re: [PATCH 1/2] sched/fair: Couple wakee flips with heavy wakers Message-ID: References: <20211028094834.1312-1-mgorman@techsingularity.net> <20211028094834.1312-2-mgorman@techsingularity.net> <20211029084219.GV3959@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211029084219.GV3959@techsingularity.net> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: tao.zhou@linux.dev Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 29, 2021 at 09:42:19AM +0100, Mel Gorman wrote: > 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. Ok, some days later even can not understand what my saying myself. After wrong and right aross with my wreck head I just try to make this: if ((slave < factor && master < (factor>>1)*factor) || (slave >= factor>>1) && master < slave * factor) check "slave > factor>>1" for filter the cases that is calculated if I am not wrong. If this have a little effect that will be to not need to do "master < slave * factor" for some time not sure.