Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp124835imu; Thu, 8 Nov 2018 06:04:04 -0800 (PST) X-Google-Smtp-Source: AJdET5dBNG5DbpW6uq50p18wSoyaERD0LRIxUsawSu/8yo5OAtMFanaWjX3LUyh3ORON7YrqM4Ft X-Received: by 2002:a63:9dca:: with SMTP id i193-v6mr3599424pgd.98.1541685844044; Thu, 08 Nov 2018 06:04:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541685844; cv=none; d=google.com; s=arc-20160816; b=rzvS1QjEpgVQOFziVXCCaViwrPsvCjGxsenpeR8wjixcdJUsCwWkabBdIpaqlOc503 60Op/524CbbMH3GV+St9bxUszFWf1vKXHukUnSsAc9IplxVV4cfwV30I3+/YZxbOh5SU LAWHBZAlEQqwhldc6tAzdkC+YGWUuhUiVp5A+HpEOQ4qEYn2TUGRM637NlKgVLKo6+rQ r/GlUT+YASibRxvnlQIWqSGpJuWqKTBjj6+apGgeD+G0Ns2kuE0J00BGnfb2ugvSVMhK oai+LhtwhGW0mHlLTq+JCbVHFeECoL7wxnzKrmm3EzNiB/HrN8IePjYPvk9NLIST7Vx1 CMsQ== 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=75fmbOcQBHRtuQDUj2k/1e/XWt+L9ICY3Jh1PRhIsuY=; b=K3dKpjKi8MS0grcA5aF3HyvzaoxXsrlvHZnpybE/UNxPs3PuuUFAHhc6LMKMPz86At n8zBpq1M5DUmPQ3zY2dSD0R8q3GvX2MDQWY3XS/BCOsEQv1LDmaXPfRFBfrgzDw85j57 RgJAicu61uufCr+Izv4cSL9GVJbznxej9p9mxREpjJ0fvdEIV5Zj3FN4KlDS43HAxj6Z /2kxfpP9rHWsIrDtoWjE7MOpnpnllwyj/fq9Tv5nOMIfu0rWykSIvsHq3BUf7rhODJeW gZjdkWMD6yyjvfjuX9cs1wKDv1QFebgSJzt3MMnDslFMKcseFF0fxChOV3pd4KhkYkZ2 zvhg== 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 a4-v6si5050598pll.50.2018.11.08.06.03.43; Thu, 08 Nov 2018 06:04:04 -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 S1727072AbeKHXiq (ORCPT + 99 others); Thu, 8 Nov 2018 18:38:46 -0500 Received: from mga02.intel.com ([134.134.136.20]:40165 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726359AbeKHXiq (ORCPT ); Thu, 8 Nov 2018 18:38:46 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Nov 2018 06:03:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,478,1534834800"; d="scan'208";a="106531013" Received: from cli6-desk1.ccr.corp.intel.com (HELO [10.239.161.118]) ([10.239.161.118]) by orsmga001.jf.intel.com with ESMTP; 08 Nov 2018 06:03:07 -0800 Subject: Re: [RFC PATCH v1 2/2] proc: add /proc//thread_state To: Peter Zijlstra , Ingo Molnar Cc: Aubrey Li , tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, ak@linux.intel.com, tim.c.chen@linux.intel.com, arjan@linux.intel.com, linux-kernel@vger.kernel.org References: <1541528590-30296-1-git-send-email-aubrey.li@intel.com> <1541528590-30296-2-git-send-email-aubrey.li@intel.com> <20181108063246.GA13233@gmail.com> <20181108101729.GP9761@hirez.programming.kicks-ass.net> From: "Li, Aubrey" Message-ID: <977bf7ee-deb3-0c9f-def5-7bb04d2e78ae@linux.intel.com> Date: Thu, 8 Nov 2018 22:03:06 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20181108101729.GP9761@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8 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 2018/11/8 18:17, Peter Zijlstra wrote: > On Thu, Nov 08, 2018 at 07:32:46AM +0100, Ingo Molnar wrote: >> >> * Aubrey Li wrote: >> >>> Expose the per-task cpu specific thread state value, it's helpful >>> for userland to classify and schedule the tasks by different policies >> >> That's pretty vague - what exactly would use this information? I'm sure >> you have a usecase in mind - could you please describe it? > > Yeah, "thread_state" is a pretty terrible name for this. task_struct has a CPU specific element "thread", I quote it to here to create a generic interface to expose CPU specific state of the task. Like /proc//stat, I plan to use this "thread_state" to host any CPU specific state, including AVX state(now only), and any other states(may come soon). So this interface may be extended in future like the following: #cat /proc//thread_state 1 0 0 > The use-case is > detectoring which tasks use AVX3 such that a userspace component (think > job scheduler) can cluster them together.> > The 'problem' is that running AVX2+ code drops the max clock, because > you light up the massive wide (and thus large area) paths. Thanks to explain this. > > So maybe something like "simd_active" is a better name, dunno. As above, maybe the name can be hidden by thread_state? > > Or maybe "simd_class" and we can write out 0,1,2,3 depending on the AVX > class being used, dunno. It might make sense to look at what other arch > SIMD stuff looks like to form this interface. > A task may use 1,2,3 simultaneously, as a scheduler hint, it's just cluster or not, so 0/1 may be good enough. Thanks, -Aubrey