]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
block: Remove the control of complete cpu from bio.
authorTao Ma <boyu.mt@taobao.com>
Mon, 24 Oct 2011 14:11:30 +0000 (16:11 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 24 Oct 2011 14:11:30 +0000 (16:11 +0200)
bio originally has the functionality to set the complete cpu, but
it is broken.

Chirstoph said that "This code is unused, and from the all the
discussions lately pretty obviously broken.  The only thing keeping
it serves is creating more confusion and possibly more bugs."

And Jens replied with "We can kill bio_set_completion_cpu(). I'm fine
with leaving cpu control to the request based drivers, they are the
only ones that can toggle the setting anyway".

So this patch tries to remove all the work of controling complete cpu
from a bio.

Cc: Shaohua Li <shaohua.li@intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Tao Ma <boyu.mt@taobao.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-core.c
drivers/md/raid1.c
fs/bio.c
include/linux/bio.h
include/linux/blk_types.h

index 7e1523521c70cc6a37390cbbdecc6d3f96476b8c..da697936d220ec8200c51539abea5813e0e5d510 100644 (file)
@@ -1276,7 +1276,6 @@ out:
 
 void init_request_from_bio(struct request *req, struct bio *bio)
 {
-       req->cpu = bio->bi_comp_cpu;
        req->cmd_type = REQ_TYPE_FS;
 
        req->cmd_flags |= bio->bi_rw & REQ_COMMON_MASK;
@@ -1362,8 +1361,7 @@ get_rq:
         */
        init_request_from_bio(req, bio);
 
-       if (test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags) ||
-           bio_flagged(bio, BIO_CPU_AFFINE))
+       if (test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags))
                req->cpu = raw_smp_processor_id();
 
        plug = current->plug;
index d4ddfa62730147d7276d85fdf1e5e61441cdf1b9..2948a520f7ba354dc5c0e0305152127257443a45 100644 (file)
@@ -2172,7 +2172,6 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
                bio->bi_next = NULL;
                bio->bi_flags &= ~(BIO_POOL_MASK-1);
                bio->bi_flags |= 1 << BIO_UPTODATE;
-               bio->bi_comp_cpu = -1;
                bio->bi_rw = READ;
                bio->bi_vcnt = 0;
                bio->bi_idx = 0;
index 9bfade8a609bfa33c9f78b9f2faa9d01dfea9176..41c93c72224457179bda4ca18798b6f2add617c9 100644 (file)
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -255,7 +255,6 @@ void bio_init(struct bio *bio)
 {
        memset(bio, 0, sizeof(*bio));
        bio->bi_flags = 1 << BIO_UPTODATE;
-       bio->bi_comp_cpu = -1;
        atomic_set(&bio->bi_cnt, 1);
 }
 EXPORT_SYMBOL(bio_init);
index ce33e6868a2f57116ae76510f4dc5de183c2b8fd..a3c071c9e18934765e44b84d8330e9fd979d6dc4 100644 (file)
@@ -268,14 +268,6 @@ extern struct bio_vec *bvec_alloc_bs(gfp_t, int, unsigned long *, struct bio_set
 extern void bvec_free_bs(struct bio_set *, struct bio_vec *, unsigned int);
 extern unsigned int bvec_nr_vecs(unsigned short idx);
 
-/*
- * Allow queuer to specify a completion CPU for this bio
- */
-static inline void bio_set_completion_cpu(struct bio *bio, unsigned int cpu)
-{
-       bio->bi_comp_cpu = cpu;
-}
-
 /*
  * bio_set is used to allow other portions of the IO system to
  * allocate their own private memory pools for bio and iovec structures.
index 71fc53bb8f1c125908e59db97a0e33ba809368e2..4053cbd4490edb6530eee7bb332ab95138352d17 100644 (file)
@@ -59,8 +59,6 @@ struct bio {
 
        unsigned int            bi_max_vecs;    /* max bvl_vecs we can hold */
 
-       unsigned int            bi_comp_cpu;    /* completion CPU */
-
        atomic_t                bi_cnt;         /* pin count */
 
        struct bio_vec          *bi_io_vec;     /* the actual vec list */
@@ -93,11 +91,10 @@ struct bio {
 #define BIO_BOUNCED    5       /* bio is a bounce bio */
 #define BIO_USER_MAPPED 6      /* contains user pages */
 #define BIO_EOPNOTSUPP 7       /* not supported */
-#define BIO_CPU_AFFINE 8       /* complete bio on same CPU as submitted */
-#define BIO_NULL_MAPPED 9      /* contains invalid user pages */
-#define BIO_FS_INTEGRITY 10    /* fs owns integrity data, not block layer */
-#define BIO_QUIET      11      /* Make BIO Quiet */
-#define BIO_MAPPED_INTEGRITY 12/* integrity metadata has been remapped */
+#define BIO_NULL_MAPPED 8      /* contains invalid user pages */
+#define BIO_FS_INTEGRITY 9     /* fs owns integrity data, not block layer */
+#define BIO_QUIET      10      /* Make BIO Quiet */
+#define BIO_MAPPED_INTEGRITY 11/* integrity metadata has been remapped */
 #define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag)))
 
 /*