Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp314548lqs; Tue, 5 Mar 2024 02:57:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWhuZLBX8g18vkimPQ46F3Anw+gfUBj7Z9Fs0cLaTOR+iN/oTizhiLL6sqP0kXubClIxWNcmXIp858ky4Xyim5kLm/GG+ZLP88Yh1Q1dA== X-Google-Smtp-Source: AGHT+IGVqyhp+oqR/NFBE8/raK+a6GoVD3ugI/IwbxVJYD0b5+VqpCmiRV1W7e1rhh6GCxlF5DCu X-Received: by 2002:a17:906:6ac7:b0:a44:9d77:a457 with SMTP id q7-20020a1709066ac700b00a449d77a457mr6845046ejs.19.1709636228094; Tue, 05 Mar 2024 02:57:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709636228; cv=pass; d=google.com; s=arc-20160816; b=qqgYKT0Kg6A+IE4m5njy6zVHP3b4Q3kHSuyVGaq/qicMAaQN0JhS5EEJpBug48lHzB bPle5mlyWPTREIjJWnB2Fvmeiub6F8IN2WhrtcMcISAull430kGZ62NgsyC1nQi7f2rT 0WTb23h3AonCp4A9uXGrSvE7tJcI934nZdUanZcXDrTsK1Xewg9Fy+toH6uAPkZ5fOG5 QdVoQ4iuDZhV5MTI/eqmsMcOYSGzpZr6N20SkF1uSISzbuwdVEsupC3BY5CmpL4Yu5wH E3I03DIzzHDXmYvtNGx1L/r65+yX8ulO8B629nZtX38F+5HLf5dgiOSuCVSNWd6ptsS7 EsxQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=STInnfJUgELKh4o3m/dGIlSNOSlQYa7DAEhtfW5fXSQ=; fh=MG8boEm5AuA5ssRSSTBoJ0ExYmeFnTFNYh5h+eOM5+o=; b=ysFf50o4fMMOglpuKD+x25CG+6JB7Gx6u1sT7uIi98CY+9ridMCFuaQWTNvBBURa6U UoCsAu+dOJKgYMLW+bk9/Gq5eDcCr5+BIUOIWvUMfw+4RVIH8xA3wWpQGBlQTu+uBAxH c+aF+/PkMOPoAZ6svBZDAJmol7bfSMw+cMsyecT/WAwMxmpKPZEkqmxmxD+M20EvVQDq kf9ExS7R9iRVYQpX9uxIOAUikbyFq0SJyRwd8sLN9Kp7YzUKWekEQ+a6nAtVw4yypgcR jX/qyr/FBQrghfT4DgBW2EqiuFwYN0J8c+AMeHJAe2hNzsujoRD8qc6gDVL4E4LkPv1q klyA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Fg6hWNLK; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-92183-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92183-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id si29-20020a170906cedd00b00a442639532esi4742540ejb.867.2024.03.05.02.57.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 02:57:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-92183-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Fg6hWNLK; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-92183-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92183-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 83E661F213A1 for ; Tue, 5 Mar 2024 10:57:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8D8875B20F; Tue, 5 Mar 2024 10:51:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Fg6hWNLK" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 35DB95A782 for ; Tue, 5 Mar 2024 10:50:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709635859; cv=none; b=aT92GAkGoyMmGuLJT74wwVsSYZoyCL9G7iIYFrhi4Lz8UB5+ekgqgfSb14SLO6b7RwTPWYex5OoXDEp2aL1AjLsqHd3mvGXiYZbhVfooqf2SJfJefeb3SmMroZPU+X+NQu3ioPztsoQkIShteTNc2Q/uf9B9pEQDyCJ4KuRPoUc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709635859; c=relaxed/simple; bh=4JbccXLVHkGwTjCOoatmizF0As7RMhlHeIAYb7I3OuU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=Cw2+RLL5GwBtfuOBchyenrFCaNiJ39rMP5MSg8PGdNdmWq978cbql95X5MzZ556vtvPaKmFdzEXsXkxfVs3EDjI4xoLSzbR5iqPuLH2mALKrHC5Ahp+k32Hf6wg4sxgaR3Gx796Nf89x9N0/NUE/6j1K0NiuuvnCAYd+J5rEI3Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Fg6hWNLK; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709635857; 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=STInnfJUgELKh4o3m/dGIlSNOSlQYa7DAEhtfW5fXSQ=; b=Fg6hWNLKygggN+PShVNnqmJcqgtHvsJz2wwoZ95EU3XUVtTzw3qJkvNRFaZAdXDr4rtUOi 8a58nJqPwBBEyGc6RNkgIjLRl8SRC+DAmOwV8p8+zrPO40gFrhbDUb+caYUtFwFkWdFWbJ irg4NJM31JcFz49xeA0t9xPn5Y0LxjQ= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-422-cebmtvkUPtW3jhwubnct0g-1; Tue, 05 Mar 2024 05:50:55 -0500 X-MC-Unique: cebmtvkUPtW3jhwubnct0g-1 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-69053d28753so58581076d6.3 for ; Tue, 05 Mar 2024 02:50:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709635854; x=1710240654; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=STInnfJUgELKh4o3m/dGIlSNOSlQYa7DAEhtfW5fXSQ=; b=b5E+hJp0qPFEQbYh4SjgrpkjGnPbYN8ERrq+nlgvNeIVjc3QVncVi4ao5UsaJRtJnU 48/xd2Vi9X1kzxynx8HX7HJQEWM7G0yYcoT0bObVqYXvTljkjpUAr/qQhO8fLUYKQJrM janqBwEBzdlqyymQOkH3cZLqLM4cWBsDfdk3fGk17lwpyoAVRfq0CjRjWUcOggAaTgTQ WWbaD6YZSvMDoyAj3AmROOmTcDpbwyEnMZCWbI53fIqAwxGBvyMGWc8UrmMqFS5lnn/V OVFcYdX8EHOJM+LUTcKBceKBRpC5V8AwCFYaXEpDXEGYoWPnm4RvjZOJCjpQfn08kYM+ 9o4Q== X-Forwarded-Encrypted: i=1; AJvYcCVjQgSB/artvYO0SSCeX1Yu6HH6UCefYGZrbdMU/ORY0C3SRJ3mbaJ0xEvQPiZP7hJOPErRk3/CoYWmgQOMK2+uGyLgcyTzwsBV3g7O X-Gm-Message-State: AOJu0YwcDiVWocuXDZp8NtRqiB3/HxURfyK+CVH5sq9chWVLs0xLVG4U vLsbG6T46xt3j0Q/1D7uPch0wZB3iNSO+vvJBEFBYDyXDfOvHvhiHZhfsuoX9ewdLkebnJZlU34 RClmU5tKugCQr7/Agxsxym8oBPvi6O8X1z3Cg2vvFS8EMVziIrfCs3FFZ6EqLUg== X-Received: by 2002:a05:6214:57ca:b0:690:8f12:b73f with SMTP id lw10-20020a05621457ca00b006908f12b73fmr143980qvb.35.1709635854758; Tue, 05 Mar 2024 02:50:54 -0800 (PST) X-Received: by 2002:a05:6214:57ca:b0:690:8f12:b73f with SMTP id lw10-20020a05621457ca00b006908f12b73fmr143970qvb.35.1709635854527; Tue, 05 Mar 2024 02:50:54 -0800 (PST) Received: from vschneid-thinkpadt14sgen2i.remote.csb (213-44-141-166.abo.bbox.fr. [213.44.141.166]) by smtp.gmail.com with ESMTPSA id lb27-20020a056214319b00b00690456832c8sm6065883qvb.29.2024.03.05.02.50.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 02:50:54 -0800 (PST) From: Valentin Schneider To: Ingo Molnar , linux-kernel@vger.kernel.org Cc: Shrikanth Hegde , Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Linus Torvalds Subject: Re: [PATCH 6/9] sched/balancing: Update run_rebalance_domains() comments In-Reply-To: <20240304094831.3639338-7-mingo@kernel.org> References: <20240304094831.3639338-1-mingo@kernel.org> <20240304094831.3639338-7-mingo@kernel.org> Date: Tue, 05 Mar 2024 11:50:51 +0100 Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On 04/03/24 10:48, Ingo Molnar wrote: > The first sentence of the comment explaining run_rebalance_domains() > is historic and not true anymore: > > * run_rebalance_domains is triggered when needed from the scheduler tick. > > ... contradicted/modified by the second sentence: > > * Also triggered for NOHZ idle balancing (with NOHZ_BALANCE_KICK set). > > Avoid that kind of confusion straight away and explain from what > places sched_balance_softirq() is triggered. > > Signed-off-by: Ingo Molnar > Cc: Peter Zijlstra > Cc: Vincent Guittot > Cc: Dietmar Eggemann > Cc: Linus Torvalds > Cc: Valentin Schneider > --- > kernel/sched/fair.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 4c46bffb6a7a..18b7d2999cff 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -12409,8 +12409,13 @@ static int newidle_balance(struct rq *this_rq, struct rq_flags *rf) > } > > /* > - * run_rebalance_domains is triggered when needed from the scheduler tick. > - * Also triggered for NOHZ idle balancing (with NOHZ_BALANCE_KICK set). > + * The run_rebalance_domains() softirq handler is triggered via SCHED_SOFTIRQ > + * from two places: > + * > + * - the scheduler_tick(), > + * > + * - from the SMP cross-call function nohz_csd_func(), > + * used by NOHZ idle balancing (with NOHZ_BALANCE_KICK set). Bit of a nit but the CSD is also triggered via the scheduler_tick(): scheduler_tick() `\ trigger_load_balance() `\ raise_softirq(SCHED_SOFTIRQ) scheduler_tick() `\ trigger_load_balance() `\ nohz_balance_kick() `\ kick_ilb() `\ smp_call_function_single_async(ilb_cpu, &cpu_rq(ilb_cpu)->nohz_csd); I got to the below which is still somewhat confusing, thoughts? """ The run_rebalance_domains() softirq handler is triggered via SCHED_SOFTIRQ from two places: - directly from trigger_load_balance() in scheduler_tick(), for periodic load balance - indirectly from kick_ilb() (invoked down the scheduler_tick() too), which issues an SMP cross-call to nohz_csd_func() which will itself raise the softirq, for NOHZ idle balancing. """ > */ > static __latent_entropy void run_rebalance_domains(struct softirq_action *h) > { > -- > 2.40.1