Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3626613imj; Tue, 12 Feb 2019 01:51:16 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib8ekvoeXlqFA5P33CYT9DOeXY8RsxN+ijS8XX3Tf+MaLHn+N01QOnAWSKq0qgzabVh2EaH X-Received: by 2002:a17:902:4124:: with SMTP id e33mr3139065pld.236.1549965076253; Tue, 12 Feb 2019 01:51:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549965076; cv=none; d=google.com; s=arc-20160816; b=psVVhp0UB5b3NAmsqAQaA9HY27y272vbMXeB4mPlUqL22zFdRJaysd/GiloInqu8ii eZlhzz9ApXmTX/52xuleAtZ+ArvZPopXxiTKkFtRJRL6SA/9wejBYVJIP9p5/+JVo+mP 8XdUxNo00XrxJEdK5y6ifvf/t0DUOzHN6ouzyL3v5P9P9vPJX84eftc12G1kPsIMpka+ 02vrlnvkDmm3Ch6qAf3duHGcPqbKROAR9rTSqcIlIsfDvs0B8nrU9GC+isW989DO66Ni L2WB7Q1pg1JeXTh3iGkwfcq4jBIv37USUYu1P0pio/CmxhLWOs9RS8ZF/bcHF1FWoIQX i4cA== 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=GF3QBNW0W6pFbwMKEjEnK95DD+d3rrzx4oiXwMpUd4k=; b=jX4GrfsuDckS39EWRgBzq0/HEeEcJMyGMfOaMKGO7NE/1oUAlPYzKZOt4gYM+h9pIH fcE1YVyJy1gBufWkTvjd5Dn227GCZO+8fkges6hNe5RBejXkpCQ04E6BI72M0GPSUEab SoLjfL6Nk2xnbi5asBp7Jr1CrwkoTMYbobc5FNhLI/tRDD0axT498HmX6ZDiW8FcLZm4 HMXjp2uZ4VGtfD6xepIVcVZTko8Gx2B6vfnWhl1pVXSLm+/eX88dWfodaqX/U3bbGLJ4 TJeFSOUVXuCLye0GtDaMYnWwoTifxYSqibbuxDsH8JAvy7jmaQJfjThvrdr1bhx7PmBU pnrw== 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 c12si4202070pgh.257.2019.02.12.01.51.00; Tue, 12 Feb 2019 01:51:16 -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 S1728388AbfBLJt7 (ORCPT + 99 others); Tue, 12 Feb 2019 04:49:59 -0500 Received: from mga12.intel.com ([192.55.52.136]:31034 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727600AbfBLJt7 (ORCPT ); Tue, 12 Feb 2019 04:49:59 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Feb 2019 01:49:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,361,1544515200"; d="scan'208";a="125800641" Received: from cli6-desk1.ccr.corp.intel.com (HELO [10.239.161.118]) ([10.239.161.118]) by orsmga003.jf.intel.com with ESMTP; 12 Feb 2019 01:49:56 -0800 Subject: Re: [PATCH v9 2/3] x86,/proc/pid/status: Add AVX-512 usage elapsed time To: Thomas Gleixner , Aubrey Li Cc: mingo@redhat.com, peterz@infradead.org, hpa@zytor.com, ak@linux.intel.com, tim.c.chen@linux.intel.com, dave.hansen@intel.com, arjan@linux.intel.com, linux-kernel@vger.kernel.org References: <20190211185931.4386-1-aubrey.li@intel.com> <20190211185931.4386-2-aubrey.li@intel.com> From: "Li, Aubrey" Message-ID: <7fb97f08-daac-1dad-f51e-13fe6753832c@linux.intel.com> Date: Tue, 12 Feb 2019 17:49:56 +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 2019/2/12 17:14, Li, Aubrey wrote: > On 2019/2/12 16:22, Thomas Gleixner wrote: >> On Tue, 12 Feb 2019, Aubrey Li wrote: >>> diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h >>> index d53c54b842da..60ee932070fe 100644 >>> --- a/arch/x86/include/asm/processor.h >>> +++ b/arch/x86/include/asm/processor.h >>> @@ -996,5 +996,7 @@ enum l1tf_mitigations { >>> }; >>> >>> extern enum l1tf_mitigations l1tf_mitigation; >>> +/* Add support for architecture specific output in /proc/pid/status */ >>> +extern void arch_proc_pid_status(struct seq_file *m, struct task_struct *task); >> >> Sigh. This is absolutely the wrong place. The weak function is declared and >> used in fs/proc/... So the prototype wants to be in a header which is >> included from there independent of x86... > > Can the prototype be in the architecture header if they want to call the function? > Like the following? arch_report_meminfo() is used in fs/proc/... as well. > > $ find . -name *.h | xargs grep arch_report_meminfo > ./arch/s390/include/asm/pgtable.h:void arch_report_meminfo(struct seq_file *m); > ./arch/x86/include/asm/pgtable_types.h:extern void arch_report_meminfo(struct seq_file *m); > ./arch/parisc/include/asm/pgtable.h:extern void arch_report_meminfo(struct seq_file *m); > Actually both way exist in the current kernel,the reason I chose to put the prototype into architecture header file is that I found some architectures rename the function name by a micro definition while others use prototype. See below: $ find . -name *.h | xargs grep arch_irq_stat ./arch/arm64/include/asm/hardirq.h:#define arch_irq_stat_cpu smp_irq_stat_cpu ./arch/arm/include/asm/hardirq.h:#define arch_irq_stat_cpu smp_irq_stat_cpu ./arch/x86/include/asm/hardirq.h:extern u64 arch_irq_stat_cpu(unsigned int cpu); This looks more flexible than it in the common header file. Anyway, putting the prototype into the common header file like include/linux/proc_fs.h is also acceptable to me if you persist, please just let me know, :) Thanks, -Aubrey