PM: hibernate: Batch hibernate and resume IO requests
authorXiaoyi Chen <cxiaoyi@amazon.com>
Tue, 22 Sep 2020 16:19:19 +0000 (16:19 +0000)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 28 Sep 2020 13:58:18 +0000 (15:58 +0200)
commit55c4478a8f0ecedc0c1a0c9379380249985c372a
tree3c79a9b39db0e76d1c3363fc6e3093a04c85018d
parentba4f184e126b751d1bffad5897f263108befc780
PM: hibernate: Batch hibernate and resume IO requests

Hibernate and resume process submits individual IO requests for each page
of the data, so use blk_plug to improve the batching of these requests.

Testing this change with hibernate and resumes consistently shows merging
of the IO requests and more than an order of magnitude improvement in
hibernate and resume speed is observed.

One hibernate and resume cycle for 16GB RAM out of 32GB in use takes
around 21 minutes before the change, and 1 minutes after the change on
a system with limited storage IOPS.

Signed-off-by: Xiaoyi Chen <cxiaoyi@amazon.com>
Co-Developed-by: Anchal Agarwal <anchalag@amazon.com>
Signed-off-by: Anchal Agarwal <anchalag@amazon.com>
[ rjw: Subject and changelog edits, white space damage fixes ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
kernel/power/swap.c