Received: by 2002:ab2:7a09:0:b0:1f8:46dc:890e with SMTP id k9csp138560lqo; Wed, 15 May 2024 09:41:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUJGzhudy6PTQkbDoJykAhbXhaJEF1EO5Iq/npSobjgItjzlqOhXIWTmXgLY/Vz2Ogyc66cUuKue3h+bK01QmvpOoJ2+e+icKiSzUBC+g== X-Google-Smtp-Source: AGHT+IGh/Z6kJbizn08y3PhDKQ7ZiqAsWvKo4pTepB1xqvi8jbpFyAUIBs5md1Vy9CvGf4MjH7Ec X-Received: by 2002:a05:6a21:18c:b0:1af:8a3a:35d7 with SMTP id adf61e73a8af0-1afde1b6ec5mr15796733637.39.1715791312586; Wed, 15 May 2024 09:41:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715791312; cv=pass; d=google.com; s=arc-20160816; b=QQ4deWanbWwHNugQlCyisTFvYTOV6xrHY8l7Mpt+yMafalud18KYA0lzWbirnTcy2c Wq3VjeV0XqN5GglvuRX6lQ0fK0dS+fCUz8gcsrrUGqB2tTl/FLLtpsSjWu6gmOSpDIkI I+zfyqW1hIngNecs3AtfWlR/B/iZzccoo5/zXJPNNvX15mDSHs4PLi1FsOSabwIy5PoV ISLcJfUkzJZI//v9orCTknD90Rb95lbqocCl1AL76FqQO9u8b4kL474/+SxfacxUBFfJ 2TirLNy4C5L6nflG0S9+VuapXnDnAtDIjRs38K+ADlYJ/s8ZDnPtz05QvsyeCiLIZjhi M3ww== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=kwNT8ZL+ZrmeX5xZd+8ZhxRRmnXUR/OD21AGVm6ajjg=; fh=LURa6p5WqaFgsuYxxX/oHLm+Fp5gTqcq3x38/9dFCls=; b=DNdt1iL+4UxCKsbpQa2qtXU/BKkL1Sn45zLOiQv8Sozg7VVHHQJF9M5pSNEow0OTo7 0vHbJuDLac5jHQYJUQwbQ18qtdJ8TJ+3Rt/l9AqniffyllaK/8De+gYK2bh6W87zU4sX X9AFSVI5CpmVDNH/McMx7yLykGW68iygDIy5qvGWmk9N62qzFqgyj0FdVZlPfrOMCBn/ bXUEFwcONEjXz9RZlJm/HJjsm9Pe23vdkQjgHoR8A24ZX9onCejh7k3g1leifOskH3wv AlVIaDxCBYbUGswpvfHN65K7K26bVXE/jQaLGr3jzEL5oE1A0MXUN7NC1uWueZcmK8nv yDtA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iShIHz4P; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-180155-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180155-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-63409e818ddsi14109219a12.18.2024.05.15.09.41.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 09:41:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180155-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=@gmail.com header.s=20230601 header.b=iShIHz4P; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-180155-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180155-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 385E1284AB2 for ; Wed, 15 May 2024 16:41:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2A51D208C1; Wed, 15 May 2024 16:41:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iShIHz4P" Received: from mail-yw1-f171.google.com (mail-yw1-f171.google.com [209.85.128.171]) (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 E95C823776 for ; Wed, 15 May 2024 16:41:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715791307; cv=none; b=dIQfGZVcIKRVrrDdw0Zx+mXK+T+1JiqGA8FtOWG9+NgRrLSyRXaTzrmSWXb+DNfJ1XzgUIZpHyxpL7vDmJ9ZGGKf7g2pi7Pgz+6VGSefbBPYURT5qnrSfaR2dqZ3mnVYwV2EoEL0bY84WBpgaht2erbAzeJBZPPZyaNS3jLk6Gg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715791307; c=relaxed/simple; bh=epqSKX0tx62SmV+sXmr4kmPKa2bRIzghg2ir2HWmSG0=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=K5jWGBMHT2vtytGX0qwgtD1dKhsukUPmSk7YqwkGDyQ3+yJUqd1oKXHr/j1kwlbwx0jUxac6CXRR7760HjsHMgo+o+s9WnvrTAfGOU1uXYzYaJYpRhUJaAyc7BNkhxrZpuQhMyBdRX+I0B7A4XkIMqD1sIQWp9kvFDjv+k0fkeM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=iShIHz4P; arc=none smtp.client-ip=209.85.128.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yw1-f171.google.com with SMTP id 00721157ae682-61b4cbb8834so71486737b3.0 for ; Wed, 15 May 2024 09:41:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715791305; x=1716396105; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=kwNT8ZL+ZrmeX5xZd+8ZhxRRmnXUR/OD21AGVm6ajjg=; b=iShIHz4P6DdCcCe3S6Qc751t3bircSWY8MgIwW2Rw0Qqy7O+K049zUVjKQUoa5bD22 +a5KMw3vscIwUguAYGteOidpNqbvwClySo+P3FF24FMvs1094moHljbMcN0ax50zjeRa Y/AQLt1IscJA/pDDsFRWjIa+Ou2ObDnfY3gNzZXjXvoeM1+QxuQfgg2lNnlf5iGFcgC/ tkq0hLoXj+0etXelnL7y+6ltSRFHHYX7+c45PTV0WmIH4ZWCxodrKOdKnBRgv1lhDhOB I7YWpAo0QIDIE4SrKy3ur8wuyF5NwWXUdKp7cApxkijPtpS7M/5ytAtjrB1oTmeTlu1H LSTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715791305; x=1716396105; h=content-transfer-encoding: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=kwNT8ZL+ZrmeX5xZd+8ZhxRRmnXUR/OD21AGVm6ajjg=; b=g1U4y1CHXS2Co/k7FusFXWrEj/MdI0grycQREI3Shfjo6qarebBCq8oAIie9jsJVVf bAs+67IuUdPwoRaNFq7MCcr8j6bcVUzVp8Ge1VvtYgz/8xoBbtFeT/97gNIHMXLsGpB7 MVBBbYzJsOjniNtFUbEnIrK/mxNAmZ0ARDrrATKU2SNgR+V7NZNfmkaqrAEWHuWNMBOx DysIr4dSSUlLbijkVChujRpf/dHPmVlUvN5TgPIdpM8H3wtYqogHwIcdSWsvme448PkU gaVZauY6ozL9dBaNEUhgjaWKXVEBKgBg45/cZvf/FTDsCjaJIJ97Z1IwwDvUbz9qCC5A XD4A== X-Gm-Message-State: AOJu0YwRQYkl197tfnRJvOaEnVAIIzJGTdDyRTJ20f5RlK3SCYzEKPb/ jx7fdKC7al0CfDW/y7IYXyAGnnbpJxG+7aAFCrQRmqew5WEM4EbDbkLCqoajjDOB/CFUi/SbAWs UoZMeMxb+ExJXpn3MMeAkBbtJwmTEbA== X-Received: by 2002:a81:ac21:0:b0:61b:16d9:47cd with SMTP id 00721157ae682-622aff90091mr157557587b3.11.1715791304773; Wed, 15 May 2024 09:41:44 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240508172621.30069-1-ppbuk5246@gmail.com> <20240509092931.35209-2-ppbuk5246@gmail.com> In-Reply-To: <20240509092931.35209-2-ppbuk5246@gmail.com> From: Yun Levi Date: Wed, 15 May 2024 17:41:33 +0100 Message-ID: Subject: Re: [PATCH v4] time/tick-sched: idle load balancing when nohz_full cpu becomes idle. To: anna-maria@linutronix.de, frederic@kernel.org, mingo@kernel.org, tglx@linutronix.de, Markus.Elfring@web.de Cc: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Gentle ping..? Am I missing something? Thanks. On Thu, May 9, 2024 at 10:29=E2=80=AFAM Levi Yun wrot= e: > > When nohz_full CPU stops tick in tick_nohz_irq_exit(), > It wouldn't be chosen to perform idle load balancing because it doesn't > call nohz_balance_enter_idle() in tick_nohz_idle_stop_tick() when it > becomes idle. > > Formerly, __tick_nohz_idle_enter() is called in both > tick_nohz_irq_exit() and in do_idle(). > That's why commit a0db971e4eb6 ("nohz: Move idle balancer registration > to the idle path") prevents nohz_full cpu which isn't yet > idle state but tick is stopped from entering idle balance. > > However, this prevents nohz_full cpu which already stops tick from > entering idle balacne when this cpu really becomes idle state. > > Currently, tick_nohz_idle_stop_tick() is only called in idle state and > it calls nohz_balance_enter_idle(). this function tracks the CPU > which is part of nohz.idle_cpus_mask with rq->nohz_tick_stopped properly. > > Therefore, Change tick_nohz_idle_stop_tick() to call nohz_balance_enter_i= dle() > without checking !was_stopped so that nohz_full cpu can be chosen to > perform idle load balancing when it enters idle state. > > Fixes: a0db971e4eb6 ("nohz: Move idle balancer registration to the idle p= ath") > Signed-off-by: Levi Yun > --- > v4: > - Add fixes tags. > > v3: > - Rewording commit message. > > v2: > - Fix typos in commit message. > > kernel/time/tick-sched.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c > index 71a792cd8936..31a4cd89782f 100644 > --- a/kernel/time/tick-sched.c > +++ b/kernel/time/tick-sched.c > @@ -1228,8 +1228,10 @@ void tick_nohz_idle_stop_tick(void) > ts->idle_sleeps++; > ts->idle_expires =3D expires; > > - if (!was_stopped && tick_sched_flag_test(ts, TS_FLAG_STOP= PED)) { > - ts->idle_jiffies =3D ts->last_jiffies; > + if (tick_sched_flag_test(ts, TS_FLAG_STOPPED)) { > + if (!was_stopped) > + ts->idle_jiffies =3D ts->last_jiffies; > + > nohz_balance_enter_idle(cpu); > } > } else { > -- > 2.41.0