在 2018年3月31日,上午11:53,Zefan Li <lizefan@xxxxxxxxxx> 写道: > > Hi Chengguang, > > On 2018/3/30 8:50, cgxu519@xxxxxxx wrote: >> 在 2018年3月29日,下午7:26,Marian Marinov <kernel@xxxxxxxx> 写道: >>> >>> On 03/27/2018 06:20 PM, Chengguang Xu wrote: >>>>> Sent: Tuesday, March 27, 2018 at 9:58 PM >>>>> From: "Tejun Heo" <tj@xxxxxxxxxx> >>>>> To: "Chengguang Xu" <cgxu519@xxxxxxx> >>>>> Cc: lizefan@xxxxxxxxxx, cgroups@xxxxxxxxxxxxxxx >>>>> Subject: Re: [PATCH RFC] cpuset: change error code to -EPERM from -ENOSPC >>>>> >>>>> On Tue, Mar 27, 2018 at 06:02:24PM +0800, Chengguang Xu wrote: >>>>>> When adding task to cpuset with empty cpus_allowed or empty mems_allowed, >>>>>> there is an error with code -ENOSPC, it is a little bit confusing, >>>>>> so change error code to -EPERM for better understanding. >>>>>> >>>>>> Signed-off-by: Chengguang Xu <cgxu519@xxxxxxx> >>>>> >>>>> I don't see why we'd change this or how EPERM is necessarily more >>>>> intuitive here. >>>> >>>> After changing the error code, error message showed to user will change >>>> from >>>> >>>> $ echo $$ > /sys/fs/cgroup/cpuset/2/tasks >>>> -bash: echo: write error: No space left on device >>>> >>>> to >>>> >>>> $ echo $$ > /sys/fs/cgroup/cpuset/2/tasks >>>> -bash: echo: write error: Operation not permitted >>>> >>>> Isn't it more understandable? IIUC, the logic here is for prohibiting attaching or >>>> changing operations. >>> >>> I somewhat agree that "Operation not permitted" is a bit more meaningful. >>> However this is something that has been in the kernel for a lot of years and changing it to another error message, that is also not the actual cause is not solving anyone's problems with this ;( >> >> Actually, the motivation of this patch is from my experience. >> I encountered -ENOSPC when I try to manipulate cpuset, then I had no idea about the reason >> at all, so I had to dive into the code to analyze the root cause, but I think there are also >> many sysadmins do not understand the code, so meaningful error message is much helpful to >> them. >> >> IMHO, it’s a trivial change and it will not bring side effect so the change would not be so >> difficult though the -ENOSPC has been in kernel for a long time. >> > > You don't have to dive into cpuset internal implmentation. There's document > you can refer to. > > http://man7.org/linux/man-pages/man7/cpuset.7.html > > ENOSPC Attempted to write(2) the process ID (PID) of a process to a > cpuset tasks file when the cpuset had an empty cpuset.cpus or > empty cpuset.mems setting. Hi Zefan Thanks for your reminder. It’s indeed helpful info. Cheers, Chengguang. > >> >>> >>> The other thing is, that "Operation not permitted" may push the sysadmins in completely different search, like is it a SELinux related problem. >> >> I also propose to add additional warning message here to give some hints to sysadmins, >> but I guess mismatched warning/error messages will also cause users’ confusing. >> >> >> Thanks, >> Chengguang. >> >> . >> > > -- > To unsubscribe from this list: send the line "unsubscribe cgroups" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe cgroups" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html