Received: by 2002:ab2:3b09:0:b0:1ed:14ea:9113 with SMTP id b9csp229058lqc; Thu, 29 Feb 2024 16:02:34 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU6iOW0Nmg3HzsL0lYlNJXfpmgjvvf1rLeKb3dWqrLklWqblSF38j82wfRZvMldzo9Ryg4D0bGv6011KAmM6VgEd7kU99yg1BVVgdooiA== X-Google-Smtp-Source: AGHT+IHYvBtUpt+e4cnn+aBU+ekqqyB5G6+KJLK4rdhx6Xh/9remljMDkP2Od6BOEhZjXVL+8wXK X-Received: by 2002:ac8:5e07:0:b0:42e:78c8:fa37 with SMTP id h7-20020ac85e07000000b0042e78c8fa37mr62343qtx.44.1709251353802; Thu, 29 Feb 2024 16:02:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709251353; cv=pass; d=google.com; s=arc-20160816; b=W1TLJGg3OUcRtM0aW+CPfs7hEOkELZuRbBEu3ZksbOnrWqfuogYeyrR7VyK4H/Nxpz j5c7z9xK9WHduuYKkW7+oB+mt8Fwa+nZ5HPLN/3pCxHgqu6N5/9pHhuLG/8/ufiKucYW CzfnmbVtGs53l61MDfhQhhHk1Morsknwkgsq2PRE37vk4ywVxaAq+DXeJaSs29zrNSoU cLn42+8CTOTDzg+ZzCepPx+p9GfUKPBzssXzxS3Z8t1k/8Nk5ZSNNFABiGTNtCZee9HX M9e76Sc9eoRwfKNnkAbKj97ftu1ZHPI1RPS1yg6F6iacqbTJB8lBLnYTGlm9rjVeKxuA 3qyA== 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:dkim-signature :dkim-signature:from; bh=SNLxnwnRr0Lnru2BqChvcZ/4Fhlb3GVJp1r6JvXa0JY=; fh=DoiprbnQTnarmmINeLfvdPS2WqzaU6mnLtE6Qm1Hic8=; b=FZ7bXsjNTOeq/3AFW0UgGb9KW1GYuJ4pr599dolCS2OgMlxSFGbtnl/5duFSUJ6aV1 H7bSJkWVVP2gLTzZ9nmygNTVTzF/eZ5srYm6+ivP6lqJ6lxb5kNKNpNx2qG1OkDpZy9q c9nCMl3YZDQ1essVxebM1J+locxOjiGNMuh3FAB8bQQqLHfsdJO1AXWkERNWBoSITtc+ R6ZG5eooXZeoW+EqwEG+NRHRjSOJ+cwoazUHnNWOFlxFfrLubnWQkfqx7W784IbcGzo4 ELW4yfRKBhLDo4K6jdv7d+e8kXWG81KJFPsCo+d6Np46JyEu86YJFcDaCwvbNUPAb85i aIzg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Sl2K9FRu; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-87715-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87715-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id k14-20020ac8474e000000b0042ec1d12873si1524251qtp.64.2024.02.29.16.02.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 16:02:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87715-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Sl2K9FRu; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-87715-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87715-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 478421C2109C for ; Fri, 1 Mar 2024 00:02:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EDC50186F; Fri, 1 Mar 2024 00:02:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Sl2K9FRu"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="UcJ+hhU2" 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 A583F7EC for ; Fri, 1 Mar 2024 00:02:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709251348; cv=none; b=pXPmtywafu+fYaYFmjdezNjMHcQLJDDkFyUblqi+4/IjEoo+67YPsyVCrsfgXJG+nrrawZa6kIegi/ZhdndHVUcZ52QEttIbz51CPfnOYG90T/C+ts7+C/HzO7dCQLIk43hn+67hcUY07h13DfwIJ5aOZPD+Y/stVHl4YxXJIKA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709251348; c=relaxed/simple; bh=oUJiaf0TY3gDkbZPcr6f6p1dgQYPYkH6NvKCqsgj1dk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=cEEO6mjJ+Lfu9J70UPXWaqbvKOAYQFf3KQkGReL2BSvbbTNhNCFOACjYyzECUBI4XnPxcYVW3qhFOzibS7z1VXLh4Gu/dy/lnbvfNYsKs/fK+0gkuoXUkpDcIZsvQzfHU20d625JCv/ONdDlsQIjriXFxQY1JzHjbYL/nDrbAmI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Sl2K9FRu; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=UcJ+hhU2; arc=none smtp.client-ip=193.142.43.55 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: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1709251343; 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=SNLxnwnRr0Lnru2BqChvcZ/4Fhlb3GVJp1r6JvXa0JY=; b=Sl2K9FRuLPWlgdM1XhIQXkH4ku/NSnMTZaIVaJ584hSHJ4hov86MiSvUZuCZepIUVR1cAx oIAd19FIiFpZhPHCMUytfz736D85uQuykrl1uiXXBGU+ehS0tIR5i6Og713rtfA4Vb3thb 2MYEb04nw1jZ0UZbBMj+WDKy0/TT6nIgqd1FYRfe5qhT95dSEyKVrkioPYQTEJfR70tBMI av5wCrc8Ha2AZQfzPfAXK+btFjrbeNVb8EJFZgZonhyLldweWhvrA/VoI8CpvtXRTzsGmy 4w8r/0MEaWbhCmuU0X9wAgisrnK4Ab4CPdYU22KqF6zJkMuwXqFyKqQfCiIE6Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1709251343; 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=SNLxnwnRr0Lnru2BqChvcZ/4Fhlb3GVJp1r6JvXa0JY=; b=UcJ+hhU2wQDuzErMMuwb1abPj6Fwm77imjQaAgGeflRvwfr7OUJZxk2PWYmAx8HPt83+vl EzRkidiP60XJfEAQ== To: Jens Axboe , linux-kernel@vger.kernel.org Cc: peterz@infradead.org, mingo@kernel.org Subject: Re: [PATCH 1/2] sched/core: switch struct rq->nr_iowait to a normal int In-Reply-To: References: <20240228192355.290114-1-axboe@kernel.dk> <20240228192355.290114-2-axboe@kernel.dk> <8734tb8b57.ffs@tglx> <87wmqn6uaw.ffs@tglx> <87sf1b6o9w.ffs@tglx> Date: Fri, 01 Mar 2024 01:02:22 +0100 Message-ID: <87jzmm7rap.ffs@tglx> 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 Thu, Feb 29 2024 at 15:30, Jens Axboe wrote: > On 2/29/24 12:52 PM, Thomas Gleixner wrote: >> return atomic_read(&cpu_rq(cpu)->nr_iowait) & ((1 << 16) - 1); >> >> Obviously written with proper inline wrappers and defines, but you get >> the idea. > > I'll play with this a bit, but do we want to switch to an atomic_long_t > for this? 2^16 in iowait seems extreme, but it definitely seems possible > to overflow it. Indeed. 32bit has PID_MAX_LIMIT == 0x8000 which obviously fits into 16 bits, while 64bit lifts that limit and relies on memory exhaustion to limit the number of concurrent threads on the machine, but that obviously can exceed 16bits. Whether more than 2^16 sit in iowait concurrently on a single CPU that's a different question and probably more academic. :) Though as this will touch all nr_iowait places anyway changing it to atomic_long_t in a preparatory patch first makes a lot of sense. Thanks, tglx