)]}'
{
  "commit": "96a55ffffa620665a6908b41e64e003dc440d5b0",
  "tree": "ed7751a972a752d4d6ca4189bcff9d97212d469d",
  "parents": [
    "cedc3ac0208cf0b0ba2e257affc8f1c525fc3a5d"
  ],
  "author": {
    "name": "Yu Kuai",
    "email": "yukuai3@huawei.com",
    "time": "Mon Nov 18 19:41:57 2024 +0800"
  },
  "committer": {
    "name": "Yu Kuai",
    "email": "yukuai@kernel.org",
    "time": "Wed Dec 18 20:00:43 2024 +0800"
  },
  "message": "md/md-bitmap: move bitmap_{start, end}write to md upper layer\n\nThere are two BUG reports that raid5 will hang at\nbitmap_startwrite([1],[2]), root cause is that bitmap start write and end\nwrite is unbalanced, and while reviewing raid5 code, it\u0027s found that\nbitmap operations can be optimized. For example, for a 4 disks raid5, with\nchunksize\u003d8k, if user issue a IO (0 + 48k) to the array:\n\n┌────────────────────────────────────────────────────────────┐\n│chunk 0                                                     │\n│      ┌────────────┬─────────────┬─────────────┬────────────┼\n│  sh0 │A0: 0 + 4k  │A1: 8k + 4k  │A2: 16k + 4k │A3: P       │\n│      ┼────────────┼─────────────┼─────────────┼────────────┼\n│  sh1 │B0: 4k + 4k │B1: 12k + 4k │B2: 20k + 4k │B3: P       │\n┼──────┴────────────┴─────────────┴─────────────┴────────────┼\n│chunk 1                                                     │\n│      ┌────────────┬─────────────┬─────────────┬────────────┤\n│  sh2 │C0: 24k + 4k│C1: 32k + 4k │C2: P        │C3: 40k + 4k│\n│      ┼────────────┼─────────────┼─────────────┼────────────┼\n│  sh3 │D0: 28k + 4k│D1: 36k + 4k │D2: P        │D3: 44k + 4k│\n└──────┴────────────┴─────────────┴─────────────┴────────────┘\n\nBefore this patch, 4 stripe head will be used, and each sh will attach\nbio for 3 disks, and each attached bio will trigger\nbitmap_startwrite() once, which means total 12 times.\n - 3 times (0 + 4k), for (A0, A1 and A2)\n - 3 times (4 + 4k), for (B0, B1 and B2)\n - 3 times (8 + 4k), for (C0, C1 and C3)\n - 3 times (12 + 4k), for (D0, D1 and D3)\n\nAfter this patch, md upper layer will calculate that IO range (0 + 48k)\nis corresponding to the bitmap (0 + 16k), and call bitmap_startwrite()\njust once.\n\nNoted that this patch will align bitmap ranges to the chunks, for example,\nif user issue a IO (0 + 4k) to array:\n\n- Before this patch, 1 time (0 + 4k), for A0;\n- After this patch, 1 time (0 + 8k) for chunk 0;\n\nUsually, one bitmap bit will represent more than one disk chunk, and this\ndoesn\u0027t have any difference. And even if user really created a array\nthat one chunk contain multiple bits, the overhead is that more data\nwill be recovered after power failure.\n\n[1] https://lore.kernel.org/all/CAJpMwyjmHQLvm6zg1cmQErttNNQPDAAXPKM3xgTjMhbfts986Q@mail.gmail.com/\n[2] https://lore.kernel.org/all/ADF7D720-5764-4AF3-B68E-1845988737AA@flyingcircus.io/\nSigned-off-by: Yu Kuai \u003cyukuai3@huawei.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "aebe12b0ee279f3e1243f7207167a3325c3de5dd",
      "old_mode": 33188,
      "old_path": "drivers/md/md.c",
      "new_id": "c60ae2c701027391b16629c8de7afc425d4b2b7a",
      "new_mode": 33188,
      "new_path": "drivers/md/md.c"
    },
    {
      "type": "modify",
      "old_id": "de6dadb9a40b064b324ff80e9dc93856d9fc0ceb",
      "old_mode": 33188,
      "old_path": "drivers/md/md.h",
      "new_id": "def808064ad8eff50b33c706fa6d1785230ecc8e",
      "new_mode": 33188,
      "new_path": "drivers/md/md.h"
    },
    {
      "type": "modify",
      "old_id": "81dff2cea0db3eb9b7fd0154de48c497a7749771",
      "old_mode": 33188,
      "old_path": "drivers/md/raid1.c",
      "new_id": "b5a5766cccf740dcd085514f0c5c4d526171bf5a",
      "new_mode": 33188,
      "new_path": "drivers/md/raid1.c"
    },
    {
      "type": "modify",
      "old_id": "3dc0170125b2a2316d1ee76d7225c6948ef6f625",
      "old_mode": 33188,
      "old_path": "drivers/md/raid10.c",
      "new_id": "2fe8e6f9605718648e2726b406a601488c72c50d",
      "new_mode": 33188,
      "new_path": "drivers/md/raid10.c"
    },
    {
      "type": "modify",
      "old_id": "ba4f9577c737613dbedebfa36f22affc0ff3d48b",
      "old_mode": 33188,
      "old_path": "drivers/md/raid5-cache.c",
      "new_id": "011246e16a99e5c893229c08a5e6e6fcb2f1a55b",
      "new_mode": 33188,
      "new_path": "drivers/md/raid5-cache.c"
    },
    {
      "type": "modify",
      "old_id": "b2fe201b599d19e3f2ef70aadba4bd7e9d6283d5",
      "old_mode": 33188,
      "old_path": "drivers/md/raid5.c",
      "new_id": "017439e2af0331692600dd996b417a4b20b8ebcf",
      "new_mode": 33188,
      "new_path": "drivers/md/raid5.c"
    }
  ]
}
