Merge branch 'for-3.10/core' of git://git.kernel.dk/linux-block
Linus Torvalds [Wed, 8 May 2013 17:13:35 +0000 (10:13 -0700)]
Pull block core updates from Jens Axboe:

 - Major bit is Kents prep work for immutable bio vecs.

 - Stable candidate fix for a scheduling-while-atomic in the queue
   bypass operation.

 - Fix for the hang on exceeded rq->datalen 32-bit unsigned when merging
   discard bios.

 - Tejuns changes to convert the writeback thread pool to the generic
   workqueue mechanism.

 - Runtime PM framework, SCSI patches exists on top of these in James'
   tree.

 - A few random fixes.

* 'for-3.10/core' of git://git.kernel.dk/linux-block: (40 commits)
  relay: move remove_buf_file inside relay_close_buf
  partitions/efi.c: replace useless kzalloc's by kmalloc's
  fs/block_dev.c: fix iov_shorten() criteria in blkdev_aio_read()
  block: fix max discard sectors limit
  blkcg: fix "scheduling while atomic" in blk_queue_bypass_start
  Documentation: cfq-iosched: update documentation help for cfq tunables
  writeback: expose the bdi_wq workqueue
  writeback: replace custom worker pool implementation with unbound workqueue
  writeback: remove unused bdi_pending_list
  aoe: Fix unitialized var usage
  bio-integrity: Add explicit field for owner of bip_buf
  block: Add an explicit bio flag for bios that own their bvec
  block: Add bio_alloc_pages()
  block: Convert some code to bio_for_each_segment_all()
  block: Add bio_for_each_segment_all()
  bounce: Refactor __blk_queue_bounce to not use bi_io_vec
  raid1: use bio_copy_data()
  pktcdvd: Use bio_reset() in disabled code to kill bi_idx usage
  pktcdvd: use bio_copy_data()
  block: Add bio_copy_data()
  ...

25 files changed:
1  2 
block/blk-core.c
drivers/block/aoe/aoecmd.c
drivers/block/floppy.c
drivers/block/pktcdvd.c
drivers/block/rbd.c
drivers/md/md.c
drivers/md/raid1.c
drivers/md/raid10.c
drivers/md/raid5.c
drivers/message/fusion/mptsas.c
drivers/s390/block/dcssblk.c
drivers/scsi/libsas/sas_expander.c
fs/bio.c
fs/block_dev.c
fs/buffer.c
fs/direct-io.c
fs/fs-writeback.c
fs/gfs2/lops.c
fs/jfs/jfs_logmgr.c
include/linux/blk_types.h
include/linux/blkdev.h
include/trace/events/block.h
kernel/relay.c
mm/bounce.c
mm/page_io.c

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc drivers/md/md.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc fs/bio.c
Simple merge
diff --cc fs/block_dev.c
Simple merge
diff --cc fs/buffer.c
Simple merge
diff --cc fs/direct-io.c
Simple merge
@@@ -1028,59 -1009,39 +1009,40 @@@ void bdi_writeback_workfn(struct work_s
        struct backing_dev_info *bdi = wb->bdi;
        long pages_written;
  
 +      set_worker_desc("flush-%s", dev_name(bdi->dev));
        current->flags |= PF_SWAPWRITE;
-       set_freezable();
-       wb->last_active = jiffies;
-       /*
-        * Our parent may run at a different priority, just set us to normal
-        */
-       set_user_nice(current, 0);
-       trace_writeback_thread_start(bdi);
  
-       while (!kthread_freezable_should_stop(NULL)) {
+       if (likely(!current_is_workqueue_rescuer() ||
+                  list_empty(&bdi->bdi_list))) {
                /*
-                * Remove own delayed wake-up timer, since we are already awake
-                * and we'll take care of the periodic write-back.
+                * The normal path.  Keep writing back @bdi until its
+                * work_list is empty.  Note that this path is also taken
+                * if @bdi is shutting down even when we're running off the
+                * rescuer as work_list needs to be drained.
                 */
-               del_timer(&wb->wakeup_timer);
-               pages_written = wb_do_writeback(wb, 0);
+               do {
+                       pages_written = wb_do_writeback(wb, 0);
+                       trace_writeback_pages_written(pages_written);
+               } while (!list_empty(&bdi->work_list));
+       } else {
+               /*
+                * bdi_wq can't get enough workers and we're running off
+                * the emergency worker.  Don't hog it.  Hopefully, 1024 is
+                * enough for efficient IO.
+                */
+               pages_written = writeback_inodes_wb(&bdi->wb, 1024,
+                                                   WB_REASON_FORKER_THREAD);
                trace_writeback_pages_written(pages_written);
-               if (pages_written)
-                       wb->last_active = jiffies;
-               set_current_state(TASK_INTERRUPTIBLE);
-               if (!list_empty(&bdi->work_list) || kthread_should_stop()) {
-                       __set_current_state(TASK_RUNNING);
-                       continue;
-               }
-               if (wb_has_dirty_io(wb) && dirty_writeback_interval)
-                       schedule_timeout(msecs_to_jiffies(dirty_writeback_interval * 10));
-               else {
-                       /*
-                        * We have nothing to do, so can go sleep without any
-                        * timeout and save power. When a work is queued or
-                        * something is made dirty - we will be woken up.
-                        */
-                       schedule();
-               }
        }
  
-       /* Flush any work that raced with us exiting */
-       if (!list_empty(&bdi->work_list))
-               wb_do_writeback(wb, 1);
+       if (!list_empty(&bdi->work_list) ||
+           (wb_has_dirty_io(wb) && dirty_writeback_interval))
+               queue_delayed_work(bdi_wq, &wb->dwork,
+                       msecs_to_jiffies(dirty_writeback_interval * 10));
  
-       trace_writeback_thread_stop(bdi);
-       return 0;
+       current->flags &= ~PF_SWAPWRITE;
  }
  
  /*
   * Start writeback of `nr_pages' pages.  If `nr_pages' is zero, write back
   * the whole world.
diff --cc fs/gfs2/lops.c
Simple merge
Simple merge
@@@ -117,7 -116,8 +117,8 @@@ struct bio 
   * Flags starting here get preserved by bio_reset() - this includes
   * BIO_POOL_IDX()
   */
 -#define BIO_RESET_BITS        12
 -#define BIO_OWNS_VEC  12      /* bio_free() should free bvec */
 +#define BIO_RESET_BITS        13
++#define BIO_OWNS_VEC  13      /* bio_free() should free bvec */
  
  #define bio_flagged(bio, flag)        ((bio)->bi_flags & (1 << (flag)))
  
Simple merge
@@@ -279,9 -278,10 +279,9 @@@ TRACE_EVENT(block_bio_complete
        ),
  
        TP_fast_assign(
 -              __entry->dev            = bio->bi_bdev ?
 -                                        bio->bi_bdev->bd_dev : 0;
 +              __entry->dev            = bio->bi_bdev->bd_dev;
                __entry->sector         = bio->bi_sector;
-               __entry->nr_sector      = bio->bi_size >> 9;
+               __entry->nr_sector      = bio_sectors(bio);
                __entry->error          = error;
                blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size);
        ),
diff --cc kernel/relay.c
Simple merge
diff --cc mm/bounce.c
Simple merge
diff --cc mm/page_io.c
Simple merge