WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Xen

xen-devel

[Top] [All Lists]

[Xen-devel] [PATCH 4/9] blkio-cgroup-v12: Refactoring io-context initial

To: linux-kernel@xxxxxxxxxxxxxxx, dm-devel@xxxxxxxxxx, containers@xxxxxxxxxxxxxxxxxxxxxxxxxx, virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx, agk@xxxxxxxxxx
Subject: [Xen-devel] [PATCH 4/9] blkio-cgroup-v12: Refactoring io-context initialization
From: Ryo Tsuruta <ryov@xxxxxxxxxxxxx>
Date: 2009年9月14日 21:29:46 +0900 (JST)
Cc:
Delivery-date: 2009年9月14日 05:32:33 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20090914.212909.71094050.ryov@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20090914.212805.193688121.ryov@xxxxxxxxxxxxx> <20090914.212839.226798134.ryov@xxxxxxxxxxxxx> <20090914.212909.71094050.ryov@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
This patch refactors io_context initialization.
Signed-off-by: Hirokazu Takahashi <taka@xxxxxxxxxxxxx>
Signed-off-by: Ryo Tsuruta <ryov@xxxxxxxxxxxxx>
---
 block/blk-ioc.c | 30 +++++++++++++++++-------------
 include/linux/iocontext.h | 1 +
 2 files changed, 18 insertions(+), 13 deletions(-)
Index: linux-2.6.31/block/blk-ioc.c
===================================================================
--- linux-2.6.31.orig/block/blk-ioc.c
+++ linux-2.6.31/block/blk-ioc.c
@@ -84,24 +84,28 @@ void exit_io_context(void)
 }
 }
 
+void init_io_context(struct io_context *ioc)
+{
+ atomic_long_set(&ioc->refcount, 1);
+ atomic_set(&ioc->nr_tasks, 1);
+ spin_lock_init(&ioc->lock);
+ ioc->ioprio_changed = 0;
+ ioc->ioprio = 0;
+ ioc->last_waited = jiffies; /* doesn't matter... */
+ ioc->nr_batch_requests = 0; /* because this is 0 */
+ ioc->aic = NULL;
+ INIT_RADIX_TREE(&ioc->radix_root, GFP_ATOMIC | __GFP_HIGH);
+ INIT_HLIST_HEAD(&ioc->cic_list);
+ ioc->ioc_data = NULL;
+}
+
 struct io_context *alloc_io_context(gfp_t gfp_flags, int node)
 {
 struct io_context *ret;
 
 ret = kmem_cache_alloc_node(iocontext_cachep, gfp_flags, node);
- if (ret) {
- atomic_long_set(&ret->refcount, 1);
- atomic_set(&ret->nr_tasks, 1);
- spin_lock_init(&ret->lock);
- ret->ioprio_changed = 0;
- ret->ioprio = 0;
- ret->last_waited = jiffies; /* doesn't matter... */
- ret->nr_batch_requests = 0; /* because this is 0 */
- ret->aic = NULL;
- INIT_RADIX_TREE(&ret->radix_root, GFP_ATOMIC | __GFP_HIGH);
- INIT_HLIST_HEAD(&ret->cic_list);
- ret->ioc_data = NULL;
- }
+ if (ret)
+ init_io_context(ret);
 
 return ret;
 }
Index: linux-2.6.31/include/linux/iocontext.h
===================================================================
--- linux-2.6.31.orig/include/linux/iocontext.h
+++ linux-2.6.31/include/linux/iocontext.h
@@ -104,6 +104,7 @@ int put_io_context(struct io_context *io
 void exit_io_context(void);
 struct io_context *get_io_context(gfp_t gfp_flags, int node);
 struct io_context *alloc_io_context(gfp_t gfp_flags, int node);
+void init_io_context(struct io_context *ioc);
 void copy_io_context(struct io_context **pdst, struct io_context **psrc);
 #else
 static inline void exit_io_context(void)
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
Previous by Date: [Xen-devel] [PATCH 3/9] blkio-cgroup-v12: The new page_cgroup framework , Ryo Tsuruta
Next by Date: [Xen-devel] [PATCH 5/9] blkio-cgroup-v12: The body of blkio-cgroup , Ryo Tsuruta
Previous by Thread: [Xen-devel] [PATCH 3/9] blkio-cgroup-v12: The new page_cgroup framework , Ryo Tsuruta
Next by Thread: [Xen-devel] [PATCH 5/9] blkio-cgroup-v12: The body of blkio-cgroup , Ryo Tsuruta
Indexes: [Date] [Thread] [Top] [All Lists]

Copyright ©, Citrix Systems Inc. All rights reserved. Legal and Privacy
Citrix This site is hosted by Citrix

AltStyle によって変換されたページ (->オリジナル) /