From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E571C433EF for ; Fri, 14 Jan 2022 09:40:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CC0536B0072; Fri, 14 Jan 2022 04:40:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C6FF26B0073; Fri, 14 Jan 2022 04:40:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B37106B0074; Fri, 14 Jan 2022 04:40:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0186.hostedemail.com [216.40.44.186]) by kanga.kvack.org (Postfix) with ESMTP id A35E96B0072 for ; Fri, 14 Jan 2022 04:40:27 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 5EA5582DDBBF for ; Fri, 14 Jan 2022 09:40:27 +0000 (UTC) X-FDA: 79028397294.29.0285BD2 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf11.hostedemail.com (Postfix) with ESMTP id 1005040004 for ; Fri, 14 Jan 2022 09:40:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Qv7o7OYRZZ4rZLcvwJ7bYFuvssGmEGjJm6oL8qmozjM=; b=QnytaVkzeW+ITsuroNUZ4bA9aM a1lP6RQproSsli+QqaxifOPYiXnJUNVwMn1ibHVXIQyXBunu1eXcPXVLwt/abd/QnDUvcv9kwBuFa I6e0jlhjrzmRpX/ltQGAOj2ViNWC8bZKJONvoDhk4OBv1KOszfrX6LPx6GjiM2lfjSqNUjavjFwEJ 2TSDw0/xGQhSLgKrcxCOvHF1UfFgVT5ZzjKY/7M4MZOUmBLeg55598jodeD8D2+Gz/521Gtu8tRqx 2aWMic/+VOU2FcJnHNkB4nuaOSwM73elrE/xrL81GHPrAqggNvQUU/7PVzfMQJ+mtZbWkfZXrJZeZ T6iMdkTw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1n8J43-005gxp-V2; Fri, 14 Jan 2022 09:40:08 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 360913002C1; Fri, 14 Jan 2022 10:40:07 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E0993203C1C62; Fri, 14 Jan 2022 10:40:06 +0100 (CET) Date: Fri, 14 Jan 2022 10:40:06 +0100 From: Peter Zijlstra To: Daniel Jordan Cc: Alexander Duyck , Alex Williamson , Andrew Morton , Ben Segall , Cornelia Huck , Dan Williams , Dave Hansen , Dietmar Eggemann , Herbert Xu , Ingo Molnar , Jason Gunthorpe , Johannes Weiner , Josh Triplett , Michal Hocko , Nico Pache , Pasha Tatashin , Steffen Klassert , Steve Sistare , Tejun Heo , Tim Chen , Vincent Guittot , linux-mm@kvack.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org Subject: Re: [RFC 15/16] sched/fair: Account kthread runtime debt for CFS bandwidth Message-ID: References: <20220106004656.126790-1-daniel.m.jordan@oracle.com> <20220106004656.126790-16-daniel.m.jordan@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 1005040004 X-Stat-Signature: gr7duw61yenbaqhk4ukf3ykhzou4exj8 Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=QnytaVkz; spf=none (imf11.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=peterz@infradead.org; dmarc=none X-HE-Tag: 1642153226-445322 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Jan 14, 2022 at 10:31:55AM +0100, Peter Zijlstra wrote: > Also, by virtue of this being a start-stop annotation interface, the > accrued time might be arbitrarily large and arbitrarily delayed. I'm not > sure that's sensible. > > For tasks it might be better to mark the task and have the tick DTRT > instead of later trying to 'migrate' the time. Which is then very close to simply sticking the task into the right cgroup for a limited duration. You could do a special case sched_move_task(), that takes a css argument instead of using the current task_css. Then for cgroups it looks like nothing changes, but the scheduler will DTRT and act like it is in the target cgroup. Then at the end, simply move it back to task_css. This obviously doesn't work for SoftIRQ accounting, but that is 'special' anyway. Softirq stuff is not otherwise under scheduler control and has preemption disabled.