[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1652860121-24092-4-git-send-email-quic_vivekuma@quicinc.com>
Date: Wed, 18 May 2022 13:18:38 +0530
From: Vivek Kumar <quic_vivekuma@...cinc.com>
To: <corbet@....net>, <catalin.marinas@....com>, <will@...nel.org>,
<tglx@...utronix.de>, <maz@...nel.org>, <axboe@...nel.dk>,
<rafael@...nel.org>, <akpm@...ux-foundation.org>,
<linux-doc@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-block@...r.kernel.org>, <linux-pm@...r.kernel.org>,
<linux-mm@...ck.org>
CC: <len.brown@...el.com>, <pavel@....cz>, <paulmck@...nel.org>,
<bp@...e.de>, <keescook@...omium.org>, <songmuchun@...edance.com>,
<rdunlap@...radead.org>, <damien.lemoal@...nsource.wdc.com>,
<pasha.tatashin@...een.com>, <tabba@...gle.com>, <ardb@...nel.org>,
<tsoni@...cinc.com>, <quic_psodagud@...cinc.com>,
<quic_svaddagi@...cinc.com>,
Vivek Kumar <quic_vivekuma@...cinc.com>,
Prasanna Kumar <quic_kprasan@...cinc.com>
Subject: [RFC 3/6] block: gendisk: Add a new genhd capability flag
Add a new genhd capability flag to serialize offsets
for swap partition. This flag is enabled for the gendisk of
the block device which will be used for saving the snapshot
of the hibernation image, based on a kernel parameter
"noswap_randomize". Serializing offset in swap partition
helps in improving hibernation resume time from bootloader.
Signed-off-by: Vivek Kumar <quic_vivekuma@...cinc.com>
Signed-off-by: Prasanna Kumar <quic_kprasan@...cinc.com>
---
include/linux/blkdev.h | 1 +
kernel/power/swap.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 1b24c1f..be094e7 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -92,6 +92,7 @@ enum {
GENHD_FL_REMOVABLE = 1 << 0,
GENHD_FL_HIDDEN = 1 << 1,
GENHD_FL_NO_PART = 1 << 2,
+ GENHD_FL_NO_RANDOMIZE = 1 << 3,
};
enum {
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index 8d5c811..0a40eda 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -1526,6 +1526,9 @@ int swsusp_check(void)
FMODE_READ | FMODE_EXCL, &holder);
if (!IS_ERR(hib_resume_bdev)) {
set_blocksize(hib_resume_bdev, PAGE_SIZE);
+ if (noswap_randomize)
+ hib_resume_bdev->bd_disk->flags |=
+ GENHD_FL_NO_RANDOMIZE;
clear_page(swsusp_header);
error = hib_submit_io(REQ_OP_READ, 0,
swsusp_resume_block,
--
2.7.4
Powered by blists - more mailing lists