]> exis.tech > repos - linux.git/commitdiff
Merge commit 'v2.6.39' into for-2.6.40/core
authorJens Axboe <jaxboe@fusionio.com>
Fri, 20 May 2011 18:33:15 +0000 (20:33 +0200)
committerJens Axboe <jaxboe@fusionio.com>
Fri, 20 May 2011 18:33:15 +0000 (20:33 +0200)
Since for-2.6.40/core was forked off the 2.6.39 devel tree, we've
had churn in the core area that makes it difficult to handle
patches for eg cfq or blk-throttle. Instead of requiring that they
be based in older versions with bugs that have been fixed later
in the rc cycle, merge in 2.6.39 final.

Also fixes up conflicts in the below files.

Conflicts:
drivers/block/paride/pcd.c
drivers/cdrom/viocd.c
drivers/ide/ide-cd.c

Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
1  2 
block/blk-sysfs.c
block/blk.h
block/elevator.c
include/linux/blkdev.h

diff --combined block/blk-sysfs.c
index 53bd0c77bfda1d08e0febc998bd3b74ea68d3250,bd236313f35d59bd08da5a3d375cc29eed6fd86f..d935bd859c87bc1c9a0e39eb61438583f91690f9
@@@ -66,14 -66,14 +66,14 @@@ queue_requests_store(struct request_que
  
        if (rl->count[BLK_RW_SYNC] >= q->nr_requests) {
                blk_set_queue_full(q, BLK_RW_SYNC);
-       } else if (rl->count[BLK_RW_SYNC]+1 <= q->nr_requests) {
+       } else {
                blk_clear_queue_full(q, BLK_RW_SYNC);
                wake_up(&rl->wait[BLK_RW_SYNC]);
        }
  
        if (rl->count[BLK_RW_ASYNC] >= q->nr_requests) {
                blk_set_queue_full(q, BLK_RW_ASYNC);
-       } else if (rl->count[BLK_RW_ASYNC]+1 <= q->nr_requests) {
+       } else {
                blk_clear_queue_full(q, BLK_RW_ASYNC);
                wake_up(&rl->wait[BLK_RW_ASYNC]);
        }
@@@ -152,8 -152,7 +152,8 @@@ static ssize_t queue_discard_granularit
  
  static ssize_t queue_discard_max_show(struct request_queue *q, char *page)
  {
 -      return queue_var_show(q->limits.max_discard_sectors << 9, page);
 +      return sprintf(page, "%llu\n",
 +                     (unsigned long long)q->limits.max_discard_sectors << 9);
  }
  
  static ssize_t queue_discard_zeroes_data_show(struct request_queue *q, char *page)
@@@ -509,8 -508,10 +509,10 @@@ int blk_register_queue(struct gendisk *
                return ret;
  
        ret = kobject_add(&q->kobj, kobject_get(&dev->kobj), "%s", "queue");
-       if (ret < 0)
+       if (ret < 0) {
+               blk_trace_remove_sysfs(dev);
                return ret;
+       }
  
        kobject_uevent(&q->kobj, KOBJ_ADD);
  
diff --combined block/blk.h
index 83e4bff36201de9d7ffcf5c1f850e2f14eb4ee74,61263463e38e17be7c7f742f0bbe9233eec2ecd2..1f798b5a6f194b6429e33899b441fec4c83da31e
@@@ -22,7 -22,6 +22,6 @@@ void blk_rq_timed_out_timer(unsigned lo
  void blk_delete_timer(struct request *);
  void blk_add_timer(struct request *);
  void __generic_unplug_device(struct request_queue *);
- void blk_run_queue_async(struct request_queue *q);
  
  /*
   * Internal atomic flags for request handling
@@@ -62,26 -61,7 +61,26 @@@ static inline struct request *__elv_nex
                        rq = list_entry_rq(q->queue_head.next);
                        return rq;
                }
 -
 +              /*
 +               * Flush request is running and flush request isn't queueable
 +               * in the drive, we can hold the queue till flush request is
 +               * finished. Even we don't do this, driver can't dispatch next
 +               * requests and will requeue them. And this can improve
 +               * throughput too. For example, we have request flush1, write1,
 +               * flush 2. flush1 is dispatched, then queue is hold, write1
 +               * isn't inserted to queue. After flush1 is finished, flush2
 +               * will be dispatched. Since disk cache is already clean,
 +               * flush2 will be finished very soon, so looks like flush2 is
 +               * folded to flush1.
 +               * Since the queue is hold, a flag is set to indicate the queue
 +               * should be restarted later. Please see flush_end_io() for
 +               * details.
 +               */
 +              if (q->flush_pending_idx != q->flush_running_idx &&
 +                              !queue_flush_queueable(q)) {
 +                      q->flush_queue_delayed = 1;
 +                      return NULL;
 +              }
                if (!q->elevator->ops->elevator_dispatch_fn(q, 0))
                        return NULL;
        }
diff --combined block/elevator.c
index 3cd0d8c84902a98dce78c33ef89f54ae858a010d,45ca1e34f58249ff5b3838c0ec89fbc1c6ea2bb7..2a0b653c90fde6df27b5edc88f8421f25c18eca2
@@@ -155,8 -155,13 +155,8 @@@ static struct elevator_type *elevator_g
  
        e = elevator_find(name);
        if (!e) {
 -              char elv[ELV_NAME_MAX + strlen("-iosched")];
 -
                spin_unlock(&elv_list_lock);
 -
 -              snprintf(elv, sizeof(elv), "%s-iosched", name);
 -
 -              request_module("%s", elv);
 +              request_module("%s-iosched", name);
                spin_lock(&elv_list_lock);
                e = elevator_find(name);
        }
@@@ -666,7 -671,8 +666,8 @@@ void __elv_add_request(struct request_q
                        q->boundary_rq = rq;
                }
        } else if (!(rq->cmd_flags & REQ_ELVPRIV) &&
-                   where == ELEVATOR_INSERT_SORT)
+                   (where == ELEVATOR_INSERT_SORT ||
+                    where == ELEVATOR_INSERT_SORT_MERGE))
                where = ELEVATOR_INSERT_BACK;
  
        switch (where) {
diff --combined include/linux/blkdev.h
index 520d8618ed762fa73463473baa2198fe1e3c73dc,2ad95fa1d130f8c8f5cfd68e5fe7a0108aec31d9..ae9091a684807ffcc95fa6c0fb6de3233383d4cf
@@@ -257,7 -257,7 +257,7 @@@ struct queue_limits 
        unsigned char           misaligned;
        unsigned char           discard_misaligned;
        unsigned char           cluster;
 -      signed char             discard_zeroes_data;
 +      unsigned char           discard_zeroes_data;
  };
  
  struct request_queue
         * for flush operations
         */
        unsigned int            flush_flags;
 +      unsigned int            flush_not_queueable:1;
 +      unsigned int            flush_queue_delayed:1;
        unsigned int            flush_pending_idx:1;
        unsigned int            flush_running_idx:1;
        unsigned long           flush_pending_since;
  #define       QUEUE_FLAG_SYNCFULL     3       /* read queue has been filled */
  #define QUEUE_FLAG_ASYNCFULL  4       /* write queue has been filled */
  #define QUEUE_FLAG_DEAD               5       /* queue being torn down */
- #define QUEUE_FLAG_REENTER    6       /* Re-entrancy avoidance */
- #define QUEUE_FLAG_ELVSWITCH  7       /* don't use elevator, just do FIFO */
- #define QUEUE_FLAG_BIDI               8       /* queue supports bidi requests */
- #define QUEUE_FLAG_NOMERGES     9     /* disable merge attempts */
- #define QUEUE_FLAG_SAME_COMP   10     /* force complete on same CPU */
- #define QUEUE_FLAG_FAIL_IO     11     /* fake timeout */
- #define QUEUE_FLAG_STACKABLE   12     /* supports request stacking */
- #define QUEUE_FLAG_NONROT      13     /* non-rotational device (SSD) */
+ #define QUEUE_FLAG_ELVSWITCH  6       /* don't use elevator, just do FIFO */
+ #define QUEUE_FLAG_BIDI               7       /* queue supports bidi requests */
+ #define QUEUE_FLAG_NOMERGES     8     /* disable merge attempts */
+ #define QUEUE_FLAG_SAME_COMP  9       /* force complete on same CPU */
+ #define QUEUE_FLAG_FAIL_IO     10     /* fake timeout */
+ #define QUEUE_FLAG_STACKABLE   11     /* supports request stacking */
+ #define QUEUE_FLAG_NONROT      12     /* non-rotational device (SSD) */
  #define QUEUE_FLAG_VIRT        QUEUE_FLAG_NONROT /* paravirt device */
- #define QUEUE_FLAG_IO_STAT     15     /* do IO stats */
- #define QUEUE_FLAG_DISCARD     16     /* supports DISCARD */
- #define QUEUE_FLAG_NOXMERGES   17     /* No extended merges */
- #define QUEUE_FLAG_ADD_RANDOM  18     /* Contributes to random pool */
- #define QUEUE_FLAG_SECDISCARD  19     /* supports SECDISCARD */
+ #define QUEUE_FLAG_IO_STAT     13     /* do IO stats */
+ #define QUEUE_FLAG_DISCARD     14     /* supports DISCARD */
+ #define QUEUE_FLAG_NOXMERGES   15     /* No extended merges */
+ #define QUEUE_FLAG_ADD_RANDOM  16     /* Contributes to random pool */
+ #define QUEUE_FLAG_SECDISCARD  17     /* supports SECDISCARD */
  
  #define QUEUE_FLAG_DEFAULT    ((1 << QUEUE_FLAG_IO_STAT) |            \
                                 (1 << QUEUE_FLAG_STACKABLE)    |       \
@@@ -701,6 -698,7 +700,7 @@@ extern void blk_sync_queue(struct reque
  extern void __blk_stop_queue(struct request_queue *q);
  extern void __blk_run_queue(struct request_queue *q);
  extern void blk_run_queue(struct request_queue *);
+ extern void blk_run_queue_async(struct request_queue *q);
  extern int blk_rq_map_user(struct request_queue *, struct request *,
                           struct rq_map_data *, void __user *, unsigned long,
                           gfp_t);
@@@ -845,7 -843,6 +845,7 @@@ extern void blk_queue_softirq_done(stru
  extern void blk_queue_rq_timed_out(struct request_queue *, rq_timed_out_fn *);
  extern void blk_queue_rq_timeout(struct request_queue *, unsigned int);
  extern void blk_queue_flush(struct request_queue *q, unsigned int flush);
 +extern void blk_queue_flush_queueable(struct request_queue *q, bool queueable);
  extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev);
  
  extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *);
@@@ -1069,16 -1066,13 +1069,16 @@@ static inline int queue_limit_discard_a
  {
        unsigned int alignment = (sector << 9) & (lim->discard_granularity - 1);
  
 +      if (!lim->max_discard_sectors)
 +              return 0;
 +
        return (lim->discard_granularity + lim->discard_alignment - alignment)
                & (lim->discard_granularity - 1);
  }
  
  static inline unsigned int queue_discard_zeroes_data(struct request_queue *q)
  {
 -      if (q->limits.discard_zeroes_data == 1)
 +      if (q->limits.max_discard_sectors && q->limits.discard_zeroes_data == 1)
                return 1;
  
        return 0;
@@@ -1117,11 -1111,6 +1117,11 @@@ static inline unsigned int block_size(s
        return bdev->bd_block_size;
  }
  
 +static inline bool queue_flush_queueable(struct request_queue *q)
 +{
 +      return !q->flush_not_queueable;
 +}
 +
  typedef struct {struct page *v;} Sector;
  
  unsigned char *read_dev_sector(struct block_device *, sector_t, Sector *);