From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel 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 Message-ID: <51795BFE.3010604@citrix.com> References: <20130419144401.GA14700@phenom.dumpdata.com> <1094538380.20130424201637@eikelenboom.it> <5178EADF.4020501@citrix.com> <5178ECB5.6060709@citrix.com> <44354459.20130425143233@eikelenboom.it> <51792417.2090302@citrix.com> <51795123.1040800@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <51795123.1040800@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= Cc: Sander Eikelenboom , "xen-devel@lists.xensource.com" , David Vrabel , Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org On 25/04/13 16:52, Roger Pau Monn=E9 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=E9 > --- > 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-blkba= ck/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-blkba= ck/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 do= mid) > blkif->free_pages_num =3D 0; > atomic_set(&blkif->persistent_gnt_in_use, 0); > = > - blkif->pending_reqs =3D 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 =3D 0; i < XEN_BLKIF_REQS; i++) { > + req =3D 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