Received: by 2002:ab2:3b09:0:b0:1ed:14ea:9113 with SMTP id b9csp8290lqc; Thu, 29 Feb 2024 08:53:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWi873IAZxWAdVakd7sFGdWmZ0IqxWkgyhy8gSky+Y1ZEmKrnznvGGRlUsp/sB6ROFlrNysLi+pRliV1nU/3tAmJzBfrbiUhdJ/wDWHTw== X-Google-Smtp-Source: AGHT+IFEnYVSvsZ9tEYs2op+F0zi0HhYpvpmMa1jUD7tnTe68h1/11o20AsBaWvEx2hqJUyxAwx6 X-Received: by 2002:aa7:9e4a:0:b0:6e5:599a:52b7 with SMTP id z10-20020aa79e4a000000b006e5599a52b7mr3073849pfq.28.1709225630095; Thu, 29 Feb 2024 08:53:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709225630; cv=pass; d=google.com; s=arc-20160816; b=lpAr5u6KQKDchzs22nmrw0TWafCz1p/vfhGUctOquG32Rp7i0WvGahXcZ4pThifWtQ fxJnE3PfvoVeV2l8CaR2gnXHejzh+7fFBgyqngb0nIjzJ9mZxhWk9In8MkY99VCv3iQw C0w9ZJ9vk1xY5Fdpyt2TQ9TaLUQ7x9NH8vgtkD5RB1PIjFGhhKJm9aSS+13sseTXDwHb LIfw9zkbiHTnOy2nsc8irMZVS+tye+w/WWLJyCchpHJOLevrlDM8WCNIm+aexX6Ynxp2 O0CgtiP0YVaUtf3WU4O4ZjfBlKl1lAUnQYSrnYVg5Pm4C6rQ9HdtI18kL51AhShp3PBj og+Q== 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=tmaQYlANBkHSGvr0jNOe1c6RMNTnCjEqaEWxEiidtqk=; fh=hdyqXtB0bE3ipALk8vQHGy3wa8HG02oTCni/ksVr+vs=; b=Nrwqdo/L7B00rkC7oO33ri7AhNUXxwg9bBSE3Gzr4oyioErmuRs5HI1sHoqxsPFbzn sL4v9/l3lwZ5yfgUSOCV+8g9He0Yynao5kvjkqEDSv+SSRZ6nNzgDNRLWSF16irpY2rl jWJ4vz/w/OuIqh7BXImNOx1D4sHxL1P4QVR3wWkV0581KSgha6a0hM80XVqwpP4OoCUa +BWBJHYq4IRxJqf0HA4cIG7XaPgNflhu5bbqBOY3Zd482spPnz7cpu8cpM8/s5tWEvWr C8GZ4aJXHwbHa5movjg/OvnQRp2PjLSpNeZw4KpfCqk8Vfl+cL6JeTqqvqcpXnFBGbhe BLYw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=enwFlzjx; 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-87104-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87104-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id p3-20020a056a0026c300b006e468ec9951si1634248pfw.103.2024.02.29.08.53.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 08:53:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87104-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=@linutronix.de header.s=2020 header.b=enwFlzjx; 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-87104-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87104-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 88DE4285C1D for ; Thu, 29 Feb 2024 16:53:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C5B71383A0; Thu, 29 Feb 2024 16:53:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="enwFlzjx"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="/HQ67LpD" 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 9F73A16064E for ; Thu, 29 Feb 2024 16:53:42 +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=1709225624; cv=none; b=NkIeK3KYArARUDEAlpQtQELJ7PFXQ28ko541MJgOZ9nNcV/hY/WzY93Tdb5oWS7SkE7Gch38m5hqUhRkzt23zxiWMLpC0pp2A1fNhP7Vjy/kF+B5QLB53b0ZwPRE6Iyxr+OLGOAscGHD9MtkO2LgdmrUCP1ibp7ZqiheyRTTAEo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709225624; c=relaxed/simple; bh=tmaQYlANBkHSGvr0jNOe1c6RMNTnCjEqaEWxEiidtqk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=t4B3Jqg7cIXwe6vwrftkV+miO8NH1QOmewgXQYbEKM6W5zpOQswrrr334T3OgNbSRU5VGagMRQBtlqdzgdKs8FGHeRDSFo18kac6kOKtXULy7Ds9A8qqbmjBWOzl20m6y5Tx2uF2Y7IOT1WUnzkOG+7TnQkbebT20BS/VnRPp5g= 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=enwFlzjx; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=/HQ67LpD; 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=1709225620; 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=tmaQYlANBkHSGvr0jNOe1c6RMNTnCjEqaEWxEiidtqk=; b=enwFlzjxEnfgm/UeL9lbZXXZYzo2xG1hwJSw4TrlJHISWw1hjlMaqfKqVU6XSybxdgvwmq nQL1tZ9Z2B78yZyS/eRYmNX83pUVHeyhCf6/WjTs6nNP8Y3twrNRWjWtPp4bGntPdwOJCM EFpMC+YID+FQtAXVHWmNPP412faGu4wjcADS+47VnDDpvY4Eb3sHMUe7Wf1ZzEvDmJTWM7 Tyh9SDZ91Hq8Si5lxwS/Q2KIF3pscOZIwGhy3O1BvxF14PpMmcfsWOKnMplmzNK+etyCIP v77Vi7M7b7k4G3T/BtCGv+ekcy2JYvFwSlVlyxB5PBJBh00MwcR2X0n71oiZAg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1709225620; 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=tmaQYlANBkHSGvr0jNOe1c6RMNTnCjEqaEWxEiidtqk=; b=/HQ67LpDyIa/Ksy7TiBADMxvYOynQSp5AEq7rWM9rVyMrmXe4tnsfVvQSttfoUyLMs7/3v q1vrs+6xArcmOBDA== To: Jens Axboe , linux-kernel@vger.kernel.org Cc: peterz@infradead.org, mingo@redhat.com, Jens Axboe Subject: Re: [PATCH 1/2] sched/core: switch struct rq->nr_iowait to a normal int In-Reply-To: <20240228192355.290114-2-axboe@kernel.dk> References: <20240228192355.290114-1-axboe@kernel.dk> <20240228192355.290114-2-axboe@kernel.dk> Date: Thu, 29 Feb 2024 17:53:40 +0100 Message-ID: <8734tb8b57.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 Wed, Feb 28 2024 at 12:16, Jens Axboe wrote: > In 3 of the 4 spots where we modify rq->nr_iowait we already hold the We modify something and hold locks? It's documented that changelogs should not impersonate code. It simply does not make any sense. > rq lock, and hence don't need atomics to modify the current per-rq > iowait count. In the 4th case, where we are scheduling in on a different > CPU than the task was previously on, we do not hold the previous rq lock, > and hence still need to use an atomic to increment the iowait count. > > Rename the existing nr_iowait to nr_iowait_remote, and use that for the > 4th case. The other three cases can simply inc/dec in a non-atomic > fashion under the held rq lock. > > The per-rq iowait now becomes the difference between the two, the local > count minus the remote count. > > Signed-off-by: Jens Axboe Other than that: Reviewed-by: Thomas Gleixner