Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp432427rdd; Tue, 9 Jan 2024 08:25:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IGzweAx5MiVVP4Hl/HlS0rIZ/L39e71EXel8LeEzlyHtPJmczchW1r+47/sSSwKcHI+c8As X-Received: by 2002:a17:903:22c3:b0:1d5:6903:ea1b with SMTP id y3-20020a17090322c300b001d56903ea1bmr370228plg.115.1704817508986; Tue, 09 Jan 2024 08:25:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704817508; cv=none; d=google.com; s=arc-20160816; b=YyTtksIRcKgbq8vgf5qPUbOhC1cjJlaub2dHcdHs+K1xkYx6vTCtEhRjgv368X3mH0 ijUmiR2U0F0UdPjM+O8KfOAYydUpX4uChNd6H+ptI0BI75GWw8Jg912lfBnYWHVqwwOM mXWxvNuCt67rXi8qUeMi1E8UpT8d9DaPsiozTDtEz4birXCkyKLuO4vlnfPIsAwQonMz 4qK/P+Gp4MHNxVlvnvUsxvDxxxIdXVHteIJTFe3wS3e3hDNqFO+Oocee0m19xzbBbBuy h5cnlz+i37f0h4jUOoWoOXbhdZCDKQ5zqig265M2GGpIaLrwWWqNPQJJ14xyyy3p301p rRvQ== ARC-Message-Signature: i=1; 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:dkim-signature :dkim-signature:from; bh=4sPxQXsPwMGRnsJMVOvt5uZA2z5eZqKsE+6J2lvab6g=; fh=4ktiobILTt4As5ohkto90YJxVjQVOrwRVGDWzAI+1dQ=; b=Tme8puN7dR0wPyBn3wW4Hd+6WK5XWNwBAV4sfCNLoDyY/6G3KbDkou+5Iz8evrk8oN lYXbkM8h5BI747NOsR6wbJNdM0DuHPAvQAZfM/w/bH7fUoayxcutnqdwGb28tu7zSWz8 BiAitJvgvztwJMTz3cy8IWrpdKpZTiE18J3Yenm2ZQRJ0qvHpEqOYRQTUZQ33WYDlODz fuliAVaozSafNT3dV+5X51LLnAevzqc9ptZ2lcpXe3MMHHWDbjjgZgHV2uucbn03PsSB nWGm7Kc4EkkHTFgjeW2bpHNcR5WGga4mdqBtGwynon1FPO6No1irf3p0+OB9FxuhSsK0 8sGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=MYtLMoje; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel+bounces-21105-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21105-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id jb11-20020a170903258b00b001d06d47c3c8si1693627plb.299.2024.01.09.08.25.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 08:25:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-21105-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=MYtLMoje; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel+bounces-21105-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21105-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 21119B22C73 for ; Tue, 9 Jan 2024 16:24:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 06BFE3A1D4; Tue, 9 Jan 2024 16:24:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="MYtLMoje"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="AdjjLHSO" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 692CA3A1C2 for ; Tue, 9 Jan 2024 16:24:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1704817466; 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=4sPxQXsPwMGRnsJMVOvt5uZA2z5eZqKsE+6J2lvab6g=; b=MYtLMojean2C8YqYfN0j9CwAUASdiL/eVoT+R597ICHkkYYM1L+bJy48YDz56epZ15G+Ei WsBps2EGGP5jW1PS3RaxsZ6eKXWQTfRRoig+fM9MZSrtxgP9zWp7PJP/21LSw6SRqW/ip5 ybA5PaZ4Wtoja1W4KRtW8lDi4oj16cQIPwhynNxWBlT1Wbd4kVGurHoR07cqPwpq3m/iMb Ve2lXMx4hduZYPYxgfOWwalvnCpYY9dQHWHmSJF6n93zuLtJsQd8V0n+A+DMNDLyBMX0rL BbRMj3zrjKRtJ5anWDJM/nJZXMcf3ogfd53NXWS9ECc9F4fo9OTurr4kURnXAw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1704817466; 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=4sPxQXsPwMGRnsJMVOvt5uZA2z5eZqKsE+6J2lvab6g=; b=AdjjLHSOsVZpSUrwYadwe+4Y/6f/WRCgNBKwDai2o00fg77jf5dI3APy3n+IxvAqHW2bjZ 7CB7z3nxZXQT2XAw== To: Pierre Gondois , linux-kernel@vger.kernel.org Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Thomas Gleixner Subject: Re: [PATCH] sched/idle: Prevent stopping the tick when there is no cpuidle driver In-Reply-To: References: <20231215130501.24542-1-anna-maria@linutronix.de> Date: Tue, 09 Jan 2024 17:24:26 +0100 Message-ID: <87ttnmiif9.fsf@somnus> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Hello Pierre, Pierre Gondois writes: > Hello Anna-Maria, > > On 12/15/23 14:05, Anna-Maria Behnsen wrote: >> When there is no cpuidle driver, the system tries to stop the tick even if >> the system is fully loaded. But stopping the tick is not for free and it >> decreases performance on a fully loaded system. As there is no (cpuidle) >> framework which brings CPU in a power saving state when nothing needs to be >> done, there is also no power saving benefit when stopping the tick. > > Just in case is wasn't taken into consideration: > - > Stopping the tick isn't free on a busy system, but it should also cost > something to regularly handle ticks on each CPU of an idle system. > > FWIU, disabling the ticks also allows to add a CPU to the 'nohz.idle_cpus_mask' > mask, which helps the idle load balancer picking an idle CPU to do load > balancing for all the idle CPUs (cf. kick_ilb()). > > It seems better to do one periodic balancing for all the idle CPUs rather > than periodically waking-up all CPUs to try to balance. > > - > I would have assumed that if the system was fully loaded, ticks would > not be stopped, or maybe I misunderstood the case. > I assume the wake-up latency would be improved if the tick doesn't > have to be re-setup again. > Your answer confuses me a little... When there is a cpuidle driver, trying to stop the tick is not done unconditionally. It is only done when the CPU is in a state that it could go into a deeper C sleep - this is decided by cpuidle driver/governor. When there is no cpuidle driver, there is no instance which could bring the CPU into a deeper C state. But at the moment the code does unconditionally try to stop the tick. So the aim of the patch is to remove this unconditional stop of the tick. And NOHZ is independant on the cpuidle infrastructure. But when there is no cpuidle driver, it doesn't makes sense to use then also NOHZ. Thanks, Anna-Maria