Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp4386206pxy; Tue, 27 Apr 2021 03:58:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwK5UIv1DMTKVLoVuvpbF1ZRsYFmTu9+hlNnx6P2wjO8U92kJoRi50CYjjuVTBg+UMrXG82 X-Received: by 2002:a50:ec83:: with SMTP id e3mr3529263edr.113.1619521122715; Tue, 27 Apr 2021 03:58:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619521122; cv=none; d=google.com; s=arc-20160816; b=OMkKlVSyka6C8Rpfw4kfGBHGhAWep46jXjA3I+B8kl9CV7VWMQCD0tb5K4pVZ10Qva AObckMZ7Xx3rdA/R+rxE8ExILvKJcH2Hsto466Dnq533sVoMbqr/AGxp8xn8liNDbciL AEagIlHJ1D6LTw0tSwkfti5SfY2T+UB7RATFNLCk8DdKUeVL0VzXxDCDwf2GWNIvXUn9 8PlKqXNwHrxDisGew9XKSfzG3HUppPvjIKdM9ul+QtMP3DLjxoae6fbJbMADxz903LrR 3tMa2OhnpQRWOq6BgCdD6EyPSH/UZSspoPP25iOvmKKAwOPDVemEDN3EPI7mu7Kqf5Zo SJDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=S82r8jx5k9d+bfs4UuyuPxKItqibi9UQtep8XqfhYv4=; b=HjpSmy4wMAIqDucfApIWLpgz0mP01F7HY58XjhU1bI1iIRWlTgVI3aEHFEwuixWDoo fs6Zo56hmjw+1jjd21S/Yw+7jjzJE/5H3MEI2Sn3eG7und0lpv+ToarGkEMNEWHABAEE ds2qQ3XLi9w5bXBN3hppwFYszdaCUYUnlniVvofKhWCE3JEXQTXzBDh6XKgNFm2I3eM7 Ul+/oyoIzJxc2VvOH12liRNn1kgd49DySKR9VQHISyOn5KSdx2v9PIugEvG3ZA8xnUQ1 2RcCbA1Qisdj4LMvkIUCK/Ne48rUATTpvFAlI7UY+dN/xhVpZqQFvX7zKhvbDuRlUIJ1 vVhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=itJy1ugZ; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f19si2172379eds.552.2021.04.27.03.58.19; Tue, 27 Apr 2021 03:58:42 -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; dkim=pass header.i=@linaro.org header.s=google header.b=itJy1ugZ; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235600AbhD0K4n (ORCPT + 99 others); Tue, 27 Apr 2021 06:56:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230341AbhD0K4m (ORCPT ); Tue, 27 Apr 2021 06:56:42 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4896CC061574 for ; Tue, 27 Apr 2021 03:55:58 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id w9so9158490lfr.12 for ; Tue, 27 Apr 2021 03:55:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=S82r8jx5k9d+bfs4UuyuPxKItqibi9UQtep8XqfhYv4=; b=itJy1ugZD6GY7AOr/xYufPZq/gR/mFIsdnZCRMF2UuJWl3j1THE6ki08H1rvM3F8k8 kICTmi5ZBp2qejTvXlH0E1JXk2Iq/cfq2gxxNpi+z5wJv5921gi9KOW76tTdRtAEPvF1 rn4oA7GFo0V35hCDqX7kJAOmoCZFm2MFhLsd4wrRVEGgzOlecF949Ra0KBCu1H7t5mOj wB4u2jFf+IK0PfUus2BmkY19uLh1692l35TpMOoUpfjpPmemUXgOXORzVyA+zxVTxP0u isvH4NXN0vwrLbiosZ8dkd7cU5oekLBc+U44FXf9TuK57DxT/lGI3SMif0vke0zMzrYz WB9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=S82r8jx5k9d+bfs4UuyuPxKItqibi9UQtep8XqfhYv4=; b=o+/1wHZoDWd/M7vKKBWIDJVklsCzGlVHWt2dc6JmiIbR55sKUQJoRPksV5AZzoxJjG N/tCEhfWGyqaaxjqzigYY5B5JqY6KIpDjxKsy5mVpWsdULwMfxSaV4pNQ2JqJw+CPp2N aDGKkE8LlYR6TNVshSzsjDvDpwhKdspW9Duu6eRU/n7AOOVmuLcRbxQrSmz9ETIBLjMR IEx2y80bRz5Re6FAGGt13tAfigoDoI4e+U3g6gJAxRlMIZAhc/kSSnKelwVdS1Yr71aX 8hAFvxmVc+DQo69oK47cmKyl29A/gnQ+cuR78W13rd4m7jqlRbyrF2chvDFBLbf5IRN4 pjDA== X-Gm-Message-State: AOAM532orfpYQ7wpIC5eaagg+0odX3RgE+mHQZilusZS0igzFmH7OWIE fpCPZ39WRqgDxYMWpWQB9Ur6OWf+HFYNe+WPUKmcKg== X-Received: by 2002:a19:4f1a:: with SMTP id d26mr16477813lfb.277.1619520955821; Tue, 27 Apr 2021 03:55:55 -0700 (PDT) MIME-Version: 1.0 References: <20210425080902.11854-1-odin@uged.al> In-Reply-To: From: Vincent Guittot Date: Tue, 27 Apr 2021 12:55:44 +0200 Message-ID: Subject: Re: [PATCH 0/1] sched/fair: Fix unfairness caused by missing load decay To: Odin Ugedal Cc: Odin Ugedal , Ingo Molnar , Peter Zijlstra , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , "open list:CONTROL GROUP (CGROUP)" , linux-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 26 Apr 2021 at 18:33, Odin Ugedal wrote: > > Hi, > > > > Have you been able to reproduce this on mainline ? > > Yes. I have been debugging and testing with v5.12-rc8. After I found > the suspected > commit in ~v4.8, I compiled both the v4.4.267 and v4.9.267, and was able to > successfully reproduce it on v4.9.267 and not on v4.4.267. It is also > reproducible > on 5.11.16-arch1-1 that my distro ships, and it is reproducible on all > the machines > I have tested. > > > When running the script below on v5.12, I'm not able to reproduce your problem > > v5.12 is pretty fresh, so I have not tested on anything before v5.12-rc8. I did > compile v5.12.0 now, and I am able to reproduce it there as well. I wanted to say one v5.12-rcX version to make sure this is still a valid problem on latest version > > Which version did you try (the one for cgroup v1 or v2)? And/or did you try > to run the inspection bpftrace script? If you tested the cg v1 > version, it will often > end up at 50/50, 51/49 etc., and sometimes 60/40+-, making it hard to > verify without inspection. I tried cgroup v1 and v2 but not the bpf script > > I have attached a version of the "sub cgroup" example for cgroup v1, > that also force > the process to start on cpu 1 (CPU_ME), and sends it over to cpu 0 > (CPU) after attaching > to the new cgroup. That will make it evident each time. This example should also > always end up with 50/50 per stress process, but "always" ends up more > like 99/1. > > Can you confirm if you are able to reproduce with this version? I confirm that I can see a ratio of 4ms vs 204ms running time with the patch below. But when I look more deeply in my trace (I have instrumented the code), it seems that the 2 stress-ng don't belong to the same cgroup but remained in cg-1 and cg-2 which explains such running time difference. So your script doesn't reproduce the bug you want to highlight. That being said, I can also see a diff between the contrib of the cpu0 in the tg_load. I'm going to look further > > --- bash start > CGROUP_CPU=/sys/fs/cgroup/cpu/slice > CGROUP_CPUSET=/sys/fs/cgroup/cpuset/slice > CGROUP_CPUSET_ME=/sys/fs/cgroup/cpuset/me > CPU=0 > CPU_ME=1 > > function run_sandbox { > local CG_CPUSET="$1" > local CG_CPU="$2" > local INNER_SHARES="$3" > local CMD="$4" > > local PIPE="$(mktemp -u)" > mkfifo "$PIPE" > sh -c "read < $PIPE ; exec $CMD" & > local TASK="$!" > sleep .1 > mkdir -p "$CG_CPUSET" > mkdir -p "$CG_CPU"/sub > tee "$CG_CPU"/sub/cgroup.procs <<< "$TASK" > tee "$CG_CPU"/sub/cpu.shares <<< "$INNER_SHARES" > > tee "$CG_CPUSET"/cgroup.procs <<< "$TASK" > > tee "$PIPE" <<< sandox_done > rm "$PIPE" > } > > mkdir -p "$CGROUP_CPU" > mkdir -p "$CGROUP_CPUSET" > mkdir -p "$CGROUP_CPUSET_ME" > > tee "$CGROUP_CPUSET"/cpuset.cpus <<< "$CPU" > tee "$CGROUP_CPUSET"/cpuset.mems <<< "$CPU" > > tee "$CGROUP_CPUSET_ME"/cpuset.cpus <<< "$CPU_ME" > echo $$ | tee "$CGROUP_CPUSET_ME"/cgroup.procs > > run_sandbox "$CGROUP_CPUSET" "$CGROUP_CPU/cg-1" 50000 "stress --cpu 1" > run_sandbox "$CGROUP_CPUSET" "$CGROUP_CPU/cg-2" 2 "stress --cpu 1" > > read # click enter to cleanup and stop all stress procs > killall stress > sleep .2 > rmdir /sys/fs/cgroup/cpuset/slice/ > rmdir /sys/fs/cgroup/cpu/slice/{cg-{1,2}{/sub,},} > --- bash end > > > Thanks > Odin