Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754978AbcLBWVK (ORCPT ); Fri, 2 Dec 2016 17:21:10 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:43386 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752672AbcLBWVJ (ORCPT ); Fri, 2 Dec 2016 17:21:09 -0500 Smtp-Origin-Hostprefix: devbig From: Shaohua Li Smtp-Origin-Hostname: devbig638.prn2.facebook.com To: CC: Fenghua Yu , Thomas Gleixner Smtp-Origin-Cluster: prn2c22 Subject: [PATCH V2] x86/intel_rdt: Implement show_options() for resctrlfs Date: Fri, 2 Dec 2016 14:21:06 -0800 Message-ID: <7dce7c1886ac9289442d254ea18322c92bd968da.1480717072.git.shli@fb.com> X-Mailer: git-send-email 2.9.3 X-FB-Internal: Safe MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-12-02_14:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1163 Lines: 38 Implement show_options() callback for intel resource control filesystem to expose the active mount options in /proc/ This applies to tip tree x86/cache branch. Cc: Fenghua Yu Cc: Thomas Gleixner Signed-off-by: Shaohua Li --- arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c index 1afd3f3..8af04af 100644 --- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c +++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c @@ -1036,9 +1036,17 @@ static int rdtgroup_rmdir(struct kernfs_node *kn) return ret; } +static int rdtgroup_show_options(struct seq_file *seq, struct kernfs_root *kf) +{ + if (rdt_resources_all[RDT_RESOURCE_L3DATA].enabled) + seq_puts(seq, ",cdp"); + return 0; +} + static struct kernfs_syscall_ops rdtgroup_kf_syscall_ops = { - .mkdir = rdtgroup_mkdir, - .rmdir = rdtgroup_rmdir, + .mkdir = rdtgroup_mkdir, + .rmdir = rdtgroup_rmdir, + .show_options = rdtgroup_show_options, }; static int __init rdtgroup_setup_root(void) -- 2.9.3