All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: Sander Eikelenboom <linux@eikelenboom.it>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	David Vrabel <david.vrabel@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [GIT PULL] (xen) stable/for-jens-3.10 xenwatch: page allocation failure: order:7, mode:0x10c0d0
Date: Thu, 25 Apr 2013 17:38:22 +0100	[thread overview]
Message-ID: <51795BFE.3010604@citrix.com> (raw)
In-Reply-To: <51795123.1040800@citrix.com>

On 25/04/13 16:52, Roger Pau Monné wrote:
> 
> [PATCH] xen-blkback: allocate list of pending reqs in small chunks
> 
> Allocate pending requests in smaller chunks instead of allocating them
> all at the same time.
> 
> Also remove the global array of pending_reqs, it is no longer
> necessary.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
>  drivers/block/xen-blkback/common.h |    2 -
>  drivers/block/xen-blkback/xenbus.c |   41 ++++++++++++++++++++++-------------
>  2 files changed, 26 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback/common.h
> index 1ac53da..2bbda8637 100644
> --- a/drivers/block/xen-blkback/common.h
> +++ b/drivers/block/xen-blkback/common.h
> @@ -297,8 +297,6 @@ struct xen_blkif {
>  	int			free_pages_num;
>  	struct list_head	free_pages;
>  
> -	/* Allocation of pending_reqs */
> -	struct pending_req	*pending_reqs;
>  	/* List of all 'pending_req' available */
>  	struct list_head	pending_free;
>  	/* And its spinlock. */
> diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
> index afab208..ceefbe4 100644
> --- a/drivers/block/xen-blkback/xenbus.c
> +++ b/drivers/block/xen-blkback/xenbus.c
> @@ -105,6 +105,7 @@ static void xen_update_blkif_status(struct xen_blkif *blkif)
>  static struct xen_blkif *xen_blkif_alloc(domid_t domid)
>  {
>  	struct xen_blkif *blkif;
> +	struct pending_req *req, *n;
>  	int i;
>  
>  	BUILD_BUG_ON(MAX_INDIRECT_PAGES > BLKIF_MAX_INDIRECT_PAGES_PER_REQUEST);
> @@ -127,22 +128,29 @@ static struct xen_blkif *xen_blkif_alloc(domid_t domid)
>  	blkif->free_pages_num = 0;
>  	atomic_set(&blkif->persistent_gnt_in_use, 0);
>  
> -	blkif->pending_reqs = kcalloc(XEN_BLKIF_REQS,
> -	                              sizeof(blkif->pending_reqs[0]),
> -	                              GFP_KERNEL);
> -	if (!blkif->pending_reqs) {
> -		kmem_cache_free(xen_blkif_cachep, blkif);
> -		return ERR_PTR(-ENOMEM);
> -	}
>  	INIT_LIST_HEAD(&blkif->pending_free);
> +
> +	for (i = 0; i < XEN_BLKIF_REQS; i++) {
> +		req = kzalloc(sizeof(*req), GFP_KERNEL);

This still requires an order 2 allocation, right?  Can you make further
changes to make all allocations order 0?

> +		if (!req)
> +			goto fail;
> +		list_add_tail(&req->free_list,
> +		              &blkif->pending_free);
> +	}

David

  reply	other threads:[~2013-04-25 16:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-19 14:44 [GIT PULL] (xen) stable/for-jens-3.10 Konrad Rzeszutek Wilk
2013-04-24 18:16 ` [GIT PULL] (xen) stable/for-jens-3.10 xenwatch: page allocation failure: order:7, mode:0x10c0d0 Sander Eikelenboom
2013-04-25  8:35   ` Roger Pau Monné
2013-04-25  8:40     ` Sander Eikelenboom
2013-04-25  8:43     ` Roger Pau Monné
2013-04-25 12:32       ` Sander Eikelenboom
2013-04-25 12:39         ` Roger Pau Monné
2013-04-25 15:52           ` Roger Pau Monné
2013-04-25 16:38             ` David Vrabel [this message]
2013-04-25 10:04   ` David Vrabel
2013-04-29 15:46   ` [Xen-devel] " Konrad Rzeszutek Wilk
2013-04-29 16:05     ` Sander Eikelenboom
2013-04-29 16:05       ` Sander Eikelenboom
2013-05-04  7:34       ` [Xen-devel] " Sander Eikelenboom
2013-05-04  7:34         ` Sander Eikelenboom
2013-05-06  9:00         ` Roger Pau Monné
2013-04-29 19:14     ` Jens Axboe

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=51795BFE.3010604@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux@eikelenboom.it \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /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.