[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [GIT PULL] (xen) stable/for-jens-3.10 xenwatch: page allocation failure: order:7, mode:0x10c0d0
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@xxxxxxxxxx> > --- > 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 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |