Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp89132lqs; Thu, 13 Jun 2024 04:59:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWVOTKsLExILjqI97FOTeOF3bi2KwHyyMJ8VBHFwPpqcLftTHEBfF4Pj9fOtQVp7BFmmnCTa9AuD2UZu7LO5aoUONCtD4IAz7EG5prsTg== X-Google-Smtp-Source: AGHT+IHJLUyJm9UznO5pncq3W1ZeuiEzmxJR1ZxB+oZ4//E3AzPp2GQ92gPxdlfp6Q3e9ebJpYkb X-Received: by 2002:a17:902:ecc1:b0:1f6:6ef0:dae4 with SMTP id d9443c01a7336-1f83b5f3fffmr53511995ad.32.1718279970375; Thu, 13 Jun 2024 04:59:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718279970; cv=pass; d=google.com; s=arc-20160816; b=rUygjqj1PTjAzRM6Y+nP26Fb13hLc0/IVticApI19YqctcJbd6k3XiQ9S2qEJatnE9 YlqfdonRX7VtAiWytKkgkMCYUn8T9W7xY0kQBkZILo8wpxFtWOitMAp6Cgs8eDZoi40r AnyC9vUtqbltKZ/7ZEYFheAqRQFXnEndACW6OtBn6j94ruFlHNrZrbTvinZdFfiwBTHv kRPeZV/DA6i4NAF89WvnDRBcJT6owFdDDoynZXeKlR5EjaQ5YJ2JTZZU2HrDvglZ4l+u ttiJllgHndbCg9BChf6+83fPqiLWYqLVi7ruyhTsyLDSjjzfGXT7MUZIbeKJmc0yh1mo pQCw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=G8v2PHEc7ReSFsN3sKt9G9rx4uLCxEdCe0Zu0J7gE0g=; fh=VEv2OteJ5t666RFz9K27lQM9SmnNM/n35F6RozH+Xwo=; b=PLSXmtw3sq4csnkIfiT+xiM4/bmOxpuQby6/JCoJrFNmpfCeLtw2YPaJuTMBCvFP57 Vu0ZOYPb8xpaYkZ4pAxMh81kbnaeVx/JK1whFZTfspzO3r5HiHojEa2Yr19CjqETPizS TQbMOGgTKlmHW+g84yp912X+ANmFRsjoyZz0aOJ/cbmOyufmoQcM3zHkUh7sL1dCywna s7RB0hnLTpJ3bREfR48JtbyxFeEHeBK/Qn8/jdRsK0bcj6hZr/Y2AmDYUh0p4RZ+XQqE teHQxDu8v2V1Jv9IuVCi0UVasMC/V49ZQZLm1u9mIPwA2/rWo2U16eBwx1fLS2w3lFRQ bXtg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=vGD8G6TL; arc=pass (i=1 spf=pass spfdomain=layalina.io dkim=pass dkdomain=layalina-io.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-213146-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213146-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f855efb5eesi11311885ad.456.2024.06.13.04.59.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 04:59:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213146-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=@layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=vGD8G6TL; arc=pass (i=1 spf=pass spfdomain=layalina.io dkim=pass dkdomain=layalina-io.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-213146-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213146-linux.lists.archive=gmail.com@vger.kernel.org" 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 13C78286E48 for ; Thu, 13 Jun 2024 11:58:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4CA3614533F; Thu, 13 Jun 2024 11:51:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=layalina-io.20230601.gappssmtp.com header.i=@layalina-io.20230601.gappssmtp.com header.b="vGD8G6TL" Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (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 924551465BA for ; Thu, 13 Jun 2024 11:51:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718279508; cv=none; b=BhlI8rQa0AVzUf/XpupwP1tN9p2E1f+eOiUMgSlHbseFk79dyycNHUIDZ+HPaxG5uxcW00j5idg/PKvHwVZCemGgfTHtaaLZbwc6ah/+4aQt6VXmSS3g/Fk4A91llb031g/iC69H0YWJ4EaJpxbdFqlZ2XqXAOScLHFyb6eT/CQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718279508; c=relaxed/simple; bh=w2vdeE6HyK1zqMKz4ydvXzIOS4kYoy98j5IM9DRJLYU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rmDYRUQqtArIfqng3VTTQFFaLLhqG062jC4nwioOegqWpkD1UnIQbVxbPdE1SkljOGqh+CZg8KeqwRmwHlnAr9iRd6VCqf2WazFSf6eg3qxijsnelGsI7MdmI/MRw0Bdjd5KMNIBmuPFgVmkmGNVBX7JAxVI4wmlq+1J1tPP5Vo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=layalina.io; spf=pass smtp.mailfrom=layalina.io; dkim=pass (2048-bit key) header.d=layalina-io.20230601.gappssmtp.com header.i=@layalina-io.20230601.gappssmtp.com header.b=vGD8G6TL; arc=none smtp.client-ip=209.85.167.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=layalina.io Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=layalina.io Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-52bc121fb1eso1307500e87.1 for ; Thu, 13 Jun 2024 04:51:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=layalina-io.20230601.gappssmtp.com; s=20230601; t=1718279505; x=1718884305; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=G8v2PHEc7ReSFsN3sKt9G9rx4uLCxEdCe0Zu0J7gE0g=; b=vGD8G6TLdNHdHdgl6OafKkZEcV1Vk09xc6O3GpNI1QOMlW11YFEr4B8KJ6ccWWffxQ 7BFzp82RuZXG4Np49kCqlyeTHKaA4ZmlnXz7SuGeGWWkLkOF87sUjvqYtSsmIxghczcc BNmoLX9Ut65I5/ehnL/WTycwRZnGwBMna2tRa7ioDVVHf8FSAzGeCOMqc3wiqn4P1q83 qBflhEeuqVjDhjk0qRDrAUyqcyM0oiSnQDkGd4p+putyR+woYsbAJt10KmdtIvOWxswv vBH89QnacYW0euJqb4VZyJlvjXFTUV8642Fwgg/tSauecsnzMfuCrHfgHjZSnWPLOZdg aCkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718279505; x=1718884305; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=G8v2PHEc7ReSFsN3sKt9G9rx4uLCxEdCe0Zu0J7gE0g=; b=ZoS1lfMkp16zugvdj5g9EpXsaGEv5ZeTyQKMsVcu+mdBScLEFUn4a7ogxMkBssuQl5 DpYQRSe9kx03BWDlGjutxEwE5U3EpYSXM9Dg2cxf1zYg3HCuJmVQFSk/zgR5dNiZ7zBH k6iDg2LLmBuJfhYr9ARMsQjBaQagHIv0raP9nM0aPP/JHSpQQOqqFGttfw6dD78YqaCY y8Z5V6qR6t6iCSWK6fOxOLvmEJkbxi0fDVD+V/3siTQRqv4d71FtSaHIzhB/LBK3cqXq HKTtfUwyHYum+n8XScpGAMJYeTh8KtZGv5v9Fm4OvcG0aXGbh8dxoZ3vR+0lVOTLbQYN qfIw== X-Forwarded-Encrypted: i=1; AJvYcCXkS08DZXfCnDngSGoRlF5yJHSggvuK+byLv3sIJ6Laa2i24JUxtrC7zHbOfGu5/escgo2kMLSE6xi2jOMfgmWy+m1a4NuzwYdoOY4K X-Gm-Message-State: AOJu0Yxgn9PgjL6f613F7/QJ61/IMbQR/kLhBOf7kj3XwZC0baBJ2/PM B9gJxVPh+G2l66CxVrRi6rbfuoWtH+pwIKplBYa6mu8DJ7qL3dD/B/FHnEvE+3k= X-Received: by 2002:a05:6512:3d87:b0:52c:a5cc:19d6 with SMTP id 2adb3069b0e04-52ca5cc1c34mr27988e87.22.1718279504561; Thu, 13 Jun 2024 04:51:44 -0700 (PDT) Received: from airbuntu (host81-157-90-255.range81-157.btcentralplus.com. [81.157.90.255]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-422f641a64bsm21649075e9.46.2024.06.13.04.51.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 04:51:44 -0700 (PDT) Date: Thu, 13 Jun 2024 12:51:42 +0100 From: Qais Yousef To: Peter Zijlstra Cc: John Stultz , LKML , Thomas Gleixner , Frederic Weisbecker , Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Joel Fernandes , kernel-team@android.com Subject: Re: [PATCH] RFC: sched: Rework task_sched_runtime to avoid calling update_rq_clock Message-ID: <20240613115142.kxrmlf3btmwjcprg@airbuntu> References: <20240613015837.4132703-1-jstultz@google.com> <20240613100441.GC17707@noisy.programming.kicks-ass.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240613100441.GC17707@noisy.programming.kicks-ass.net> On 06/13/24 12:04, Peter Zijlstra wrote: > --- > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index 0935f9d4bb7b..d4b87539d72a 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -724,7 +724,6 @@ static void update_rq_clock_task(struct rq *rq, s64 delta) > > rq->prev_irq_time += irq_delta; > delta -= irq_delta; > - psi_account_irqtime(rq->curr, irq_delta); > delayacct_irq(rq->curr, irq_delta); > #endif > #ifdef CONFIG_PARAVIRT_TIME_ACCOUNTING > @@ -5459,6 +5458,8 @@ void sched_tick(void) > > sched_clock_tick(); > > + psi_account_irqtime(curr, &rq->psi_irq_time); > + If wakeup preemption causes a context switch, wouldn't we lose this information then? I *think* active migration might cause this information to be lost too. pick_next_task() might be a better place to do the accounting? > rq_lock(rq, &rf); > > update_rq_clock(rq);