Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8717274imu; Thu, 15 Nov 2018 16:35:04 -0800 (PST) X-Google-Smtp-Source: AJdET5camnFzca5dX/uWJQ0fMiyGkUt/GDZqBMOBDLCE10FSOYZVthcZOBPaZm8XY+pBrqQq81UM X-Received: by 2002:a17:902:e101:: with SMTP id cc1-v6mr8651118plb.165.1542328504269; Thu, 15 Nov 2018 16:35:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542328504; cv=none; d=google.com; s=arc-20160816; b=DnfsWS+hwil0Vr+0NcSxXDztJI0BCkNjgMytp7Or+RSIbyQIULoOii71uZJi4w4aMN IzzPdp1D0Dl8NjbI8wE7XPS3NtyeS0bxd4L0fVANsc6pbLEgdPWCCoBbeUHzl2y010Sb B8BCn9yNv5BTtHowWrB5k3zpQ2JuTj0gKZLYdZMsVV9+Ui9G4QHFKcue6QFq9GYrVe/D xc5XLo0N8b1EoS5L2SLMpIsqnUe3x8UayNsMaZJjs+HLsTaicLaEGs8IKcLRcDQN7aI6 BT1gqGQ+7CRAEMNxW5cd07ZUwvjW2L9j41kVlRNo0IrpdWQhg8HCJExKNuhoUl/Lgg/2 YEkQ== 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=dnMEgB68YP47AZrjoJt4iT46c1B19mMZZMO3Vejsxbw=; b=aECob7tt/0bm09Pbz0Dt57X6ILoMzVYGWaQ2c8taZ7wPUxBoxO3t0R4lzaFOqVBM1K kfSDr8VzLm+wNYxFz4g5dO4VkF0OSmiUTUKHgbPKW3uO0egPyqYlV2XnpQwGUm0shAcj vvIaNLWB/WOAYmEG4riaiSnJT9ihdwNsmCfLQPZpEd5hjqfjh3lfqj7GGTnZUyykQMY1 R1wH6I4Qnh46Okx0whTEpo8bmoos+yZVnYbo1vglGy910SnX3r0Rl0pG8AfDUnRVsGW0 muAfdmdllB3bax2MPPSew8mmwn5uVxzD0XvhSJhw97UMxSaOrmqF2dAQAVbTSHjfN/r/ Au7g== 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 j22si24449530pgj.244.2018.11.15.16.34.49; Thu, 15 Nov 2018 16:35: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 S1727257AbeKPKmc (ORCPT + 99 others); Fri, 16 Nov 2018 05:42:32 -0500 Received: from mga01.intel.com ([192.55.52.88]:54634 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726718AbeKPKmb (ORCPT ); Fri, 16 Nov 2018 05:42:31 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Nov 2018 16:32:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,238,1539673200"; d="scan'208";a="91548333" Received: from cli6-desk1.ccr.corp.intel.com (HELO [10.239.161.118]) ([10.239.161.118]) by orsmga006.jf.intel.com with ESMTP; 15 Nov 2018 16:32:20 -0800 Subject: Re: [PATCH v3 2/2] proc: add /proc//arch_state To: 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, arjan@linux.intel.com, linux-kernel@vger.kernel.org References: <1542236407-4323-1-git-send-email-aubrey.li@intel.com> <1542236407-4323-2-git-send-email-aubrey.li@intel.com> From: "Li, Aubrey" Message-ID: Date: Fri, 16 Nov 2018 08:32:18 +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: 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/15 23:18, Dave Hansen wrote: > On 11/14/18 3:00 PM, Aubrey Li wrote: >> +void arch_thread_state(struct seq_file *m, struct task_struct *task) >> +{ >> + /* >> + * Report AVX-512 Hi16_ZMM registers usage >> + */ >> + if (task->thread.fpu.hi16zmm_usage) >> + seq_putc(m, '1'); >> + else >> + seq_putc(m, '0'); >> + seq_putc(m, '\n'); >> +} > > Am I reading this right that this file just dumps out a plain 0 or 1 > based on the internal kernel state? BTW, there's no example of the > output in the changelog, so it's rather hard to tell if my guess is > right. (Hint, hint). > > If so, I'd really prefer you not do this. We have /proc/$pid/stat to > stand as a disaster in this regard. It is essentially > non-human-readable gibberish because it's impossible to tell what the > values mean without a decoder ring. Yes, I'm following /proc/$pid/stat format, as I think this interface is not for the end user, but for developer and user space job scheduler. So I guess this style might be okay. > > If we go down this road, we need a file along the lines of > /proc/$pid/status. I checked /proc/$pid/status, all common information to architectures. That's why I want to open a new interface to CPU specific state. > > But, either way, this is a new ABI that we need to consider carefully. > It needs documentation. For instance, will this really mean "Hi16_ZMM > user" from now until the end of time? Or, does it just mean "group me > with other tasks that have this bit set"? > I'm open to this interface. Let's wait to see if there are more comments and suggestions. Thanks, -Aubrey