Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp656310pxb; Fri, 14 Jan 2022 13:20:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJwXHI0UV7v2FrAEe0RfNBYf6qGECiz5VklX+OiRW8n/aLjp55xhjpbUDR4GMcq6vmS/qbes X-Received: by 2002:a17:902:bd05:b0:148:a2e8:2c3d with SMTP id p5-20020a170902bd0500b00148a2e82c3dmr11189619pls.140.1642195208141; Fri, 14 Jan 2022 13:20:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642195208; cv=none; d=google.com; s=arc-20160816; b=Pqb2Xx1devISTPw819O1nUBHI/P7xZipc22vD/cws110xoXpxzSvm9J72ieOYBc2xW 7sKyE3A6/46FAMkhSps5p/lkJHg2ieBUgpD2D+wJT+UH4CQTN/Ak+GcerOK07zbIyUXB uF+1Gs6jsZps0qiNy3eKbkcwZrNzAUecZVeTmuhl7EU/R7Wqy+Fm8HWo3ouwkTzTQAVp FuN2XUj0i/L2ePW9r/LoI7tNqG8s7Tu9WDyCt7gN3/GSXznHSKYakKQ7XaRxxhidMqjH ra8dvOq72kLpSmXIb8lwp5TYzp/14tO8ZkqvWfj8H92WnHxhg8A6FUda+0TUkRpb/bKn RQHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Qv7o7OYRZZ4rZLcvwJ7bYFuvssGmEGjJm6oL8qmozjM=; b=h/nmvlnAvAWfAZ7Yll7mwv/zzvnbLsspFpavP9Khx2XLIeI2/bhcRg4zlJBtJeXIRw NMEvUKX7OD904/q27EqQy71OFl5qd0yi0Bq+VLEhWgI7rj2l2FfYZZ7rA+kDvmOW+/zH u4i3WHgPeOjCP0RBFZPLtLZZywkvzbgZ2W2j2fHFmoOzFMTMPPHXgo/6cQaJBy8PorVC VpV9UHXMcpp5or4EneZWYlv8CR7aCr8JD+QZeRYjIN4wsrjKmIO6984w6i3u2onbILmi BauB+kVJpdW4YvG1YXOOmV0bdnZDL3xatnLyUBPgw6QiY7CsHZgmebhnD70xiKUa/7Zb AyRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=QnytaVkz; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q12si11703547pja.2.2022.01.14.13.19.56; Fri, 14 Jan 2022 13:20:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=QnytaVkz; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239803AbiANJkq (ORCPT + 99 others); Fri, 14 Jan 2022 04:40:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229785AbiANJko (ORCPT ); Fri, 14 Jan 2022 04:40:44 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96204C061574; Fri, 14 Jan 2022 01:40:44 -0800 (PST) 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: Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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.