)]}'
{
  "commit": "17497acbdce9506fd6a75115dee4ab80c3cc5ee5",
  "tree": "fc56c3784250dd79761f34c30e1a2218974eaf76",
  "parents": [
    "1cae13e75b7a7848c03138636d4eb8d8a5054dd5"
  ],
  "author": {
    "name": "Tejun Heo",
    "email": "tj@kernel.org",
    "time": "Wed Sep 24 13:31:50 2014 -0400"
  },
  "committer": {
    "name": "Tejun Heo",
    "email": "tj@kernel.org",
    "time": "Wed Sep 24 13:37:21 2014 -0400"
  },
  "message": "blk-mq, percpu_ref: start q-\u003emq_usage_counter in atomic mode\n\nblk-mq uses percpu_ref for its usage counter which tracks the number\nof in-flight commands and used to synchronously drain the queue on\nfreeze.  percpu_ref shutdown takes measureable wallclock time as it\ninvolves a sched RCU grace period.  This means that draining a blk-mq\ntakes measureable wallclock time.  One would think that this shouldn\u0027t\nmatter as queue shutdown should be a rare event which takes place\nasynchronously w.r.t. userland.\n\nUnfortunately, SCSI probing involves synchronously setting up and then\ntearing down a lot of request_queues back-to-back for non-existent\nLUNs.  This means that SCSI probing may take above ten seconds when\nscsi-mq is used.\n\n  [    0.949892] scsi host0: Virtio SCSI HBA\n  [    1.007864] scsi 0:0:0:0: Direct-Access     QEMU     QEMU HARDDISK    1.1. PQ: 0 ANSI: 5\n  [    1.021299] scsi 0:0:1:0: Direct-Access     QEMU     QEMU HARDDISK    1.1. PQ: 0 ANSI: 5\n  [    1.520356] tsc: Refined TSC clocksource calibration: 2491.910 MHz\n\n  \u003cstall\u003e\n\n  [   16.186549] sd 0:0:0:0: Attached scsi generic sg0 type 0\n  [   16.190478] sd 0:0:1:0: Attached scsi generic sg1 type 0\n  [   16.194099] osd: LOADED open-osd 0.2.1\n  [   16.203202] sd 0:0:0:0: [sda] 31457280 512-byte logical blocks: (16.1 GB/15.0 GiB)\n  [   16.208478] sd 0:0:0:0: [sda] Write Protect is off\n  [   16.211439] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn\u0027t support DPO or FUA\n  [   16.218771] sd 0:0:1:0: [sdb] 31457280 512-byte logical blocks: (16.1 GB/15.0 GiB)\n  [   16.223264] sd 0:0:1:0: [sdb] Write Protect is off\n  [   16.225682] sd 0:0:1:0: [sdb] Write cache: enabled, read cache: enabled, doesn\u0027t support DPO or FUA\n\nThis is also the reason why request_queues start in bypass mode which\nis ended on blk_register_queue() as shutting down a fully functional\nqueue also involves a RCU grace period and the queues for non-existent\nSCSI devices never reach registration.\n\nblk-mq basically needs to do the same thing - start the mq in a\ndegraded mode which is faster to shut down and then make it fully\nfunctional only after the queue reaches registration.  percpu_ref\nrecently grew facilities to force atomic operation until explicitly\nswitched to percpu mode, which can be used for this purpose.  This\npatch makes blk-mq initialize q-\u003emq_usage_counter in atomic mode and\nswitch it to percpu mode only once blk_register_queue() is reached.\n\nNote that this issue was previously worked around by 0a30288da1ae\n(\"blk-mq, percpu_ref: implement a kludge for SCSI blk-mq stall during\nprobe\") for v3.17.  The temp fix was reverted in preparation of adding\npersistent atomic mode to percpu_ref by 9eca80461a45 (\"Revert \"blk-mq,\npercpu_ref: implement a kludge for SCSI blk-mq stall during probe\"\").\nThis patch and the prerequisite percpu_ref changes will be merged\nduring v3.18 devel cycle.\n\nSigned-off-by: Tejun Heo \u003ctj@kernel.org\u003e\nReported-by: Christoph Hellwig \u003chch@infradead.org\u003e\nLink: http://lkml.kernel.org/g/20140919113815.GA10791@lst.de\nFixes: add703fda981 (\"blk-mq: use percpu_ref for mq usage count\")\nReviewed-by: Kent Overstreet \u003ckmo@daterainc.com\u003e\nCc: Jens Axboe \u003caxboe@kernel.dk\u003e\nCc: Johannes Weiner \u003channes@cmpxchg.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "ed521786755570989dad96a14613be5ae80e7d3f",
      "old_mode": 33188,
      "old_path": "block/blk-mq-sysfs.c",
      "new_id": "371d8800b48a631c9807bce20f1e973a4c3a35b8",
      "new_mode": 33188,
      "new_path": "block/blk-mq-sysfs.c"
    },
    {
      "type": "modify",
      "old_id": "d85fe01c44efc59606d32cb6291307fab2fa3098",
      "old_mode": 33188,
      "old_path": "block/blk-mq.c",
      "new_id": "38f4a165640dd0aba321bb3196d8b1d1996635c1",
      "new_mode": 33188,
      "new_path": "block/blk-mq.c"
    },
    {
      "type": "modify",
      "old_id": "17f5c84ce7bfb588a5a34bc244a7ac38067b4391",
      "old_mode": 33188,
      "old_path": "block/blk-sysfs.c",
      "new_id": "521ae9089c50c704af07d643cd7cf3729e259327",
      "new_mode": 33188,
      "new_path": "block/blk-sysfs.c"
    },
    {
      "type": "modify",
      "old_id": "a1e31f274fcd55f7cfff245c8516d8e263206fb0",
      "old_mode": 33188,
      "old_path": "include/linux/blk-mq.h",
      "new_id": "c13a0c09faea8be17286135e7c8cf4d542bc9c41",
      "new_mode": 33188,
      "new_path": "include/linux/blk-mq.h"
    }
  ]
}
