[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v11 6/9] x86: collect global QoS monitoring information



>>> On 23.06.14 at 08:55, <dongxiao.xu@xxxxxxxxx> wrote:
>> From: Jan Beulich [mailto:JBeulich@xxxxxxxx]
>> >>> On 20.06.14 at 16:31, <dongxiao.xu@xxxxxxxxx> 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


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.