public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [PATCH] xen-blkback: allocate list of pending reqs in small chunks
Date: Fri, 26 Apr 2013 15:47:40 +0100	[thread overview]
Message-ID: <517A938C.6060703@citrix.com> (raw)
In-Reply-To: <1366983947-54578-1-git-send-email-roger.pau@citrix.com>

On 26/04/13 14:45, Roger Pau Monne wrote:
> Allocate pending requests in smaller chunks instead of allocating them
> all at the same time.
> 
> This change also removes the global array of pending_reqs, it is no
> longer necessay.
> 
> Variables related to the grant mapping have been grouped into a struct
> called "grant_page", this allows to allocate them in smaller chunks,
> and also improves memory locality.
> 
[...]
> diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
> index afab208..2841c0f 100644
> --- a/drivers/block/xen-blkback/xenbus.c
> +++ b/drivers/block/xen-blkback/xenbus.c
> @@ -127,22 +128,53 @@ 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);
> +
> +       pr_alert("sizeof req: %lu\n", sizeof(*req));

Stray pr_alert() here.

Looks good otherwise.

Reviewed-by: David Vrabel <david.vrabel@citrix.com>

David

  reply	other threads:[~2013-04-26 14:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-26 13:45 [PATCH] xen-blkback: allocate list of pending reqs in small chunks Roger Pau Monne
2013-04-26 14:47 ` David Vrabel [this message]
2013-04-29 18:37   ` Konrad Rzeszutek Wilk
2013-05-02  8:22     ` Roger Pau Monné

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=517A938C.6060703@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xen.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox