Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1270586imu; Tue, 11 Dec 2018 16:16:59 -0800 (PST) X-Google-Smtp-Source: AFSGD/Ve+7TxpnEtdYUhvLV9ZiGwmzY/0Yg7nN0y7iUDFwJJWeXH/ca3iVf7TU98vemxJKw0TtbM X-Received: by 2002:a62:130c:: with SMTP id b12mr18384537pfj.247.1544573819379; Tue, 11 Dec 2018 16:16:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544573819; cv=none; d=google.com; s=arc-20160816; b=RqkKniL4OCt7DhH20HcvHsjfFvMg/3KSj1/ypNOgfivXchkfT4zxJH9cPcM3yLaUCe huIQD2B3zFCjc7bmkmUm7PFaoOSFwywsDB9g9JhGsa1Yos4FWIOTszKHu+voz2m1mbpa JnpjrzlL3OLMOKWKCo/vKg0mr5r6L6xUsZoWeV3ZWDHI4qeNgi1sQxCR4zRzW51r7LXH V0QtRsbNVakbUqaOw2Q4BcpC+J9iGeLxNXq6C/JHqSyGkVLVNHDhBSTqzAD15uxIIoqC bP8z08rpSXacAy8d8Ru00iWoLVV3S+0mm6ozIG0/LRWHy8Be2NaijoTttPpRZFq7a54y Uk9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=i3FZWPStkiPabKCa40UKSNNBa20aF7C5io4ToKo2XTE=; b=zh8XC5OyRuO24IW54afoIuFh2h/zLWZXHvRy+AJbar9aHnjwsMLwGZgEVnfwZpx+JA kepOrkVUkewnjMcoSJbhOe2q49vFkQZeXmHYo4BYBUyay82J6yLyyt5zTA7yyUGP886n blpIs4i3DnbAkAI8nc2CN8GY2SFtKkcCLPZNENjN8F9cutYbOIlpi0w1axIWsGyBiXSx kscJToc/ZJMtNyNu70esqWI757OVGXGDgLTN8/54VnEj7mdYBMbx8+bRloCAGrI7O6KU CW0Pkjqf/fp2m3uq9t8vt9q123ccefcHjY3eNFQEu/wgJewvn2GO0H8sJSZ2MLc3uAeE I6KA== 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 h188si14455831pfg.44.2018.12.11.16.16.44; Tue, 11 Dec 2018 16:16:59 -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 S1726240AbeLLAOU (ORCPT + 99 others); Tue, 11 Dec 2018 19:14:20 -0500 Received: from mga05.intel.com ([192.55.52.43]:34408 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726183AbeLLAOT (ORCPT ); Tue, 11 Dec 2018 19:14:19 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Dec 2018 16:14:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,343,1539673200"; d="scan'208";a="258722185" Received: from avandeve-mobl.amr.corp.intel.com (HELO [10.24.10.25]) ([10.24.10.25]) by orsmga004.jf.intel.com with ESMTP; 11 Dec 2018 16:14:19 -0800 Subject: Re: [PATCH v4 1/2] x86/fpu: track AVX-512 usage of tasks To: "Li, Aubrey" , Dave Hansen , Aubrey Li , tglx@linutronix.de, mingo@redhat.com, peterz@infradead.org, hpa@zytor.com Cc: ak@linux.intel.com, tim.c.chen@linux.intel.com, linux-kernel@vger.kernel.org References: <20181211002448.3520-1-aubrey.li@intel.com> <143a5451-c7cf-16a5-a7ef-8c4b0633b689@linux.intel.com> From: Arjan van de Ven Message-ID: <6a549986-f01a-a3c6-10c8-c116667bf7e4@linux.intel.com> Date: Tue, 11 Dec 2018 16:14:19 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <143a5451-c7cf-16a5-a7ef-8c4b0633b689@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/11/2018 3:46 PM, Li, Aubrey wrote: > On 2018/12/12 1:18, 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? >> > > Do we have a real requirement to do this in practical environment? > AFAIK, 1s or even 5s is good enough in some customers environment. maybe instead of a 1/0 bit, it's useful to store the timestamp of the last time we found the task to use avx? (need to find a good time unit)