All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Cc: Ian Campbell <Ian.Campbell@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Keir Fraser <keir@xen.org>, Tim Deegan <tim@xen.org>
Subject: Re: [PATCH] sysctl: adjust XEN_SYSCTL_cputopoinfo behavior
Date: Mon, 13 Jul 2015 13:43:32 -0400	[thread overview]
Message-ID: <55A3F8C4.2020509@oracle.com> (raw)
In-Reply-To: <55A3FB110200007800090488@mail.emea.novell.com>

On 07/13/2015 11:53 AM, Jan Beulich wrote:
> The new function's implementation, other than the original one of
> XEN_SYSCTL_topologyinfo, didn't allow the caller to get what it needs
> (if e.g. it's after the data for just one specific CPU) with just one
> hypercall, without caring about the total number of CPUs in the system.

Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

Would we want a similar update for XEN_SYSCTL_numainfo?


-boris


>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/common/sysctl.c
> +++ b/xen/common/sysctl.c
> @@ -358,15 +358,9 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xe
>           {
>               xen_sysctl_cputopo_t cputopo = { 0 };
>   
> -            if ( ti->num_cpus < num_cpus )
> -            {
> -                ret = -ENOBUFS;
> -                i = num_cpus;
> -            }
> -            else
> -                i = 0;
> -
> -            for ( ; i < num_cpus; i++ )
> +            if ( num_cpus > ti->num_cpus )
> +                num_cpus = ti->num_cpus;
> +            for ( i = 0; i < num_cpus; ++i )
>               {
>                   if ( cpu_present(i) )
>                   {
> @@ -393,7 +387,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xe
>           else
>               i = num_cpus;
>   
> -        if ( (!ret || (ret == -ENOBUFS)) && (ti->num_cpus != i) )
> +        if ( !ret && (ti->num_cpus != i) )
>           {
>               ti->num_cpus = i;
>               if ( __copy_field_to_guest(u_sysctl, op,
> --- a/xen/include/public/sysctl.h
> +++ b/xen/include/public/sysctl.h
> @@ -482,10 +482,11 @@ DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cputo
>    *  - otherwise it's the number of entries in 'cputopo'
>    *
>    * OUT:
> - *  - If 'num_cpus' is less than the number Xen needs to write, -ENOBUFS shall
> - *    be returned and 'num_cpus' updated to reflect the intended number.
> - *  - On success, 'num_cpus' shall indicate the number of entries written, which
> - *    may be less than the maximum.
> + *  - If 'num_cpus' is less than the number Xen wants to write but the handle
> + *    handle is not a NULL one, partial data gets returned and 'num_cpus' gets
> + *    updated to reflect the intended number.
> + *  - Otherwise, 'num_cpus' shall indicate the number of entries written, which
> + *    may be less than the input value.
>    */
>   struct xen_sysctl_cputopoinfo {
>       uint32_t num_cpus;
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

  reply	other threads:[~2015-07-13 17:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-13 15:53 [PATCH] sysctl: adjust XEN_SYSCTL_cputopoinfo behavior Jan Beulich
2015-07-13 17:43 ` Boris Ostrovsky [this message]
2015-07-14  9:41   ` Jan Beulich
2015-07-15 15:51 ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55A3F8C4.2020509@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=Ian.Campbell@eu.citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=keir@xen.org \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.