All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Joe Jin <joe.jin@oracle.com>, <wei.liu2@citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jan Beulich <JBeulich@suse.com>
Cc: <netdev@vger.kernel.org>, <xen-devel@lists.xenproject.org>
Subject: Re: [Xen-devel] [PATCH V3 1/2] xen-netback: limit xen vif max queues number to online cpus
Date: Fri, 23 Oct 2015 10:51:59 +0100	[thread overview]
Message-ID: <562A033F.10702@citrix.com> (raw)
In-Reply-To: <562A018C.9060708@oracle.com>

On 23/10/15 10:44, Joe Jin wrote:
> Should not allocate xen vif queues number more than online cpus.
>
> Signed-off-by: Joe Jin <joe.jin@oracle.com>
> Cc: Jan Beulich <JBeulich@suse.com>
> Cc: Wei Liu <wei.liu2@citrix.com>
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> ---
>  drivers/net/xen-netback/netback.c |   28 ++++++++++++++++++++++------
>  1 files changed, 22 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
> index ec98d43..021dcb0 100644
> --- a/drivers/net/xen-netback/netback.c
> +++ b/drivers/net/xen-netback/netback.c
> @@ -68,7 +68,9 @@ unsigned int rx_stall_timeout_msecs = 60000;
>  module_param(rx_stall_timeout_msecs, uint, 0444);
>  
>  unsigned int xenvif_max_queues;
> -module_param_named(max_queues, xenvif_max_queues, uint, 0644);
> +static int xennet_set_max_queues(const char *val, struct kernel_param *kp);
> +module_param_call(max_queues, xennet_set_max_queues, param_get_uint,
> +		  &xenvif_max_queues, 0644);
>  MODULE_PARM_DESC(max_queues,
>  		 "Maximum number of queues per virtual interface");
>  
> @@ -107,6 +109,20 @@ static struct xen_netif_rx_response *make_rx_response(struct xenvif_queue *queue
>  					     u16      size,
>  					     u16      flags);
>  
> +static int xennet_set_max_queues(const char *val, struct kernel_param *kp)
> +{
> +	unsigned int cpus = num_online_cpus();

This calculation is problematic in the scenario where a guest boots up,
then has more cpus hotplugged in, then wants to set up a sensible number
of queues.

~Andrew

  reply	other threads:[~2015-10-23  9:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-23  9:42 [PATCH V3 0/2] limit xen vnic max queues number to online cpus number Joe Jin
2015-10-23  9:44 ` [PATCH V3 1/2] xen-netback: limit xen vif max queues number to online cpus Joe Jin
2015-10-23  9:44 ` Joe Jin
2015-10-23  9:51   ` Andrew Cooper [this message]
2015-10-23  9:51   ` Andrew Cooper
2015-10-26 14:54   ` Wei Liu
2015-10-26 14:54   ` Wei Liu
2015-10-23  9:45 ` [PATCH V3 2/2] xen-netfront: limit vnic max_queues " Joe Jin
2015-10-23  9:45 ` Joe Jin
2015-10-23  9:50 ` [Xen-devel] [PATCH V3 0/2] limit xen vnic max queues number to online cpus number Andrew Cooper
2015-10-23  9:50 ` Andrew Cooper

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=562A033F.10702@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=davem@davemloft.net \
    --cc=ian.campbell@citrix.com \
    --cc=joe.jin@oracle.com \
    --cc=konrad.wilk@oracle.com \
    --cc=netdev@vger.kernel.org \
    --cc=wei.liu2@citrix.com \
    --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.