Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp129513pxb; Sat, 9 Oct 2021 15:47:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvDVBz8dt5MFFnTCfT0ZvV5sAxhyhJbXd8kyApC1NT5P+jd2eJFY8oN22vr+9Nz/3QwPkN X-Received: by 2002:a17:906:b10d:: with SMTP id u13mr14708304ejy.135.1633819678640; Sat, 09 Oct 2021 15:47:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633819678; cv=none; d=google.com; s=arc-20160816; b=o/sZrE2gSgR0Ohq5eYMkblvz0E1ehSj3NJd0cvISPtqSUq8Bn/SUQFNCmxJX96LiyZ /aEH4urUT7csS5FzroplTsO3vo0WQpZbIkZHPqvchn6vMgv3HMRGfVLGWr0yKydcBDAs BILZ96+QkUD4GoDf8r9u2u6YcKvAz73Hx8eTRH9+fj+SGKttF/5QEmAqAdymJ97r3W1W 20C9KArWXrXmuXwMbuc7iVb0WmzHEr2k9iUwMCzt1vznSLapeCUcQSKUrSP2pWKw0LwI 4Lw0R3MAL8LbxAA5Dwi4R2Po+90HRovUK0m9Z7LTJtRnnxwbhSU6Cu4dzu96KIRUh1Lc ePDw== 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=irb6FRwPU2dQSsNxYUCgkPV+9G3ES5Ac2nbK8COEBzU=; b=lDq+SGZQaMijqgyJ9PQZh7evXgywccw6R7NoLJ8UQBGxE7rIAlIsM3wxuHdjuNuSot Ic3L/iAemjsKlUHSidMR8LbB40jJ7KlzGq3Tge97ADzYSKmr5WfCpWNg91Mqxt8/nJWF dsmHfbXc1bm3dz079dET7Mz6A548Cu7r52D/PYLr+D45HFnhA6p+5LhuffI27P3udrRh 0y6N1KEgNXkjs+CKr6q1ryemKDalIa9HrahePt9Kpe92IwXpFL9tUN4yW2Ozjg3xX6Vw OVTd3UxjCBzLRbLrJ+b3BHT1V2iEUB0OzaHNkNK0IwVrcEdXqdjonGQKGVupHPVsVEdF +oFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b="DXMGHD/J"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 de44si4782320ejc.692.2021.10.09.15.47.34; Sat, 09 Oct 2021 15:47:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=desiato.20200630 header.b="DXMGHD/J"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231327AbhJIWnu (ORCPT + 99 others); Sat, 9 Oct 2021 18:43:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230116AbhJIWnt (ORCPT ); Sat, 9 Oct 2021 18:43:49 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1D8AC061570; Sat, 9 Oct 2021 15:41:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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=irb6FRwPU2dQSsNxYUCgkPV+9G3ES5Ac2nbK8COEBzU=; b=DXMGHD/JX7AFdlaWO/D2GkVpwP QHCWfAPEgda5tzNYUSnnKZKCGkQknXnodDJbMYotyD8jaVhs69KREgh7jIBPVJ/5E16H/9bcgXTKD IroinWzWCbs73n5/onzduuOpL3gxMExtapMVaQDRRpCm+DFsvm9c3Pm+SfhOnfW5wzJefTXiU1YGc VgkiiMjqM65eIxzikDCe9D2I1XruRKUFEougWAdwFo2xqTsuoZ/gbloLdtivYIomIPmuJTli09DRS c3QhGj6d23zWxNrWup/YMnbaDJBwo5HH6sd5/tN9kVP1mZSgoEURfTGx2vX/FVt2MFL7+d9egwyvg cVv9mw4Q==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZL2B-008uuN-8R; Sat, 09 Oct 2021 22:41:39 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id D30FD9811D4; Sun, 10 Oct 2021 00:41:38 +0200 (CEST) Date: Sun, 10 Oct 2021 00:41:38 +0200 From: Peter Zijlstra To: "Pratik R. Sampat" Cc: bristot@redhat.com, christian@brauner.io, ebiederm@xmission.com, lizefan.x@bytedance.com, tj@kernel.org, hannes@cmpxchg.org, mingo@kernel.org, juri.lelli@redhat.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, cgroups@vger.kernel.org, containers@lists.linux.dev, containers@lists.linux-foundation.org, pratik.r.sampat@gmail.com Subject: Re: [RFC 0/5] kernel: Introduce CPU Namespace Message-ID: <20211009224138.GZ174703@worktop.programming.kicks-ass.net> References: <20211009151243.8825-1-psampat@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211009151243.8825-1-psampat@linux.ibm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 09, 2021 at 08:42:38PM +0530, Pratik R. Sampat wrote: > Current shortcomings in the prototype: > -------------------------------------- > 1. Containers also frequently use cfs period and quotas to restrict CPU > runtime also known as millicores in modern container runtimes. > The RFC interface currently does not account for this in > the scheme of things. > 2. While /proc/stat is now namespace aware and userspace programs like > top will see the CPU utilization for their view of virtual CPUs; > if the system or any other application outside the namespace > bumps up the CPU utilization it will still show up in sys/user time. > This should ideally be shown as stolen time instead. > The current implementation plugs into the display of stats rather > than accounting which causes incorrect reporting of stolen time. > 3. The current implementation assumes that no hotplug operations occur > within a container and hence the online and present cpus within a CPU > namespace are always the same and query the same CPU namespace mask > 4. As this is a proof of concept, currently we do not differentiate > between cgroup cpus_allowed and effective_cpus and plugs them into > the same virtual CPU map of the namespace > 5. As described in a fair use implication earlier, knowledge of the > CPU topology can potentially be taken an misused with a flood. > While scrambling the CPUset in the namespace can help by > obfuscation of information, the topology can still be roughly figured > out with the use of IPI latencies to determine siblings or far away > cores 6. completely destroys and ignores any machine topology information.