Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp943063imu; Tue, 11 Dec 2018 09:57:07 -0800 (PST) X-Google-Smtp-Source: AFSGD/VXfE/65k4j+SLEE0JfvDeW5WxDwHSyTX9r8v7EVImBD/7Ds04AdCJ7LqUef3kcV4SfD2oj X-Received: by 2002:a17:902:584:: with SMTP id f4mr17440697plf.28.1544551027211; Tue, 11 Dec 2018 09:57:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544551027; cv=none; d=google.com; s=arc-20160816; b=LTW5h0DyRsLCM7QudWSxsM7lSXfljsaE9ZjyTb+QCPGbClWDufRP1MoG+9N7V7FlRq E/+vrYNvEKdyFQe4cmuuYNz9sGK0/yhO9/rxbYsS+D8tm3L1BRyCVyjmKlu5T7aWAEm5 LcK8KHuGrSNuocfnl9GAWc5t0MEJdcbiIJ/RXceB3CqgplKiyK/LXDzaRp9qbdBnQpnJ ovviXK1rsd+UUvEr6KwpIzz1CRWIlgBcMdqiJjfhtMyh0Q6JBUUyllsQjz5FikXXvW92 i4przbzQuafzkI2/DUqPhYPGjm9ht8p+GlU9sHsJorK2GgFR7b/ibU20Ubkcz+jddxJC gRsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=KtbtpbBMe/xMH8/fA30FtQZkBgPcu9KC5VC0Tub5lLo=; b=PBibVppHpRnfHhjPHThP9Cd4yolfrJZxhA2tkWhUGSdQEjN8BQHnZsS/ZOsIeZXthz gT4x9a+FRVdSfAQWn7eVCRP0D6sc1PP8xQHzaoU7RxuzPbz03UZlShLAXl03a7Q1rSne Kbp2j8lW5hHGEA6ZrukczihqbOz5kzN/8Xxq9LnEogY+wnkICBdcJb0iA8+PB/7u6/c2 c3xUv4Iy78dhYN3NgVVL+bc1y9MeYTJND8pfz/Y1vRy3IKdjnYaQ2MjYjgrfyHhfElIr Y7alVU6VkhDqSNvej5W0LrjBBG1XD+gNyw/wRfikNW7JsYG6MpMjvq7ujAhL9IkHSAbP N2zg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p8si12976082pls.83.2018.12.11.09.56.52; Tue, 11 Dec 2018 09:57:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726953AbeLKRxy (ORCPT + 99 others); Tue, 11 Dec 2018 12:53:54 -0500 Received: from mga04.intel.com ([192.55.52.120]:9639 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726231AbeLKRxx (ORCPT ); Tue, 11 Dec 2018 12:53:53 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Dec 2018 09:53:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,343,1539673200"; d="scan'208";a="106633106" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.137]) by fmsmga007.fm.intel.com with ESMTP; 11 Dec 2018 09:53:52 -0800 Received: by tassilo.localdomain (Postfix, from userid 1000) id 3D5F130237E; Tue, 11 Dec 2018 09:53:52 -0800 (PST) Date: Tue, 11 Dec 2018 09:53:52 -0800 From: Andi Kleen To: Dave Hansen Cc: Aubrey Li , tglx@linutronix.de, mingo@redhat.com, peterz@infradead.org, hpa@zytor.com, tim.c.chen@linux.intel.com, arjan@linux.intel.com, linux-kernel@vger.kernel.org, Aubrey Li Subject: Re: [PATCH v4 1/2] x86/fpu: track AVX-512 usage of tasks Message-ID: <20181211175352.GC25620@tassilo.jf.intel.com> References: <20181211002448.3520-1-aubrey.li@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 11, 2018 at 09:18:25AM -0800, Dave Hansen wrote: > On 12/10/18 4:24 PM, Aubrey Li wrote: > > The tracking turns on the usage flag at the next context switch of > > the task, but requires 3 consecutive context switches with no usage > > to clear it. This decay is required because well-written AVX-512 > > applications are expected to clear this state when not actively using > > AVX-512 registers. > > One concern about this: Given a HZ=1000 system, this means that the > flag needs to get scanned every ~3ms. That's a pretty good amount of > scanning on a system with hundreds or thousands of tasks running around. > > How many tasks does this scale to until you're eating up an entire CPU > or two just scanning /proc? Yes that's why we may need to propagate it to cgroups in the kernel, because user daemons don't really want to track every TID. But per pid is a start so that people can start experimenting with this. Then with some experience fancier interfaces for it can be implemented. -Andi