* [PATCH] x86/intel_rdt: Fix incorrect returned value when creating rdgroup sub-directory in resctrl file system
@ 2018-02-23 3:26 Fenghua Yu
2018-02-23 7:19 ` [tip:x86/urgent] " tip-bot for Wang Hui
0 siblings, 1 reply; 2+ messages in thread
From: Fenghua Yu @ 2018-02-23 3:26 UTC (permalink / raw)
To: Thomas Gleixner
Cc: Tony Luck, Shivappa, Vikas, Ravi V Shankar, Xiaochen Shen,
linux-kernel, x86, Wang Hui, Zhang Yanfei, Fenghua Yu
From: Wang Hui <john.wanghui@huawei.com>
If no monitoring feature is detected because all monitoring features are
disabled during boot time or there is no monitoring feature in hardware,
creating rdtgroup sub-directory by "mkdir" command reports error:
#mkdir /sys/fs/resctrl/p1
mkdir: cannot create directory ‘/sys/fs/resctrl/p1’: No such file or
directory
But the sub-directory actually is generated and content is correct:
#ls /sys/fs/resctrl/p1
cpus cpus_list schemata tasks
The error is because rdtgroup_mkdir_ctrl_mon() returns non zero value after
the sub-directory is created and the returned value is reported as an error
to user.
Clear the returned value to report to user that the sub-directory is
actually created successfully.
Signed-off-by: Wang Hui <john.wanghui@huawei.com>
Signed-off-by: Zhang Yanfei <yanfei.zhang@huawei.com>
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
---
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
index bdab7d2f51af..fca759d272a1 100644
--- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
+++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
@@ -1804,6 +1804,7 @@ static int rdtgroup_mkdir_ctrl_mon(struct kernfs_node *parent_kn,
goto out_common_fail;
}
closid = ret;
+ ret = 0;
rdtgrp->closid = closid;
list_add(&rdtgrp->rdtgroup_list, &rdt_all_groups);
--
2.5.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [tip:x86/urgent] x86/intel_rdt: Fix incorrect returned value when creating rdgroup sub-directory in resctrl file system
2018-02-23 3:26 [PATCH] x86/intel_rdt: Fix incorrect returned value when creating rdgroup sub-directory in resctrl file system Fenghua Yu
@ 2018-02-23 7:19 ` tip-bot for Wang Hui
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Wang Hui @ 2018-02-23 7:19 UTC (permalink / raw)
To: linux-tip-commits
Cc: ravi.v.shankar, tony.luck, vikas.shivappa, yanfei.zhang,
torvalds, mingo, xiaochen.shen, john.wanghui, hpa, fenghua.yu,
linux-kernel, tglx, peterz
Commit-ID: 36e74d355297dde6e69a39c838d24710e442babe
Gitweb: https://git.kernel.org/tip/36e74d355297dde6e69a39c838d24710e442babe
Author: Wang Hui <john.wanghui@huawei.com>
AuthorDate: Thu, 22 Feb 2018 19:26:03 -0800
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 23 Feb 2018 08:03:21 +0100
x86/intel_rdt: Fix incorrect returned value when creating rdgroup sub-directory in resctrl file system
If no monitoring feature is detected because all monitoring features are
disabled during boot time or there is no monitoring feature in hardware,
creating rdtgroup sub-directory by "mkdir" command reports error:
mkdir: cannot create directory ‘/sys/fs/resctrl/p1’: No such file or directory
But the sub-directory actually is generated and content is correct:
cpus cpus_list schemata tasks
The error is because rdtgroup_mkdir_ctrl_mon() returns non zero value after
the sub-directory is created and the returned value is reported as an error
to user.
Clear the returned value to report to user that the sub-directory is
actually created successfully.
Signed-off-by: Wang Hui <john.wanghui@huawei.com>
Signed-off-by: Zhang Yanfei <yanfei.zhang@huawei.com>
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi V Shankar <ravi.v.shankar@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Vikas <vikas.shivappa@intel.com>
Cc: Xiaochen Shen <xiaochen.shen@intel.com>
Link: http://lkml.kernel.org/r/1519356363-133085-1-git-send-email-fenghua.yu@intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
index bdab7d2f51af..fca759d272a1 100644
--- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
+++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
@@ -1804,6 +1804,7 @@ static int rdtgroup_mkdir_ctrl_mon(struct kernfs_node *parent_kn,
goto out_common_fail;
}
closid = ret;
+ ret = 0;
rdtgrp->closid = closid;
list_add(&rdtgrp->rdtgroup_list, &rdt_all_groups);
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-02-23 7:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-23 3:26 [PATCH] x86/intel_rdt: Fix incorrect returned value when creating rdgroup sub-directory in resctrl file system Fenghua Yu
2018-02-23 7:19 ` [tip:x86/urgent] " tip-bot for Wang Hui
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.