From: "Jan Beulich" Subject: Re: [PATCH v11 6/9] x86: collect global QoS monitoring information Date: Mon, 23 Jun 2014 08:06:36 +0100 Message-ID: <53A7EE1C020000780001C49B@mail.emea.novell.com> References: <53A46C61020000780001C113@mail.emea.novell.com> <40776A41FC278F40B59438AD47D147A911A48853@SHSMSX104.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <40776A41FC278F40B59438AD47D147A911A48853@SHSMSX104.ccr.corp.intel.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dongxiao Xu Cc: "keir@xen.org" , "Ian.Campbell@citrix.com" , "stefano.stabellini@eu.citrix.com" , "George.Dunlap@eu.citrix.com" , "andrew.cooper3@citrix.com" , "Ian.Jackson@eu.citrix.com" , "xen-devel@lists.xen.org" , "dgdegra@tycho.nsa.gov" List-Id: xen-devel@lists.xenproject.org >>> On 23.06.14 at 08:55, wrote: >> From: Jan Beulich [mailto:JBeulich@suse.com] >> >>> On 20.06.14 at 16:31, wrote: >> > + { >> > + if ( cpu_to_socket(i) < 0 || cpu_to_socket(i) != socket ) >> > + continue; >> > + cpu = cpumask_any(per_cpu(cpu_core_mask, i)); >> > + if ( cpu < nr_cpu_ids ) >> > + { >> > + sysctl->u.pqos_monitor_op.data = cpu; >> > + break; >> > + } >> > + } >> > + >> > + if ( i == NR_CPUS ) >> > + ret = -EFAULT; >> >> -EFAULT? > > Here the intension is to tell we failed to select a CPU in this socket. > What errno do you prefer more? I suppose you know what -EFAULT means, so such a question should not even need discussing. But to answer your question anyway, in halfway comparable situations we tend to return -ESRCH, but -ENODEV might also be suitable (-EINVAL, while generally also possible, is already being used for way too many other cases, so I generally prefer less ambiguous error codes). I hope you get the point: Which of possibly multiple applicable error code you use is largely up to you, all I'm asking for is that you don't use inapplicable ones. Jan