Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp902619rdb; Tue, 30 Jan 2024 01:57:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IF9rzBG49yh6P7PaslQGiZJ4DvK4e+/KMd9C0GzgRzAk1owSbhWrC5IsCHtCVaj1DMHMLu8 X-Received: by 2002:a05:6359:6d83:b0:176:5e4:cb8d with SMTP id tg3-20020a0563596d8300b0017605e4cb8dmr4077516rwb.51.1706608651276; Tue, 30 Jan 2024 01:57:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706608651; cv=pass; d=google.com; s=arc-20160816; b=vDU1KCAxytCl8LjQ8/MoSNlka7uv9F3zkfIA+wmC3cNbYuJs7cXbOH16cXSVLTj8xm U2ZlWFkb/AOD1Yw/pUSUmUzkaSZBgSjQvoQnrWJ2T/GMDNO/YzsmbzULMqlNFuIpbBZA eA4E7++iHduOXjoO31bhB4MlESIkEz+4+eAPJ+8qNHkIKXLw7WiO8VpPY46R74Z2uoM6 GJL8u//C0y5a1PXlV+Um2FVgqsW2yBlgdod/BXGqRyhDhOszdFQY3wEcfL8VUm82OH8h gu0Xd5O+x0YWH6AZCMdBxF/hjg8Bt0dd82O21MC590wNM9uwzoz8i77ahcNAQPdwkBi/ WLFg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=rk9FqAfnyxQRqiMY/FDbYczS/XhnGrLCQVOaYWAXTPo=; fh=+A0GmFirYIbPS/9SCl792WeIi1GwMHYE3feg/8CXj4c=; b=QM0T7nhvKs4XBv/D3m2q8MQJpCbis7/4f39WVHPau/4+1pXjG2K0iwFznko9tVoyT/ DljSKoH33UkbfHJKMaTAdDfSNNQ183j2c4HN87/TttqR06czLH5lzTRiqK/fumJGxn2r sBZoX/+zv/Wkd/y1ZWWzAIsFa33aewT7yGucE44Rw4jbDTn13nbylVJW+JgTnkRw/8pa stcXOSQxIHaq4pwfTnm6m1poW581RMHRN7ySIdHg2CjMwWj7VYCa5sC97GVdM3MK14Mu rRTTQlwQBcD3sXUAhBXA0SQ0H/WzENgioxdZ0Zy+FubaT+gAy77gvuZGkHsfKKDT1pDM fIvg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b7tyjvqF; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-44285-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44285-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id l186-20020a6391c3000000b005cdc5c9d6a2si7115899pge.576.2024.01.30.01.57.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 01:57:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44285-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b7tyjvqF; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-44285-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44285-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id C24C1294265 for ; Tue, 30 Jan 2024 09:42:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6C88F60DF9; Tue, 30 Jan 2024 09:42:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="b7tyjvqF" Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com [209.85.210.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F227059B4E for ; Tue, 30 Jan 2024 09:42:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706607724; cv=none; b=ufl29aPloMfQoV8cA2fdlnCkvxBjurJd1nJ3ldbq4LMBgnuhctenpjgOaIbxeWmLtt+OLAILZX0IF/I69XEb13yn1wsJfE8qLEst3KAOZppT9uKQ8+ukWxqqtTCAc9MfW2Jo+3xqmOfu//jSekq3AnYBajYl92i5zpfl/XFO0Pw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706607724; c=relaxed/simple; bh=1akIZWOlcQz+syP6eJskDVtQ9hEJTF7i2yELwffJV9s=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=ngecqcx4Law8L3j2D4IX5HUg4j9a7HnpzBqUHeTw0SFPLzW6pAEnUO/80hM2LzKqbzflG0BLES07Qzxs1lUV3ri3fdaSUV7533VX3b1d2vmfjvS1ZL4UW5PkfmGkg1A0fzf2sCNrUrp1qY74UyB92nF7vrxB0H/EijohjYHJvP0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=b7tyjvqF; arc=none smtp.client-ip=209.85.210.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ot1-f41.google.com with SMTP id 46e09a7af769-6e132fef7baso689139a34.3 for ; Tue, 30 Jan 2024 01:42:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706607722; x=1707212522; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=rk9FqAfnyxQRqiMY/FDbYczS/XhnGrLCQVOaYWAXTPo=; b=b7tyjvqFWrK9u+IEahyXrteOTwYngvzn19NLvnyZhEC43kaE3Ys7yZTMYIBuzXLYW9 4ZL4dPALnjrkTnLMUNnqzqXH5bBFLUQZjxR9nqYkEW72NpAcU+TI3HmrMo/VsTNRrz/p 8M6tiaDTAMBcwXGiuesXIYfNmQEl4TZHbS7BDItkSXP6y+WNApNTzpzGoIlIWmmmRrkg uZJR1ha74mzrR6c2bw08fRfo4xawveSD+ZHQLmBgdeBQCTNhh1Zs12SH1ThCMLmMTqyK SYSWTQ23M5a56xqLPwIgV+Db9lmRMrDqHX/NbXBOScKPdCZNS3NCpk+YSuC3IbrWltVe zJiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706607722; x=1707212522; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rk9FqAfnyxQRqiMY/FDbYczS/XhnGrLCQVOaYWAXTPo=; b=r5Px/biwLqBQeM/21PwPvO1ad/CKItXhFNVS2UY/U5ZX0VEZTik8P4TiZx8++Eqq2J 3AdRBBHf6OhoXB3Z87dWVTUh/OslokwtZftuqifzRcMvQUGg7/p/ed94d7w9UUHVaQ1y 7WyKKasaBwJZzzi7JSMpxVpXaw2ejoS1CMmnRIkZVnziJB45PNgEGzPgzGhxG38+QK47 bTrrVHuaA0u3g4RUIv6+CHqIJFlC/XgRynYrXFF4J8JTndSR1bHiCjjGa90U9qPoWQH7 vgztlkesOndLiytcYCQ6DLAuusu9VhBBIm/xahocXf+ldGzxd6SuXiCx3hpjtyHwTNSY ggLA== X-Gm-Message-State: AOJu0YzSFDCwf2riEXM1+HdNZgGp2JVvP7+4K40+tTgiXAGGHotfjlL2 brCJ7M2Ur5FUppT5mWI0wnyNgaFC/8pDzfGMkl3jW+Se/0lHe/q4BatX2gUKvTwpdDWKrKRO1zR 5siJAP+0mXWLTMmmLCa1IOsSn0becMljGrctctbfDKZJ0XI9F X-Received: by 2002:a05:6808:ec1:b0:3bd:9a58:c6e3 with SMTP id q1-20020a0568080ec100b003bd9a58c6e3mr6908381oiv.52.1706607722045; Tue, 30 Jan 2024 01:42:02 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240105222014.1025040-1-qyousef@layalina.io> <20240105222014.1025040-2-qyousef@layalina.io> <20240124222959.ikwnbxkcjaxuiqp2@airbuntu> <20240126014602.wdcro3ajffpna4fp@airbuntu> <20240128235005.txztdbdq2obyi4n6@airbuntu> In-Reply-To: <20240128235005.txztdbdq2obyi4n6@airbuntu> From: Vincent Guittot Date: Tue, 30 Jan 2024 10:41:50 +0100 Message-ID: Subject: Re: [PATCH v4 1/2] sched/fair: Check a task has a fitting cpu when updating misfit To: Qais Yousef Cc: Ingo Molnar , Peter Zijlstra , Dietmar Eggemann , linux-kernel@vger.kernel.org, Pierre Gondois Content-Type: text/plain; charset="UTF-8" On Mon, 29 Jan 2024 at 00:50, Qais Yousef wrote: > > On 01/26/24 15:08, Vincent Guittot wrote: > > > > TBH I had a bit of confirmation bias that this is a problem based on the fix > > > (0ae78eec8aa6) that we had in the past. So on verification I looked at > > > balance_interval and this reproducer which is a not the same as the original > > > one and it might be exposing another problem and I didn't think twice about it. > > > > I checked the behavior more deeply and I confirm that I don't see > > improvement for the use case described above. I would say that it's > > even worse as I can see some runs where the task stays on little > > whereas a big core has been added in the affinity. Having in mind that > > my system is pretty idle which means that there is almost no other > > reason to trigger an ilb than the misfit task, the change in > > check_misfit_status() is probably the reason for never kicking an ilb > > for such case > > It seems I reproduced another problem while trying to reproduce the original > issue, eh. > > I did dig more and from what I see the issue is that the rd->overload is not > being set correctly. Which I believe what causes the delays (see attached > picture how rd.overloaded is 0 with some spikes). Only when CPU7 > newidle_balance() coincided with rd->overload being 1 that the migration > happens. With the below hack I can see that rd->overload is 1 all the time But here you rely on another activity happening in CPU7 whereas the misfit should trigger by itself the load balance and not expect another task waking up then sleeping on cpu7 to trigger a newidle balance. We want a normal idle load balance not a newidle_balance > (even after the move as we still trigger a misfit on the big CPU). With my > patch only rd->overload is set to 1 (because of this task) only for a short > period after we change affinity. > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index df348aa55d3c..86069fe527f9 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -9707,8 +9707,8 @@ static inline void update_sg_lb_stats(struct lb_env *env, > continue; > } > > - if (local_group) > - continue; > + /* if (local_group) */ > + /* continue; */ > > if (env->sd->flags & SD_ASYM_CPUCAPACITY) { > /* Check for a misfit task on the cpu */ > > I am not sure what the right fix is, but it seems this condition is required > for the 2nd leg of this if condition when we compare with load? I don't think > we should skip the misfit check. > > > Thanks > > -- > Qais Yousef