From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) (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 F19E5466B70 for ; Tue, 16 Jun 2026 17:09:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781629755; cv=none; b=PWl6htkusEvftBAuMzwNXGbIdfFDgVi/RVRdaDn+5H2q2bc182n1Fk2d3R+azYw+GWuWcr/DK40F/YEr3wZk45DYtU5mfLwKYfbZ+nf6/mCkl3TkzZOels7ddDPbLZIb01wQcnRldOAonnUeKHAm8yhrNESZP46JptB66FTDPRg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781629755; c=relaxed/simple; bh=SpY6/qEVPg9oghQPGJlbPsb4+ihix+AFmNKEy+OvOf4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=CKAHgaPn62hg70AO1bsWTy0sGBAaElzwTXuPkvdgkCBrCIbL5CbVKstA0FKfZvbTzmfPKbFJq6m+e+xrmIyBmruRFhnLWnXCJry6rWZtgHOv1Qixnhe6EqXd6SQeCMcWjaGHZQVxw9Iveo6jMoZOhRgXb4TsgOefanM1U7AJymM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk; spf=pass smtp.mailfrom=kernel.dk; dkim=pass (2048-bit key) header.d=kernel-dk.20251104.gappssmtp.com header.i=@kernel-dk.20251104.gappssmtp.com header.b=muErZ+Be; arc=none smtp.client-ip=209.85.210.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.dk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20251104.gappssmtp.com header.i=@kernel-dk.20251104.gappssmtp.com header.b="muErZ+Be" Received: by mail-ot1-f46.google.com with SMTP id 46e09a7af769-7e6dcad6018so4142534a34.3 for ; Tue, 16 Jun 2026 10:09:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20251104.gappssmtp.com; s=20251104; t=1781629753; x=1782234553; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=WvOVp8Jo4aoHBJxFYIf1f27DnohJ1CxVWMkx0wT+xQQ=; b=muErZ+Benmujcx/PSQiSL42A/dYN4A7xltp1BvF2aAkuERtmKk6lPCA7+j0uIBAN/Z FydDhE9PY1r7q0zXCZ1iK8WYThfxWWtU+jssXHPoDJP9osSliVjnT4HTp8iNWBlDrP31 TswpGD/MFWZRTYj3g2G4tshtACcQ4bZ6vd1ghTZLsIbXV32H008PTAMUwvPo2kPZbqGt 01GXv/HE0HkcYsqUNbc9eekDn+Nd+YTQBDueaUMrOjIJEIEUsOi8zb8iM6gBcxfvNOfi inr3LsyEfrB99nRzwHDda84Llc6zilI5GwISf3ef+AQ8hptgw4nuWQC5O2AN3BY+InXF 1GPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781629753; x=1782234553; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WvOVp8Jo4aoHBJxFYIf1f27DnohJ1CxVWMkx0wT+xQQ=; b=Eh8BllKLHtTZnNGYTEu2CeRQfSds8CNuaVsOo7PFup79dtyL8AL2sBv+N4cc8CjyLa OOJnuH4WrTCPpdwpyS9GY7cU9dM4qvKMIwSuJg9lIBBBEgb5uD+U8OBSA0xsDAngKx34 jeUGe+CGn5850qtVrUqEpidiGvLfbWJm4GxNXbX6Y50J9pZ5p2ihF1BLl7TYdRVNX7fP TeG2OE0iEaOm/8ua6Y7QFq3ywhoQvVMSqlRxztDtFvxe7hOMukjfL0RuhSY1vPzAIDkl ohfKBy/BZe8zmZkhADbq4w9FSYaKFLNPN0eEaEp7Or5oUzK+EZgkWjFWjzFuKBTcUHfj lfRQ== X-Forwarded-Encrypted: i=1; AFNElJ9h4tjhv9pZeCx76o8muzqgpRcvMRsXc+H283faumff3PMvAP9DC7HAT7YadxB/8YniG83m7I63FLq5ZpI=@vger.kernel.org X-Gm-Message-State: AOJu0YzIunaAEl4q45s+TG6+Diije5t+Yn944hzfx0eKVRURQosjYMzh jABLFrNCCJ3KOkjK+Bytwiwc1WKVmU77dTbdyCsDSQofgNzNvmsTmHi5xB4FEU7deFI= X-Gm-Gg: Acq92OH1wAu/LA0qxPn7q/7GIj+VhjPWvb46WGJQQ0oHMWj+0cuQ01H/T4FQzSSJWjE rr4IQAfwpP0ED7uY0JPY+KZjYXdLFbq1A1pFEyltb6vCI5HqVD+dJr8mAE4So8UKsBE+UF7CV/0 LnSV977Ii3L7hZEBk0f43qcajEKzAbXibVUN5nkzJuXc7N6ReAqELJthX0uWzm/5TfWkyc8AcHj bqK3wI/rb9eIxUZS+CRaJQZbs1rNXL1Lhbwx8lT0bhpYJb4oV2QgxgU4Gf7ce9EHNfmnp+jKocC zpK4qQZISuj9oS3jkrkEGN5e6RMhRZxPQiGQunK7JIsZCUCMRDr6KAtBv+SXM6pGfzxCQon1loT zJjC7aI6CTBh07e8YlhEcJcMl5axdzLx6PH8nKO2MWS0AeOTYx4JDdaIT/Uo+Glw7CEzeVC2qLF 5DUfC2KJrgUc1J8EMyg9SKFrKbFej1F19pYOHhyu9BxEyBj92zZMwgei5kRZ2HeZiBVkhEfllzH c9cNoEaJA== X-Received: by 2002:a05:6830:4991:b0:7e6:efb8:fe66 with SMTP id 46e09a7af769-7e90b44277cmr437292a34.12.1781629753086; Tue, 16 Jun 2026 10:09:13 -0700 (PDT) Received: from [192.168.1.150] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7e79f5bb344sm7488184a34.7.2026.06.16.10.09.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Jun 2026 10:09:12 -0700 (PDT) Message-ID: <702baa76-9254-47e9-bc63-0fdd52cf3ade@kernel.dk> Date: Tue, 16 Jun 2026 11:09:11 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/2] block: invalidate cached plug timestamp on context switch To: Peter Zijlstra Cc: linux-block@vger.kernel.org, bsegall@google.com, dietmar.eggemann@arm.com, juri.lelli@redhat.com, kprateek.nayak@amd.com, linux-kernel@vger.kernel.org, mgorman@suse.de, mingo@redhat.com, rostedt@goodmis.org, vincent.guittot@linaro.org, vschneid@redhat.com, Usama Arif , shakeel.butt@linux.dev, hannes@cmpxchg.org, riel@surriel.com, kernel-team@meta.com References: <20260616141604.328820-1-usama.arif@linux.dev> <178162611741.2191657.12211870708971600814.b4-ty@b4> <43b0010d-1919-4986-a88a-a4ccdb3639dd@kernel.dk> <20260616165434.GG49951@noisy.programming.kicks-ass.net> Content-Language: en-US From: Jens Axboe In-Reply-To: <20260616165434.GG49951@noisy.programming.kicks-ass.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 6/16/26 10:54 AM, Peter Zijlstra wrote: > On Tue, Jun 16, 2026 at 10:10:31AM -0600, Jens Axboe wrote: >> On 6/16/26 10:08 AM, Jens Axboe wrote: >>> >>> On Tue, 16 Jun 2026 07:15:16 -0700, Usama Arif wrote: >>>> The details for this are in patch 2. The main reason for this series >>>> is to invalidate the cached timestamp on context switch. This was >>>> done in sched_update_worker() only before which was resulting in >>>> blk-iocost reading stale timestamps and throttling based on wrong >>>> information. >>>> >>>> Patch 1 is a prerequisite to create the invariant that >>>> PF_BLOCK_TS set implies current->plug != NULL. >>>> >>>> [...] >>> >>> Applied, thanks! >>> >>> [1/2] kernel/fork: clear PF_BLOCK_TS in copy_process() >>> commit: fd38b75c4b43295b10d69772a46d1c74dbd6fc81 >>> [2/2] block: invalidate cached plug timestamp after task switch >>> commit: fad156c2af227f42ca796cbb20ddc354a6dd9932 >> >> Note: I tentatively queued this on up as a) it looks good to me (and >> thanks Usama for fixing this!), and b) about to head OOO for a week >> or so. If Peter or any of the sched people disagree, let me know and >> we can deal with it. If not, then I plan on sending this in with the >> usual follow-up merge window fixes next week. > > FWIW, looks good to me. Great, thanks Peter! -- Jens Axboe