mm/page_alloc: make bootscrub happen in idle-loop
PATCH v3 1/1 mm/page_alloc: make bootscrub happen in idle-loop
Scrubbing RAM during boot may take a long time on machines with lots of RAM. Add 'idle' option to bootscrub which marks all pages dirty initially so they will eventually be scrubbed in idle-loop on every online CPU.
It's guaranteed that the allocator will return scrubbed pages by doing eager scrubbing during allocation (unless MEMF_no_scrub was provided).
Use the new 'idle' option as the default one.
---
v2 --> v3:
- Removed "= 0" from enum bootscrub_mode
- Removed num_online_nodes() from printk()
- Added Reviewed-by
--- docs/misc/xen-command-line.markdown | 9 ++++- xen/common/page_alloc.c | 61 +++++++++++++++++++++++++++-- 2 files changed, 64 insertions(+), 6 deletions(-)
docs/misc/xen-command-line.markdown +7 -2
@@ -227,14 +227,19 @@ that byte `0x12345678` is bad, you would place `badpage=0x12345` on Xen's command line. ### bootscrub -> `= <boolean>` +> `= idle | <boolean>` -> Default: `true` +> Default: `idle` Scrub free RAM during boot. This is a safety feature to prevent accidentally leaking sensitive VM data into other VMs if Xen crashes and reboots. +In `idle` mode, RAM is scrubbed in background on all CPUs during idle-loop +with a guarantee that memory allocations always provide scrubbed pages. +This option reduces boot time on machines with a large amount of RAM while +still providing security benefits. + ### bootscrub\_chunk > `= <size>`
xen/common/page_alloc.c +57 -4
92 lines not on this page · raw message
Signature · 7 lines
2.17.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 10 lines · Sergey Dyasli
Scrubbing RAM during boot may take a long time on machines with lots of RAM. Add 'idle' option to bootscrub which marks all pages dirty initially so they will eventually be scrubbed in idle-loop on every online CPU.
It's guaranteed that the allocator will return scrubbed pages by doing eager scrubbing during allocation (unless
MEMF_no_scrubwas provided).Use the new 'idle' option as the default one.
Quoted 7 lines
Signed-off-by Sergey Dyasli <[email protected]>Reviewed-by Jan Beulich <[email protected]>---
v2 --> v3:
- Removed "= 0" from enumbootscrub_mode
- Removednum_online_nodes()fromprintk()
- Added Reviewed-by
I think your patch (v2?) is already committed.
Wei.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 19 lines · Wei Liu
Quoted 10 lines · Sergey Dyasli
Scrubbing RAM during boot may take a long time on machines with lots of RAM. Add 'idle' option to bootscrub which marks all pages dirty initially so they will eventually be scrubbed in idle-loop on every online CPU.
It's guaranteed that the allocator will return scrubbed pages by doing eager scrubbing during allocation (unless
MEMF_no_scrubwas provided).Use the new 'idle' option as the default one.
Quoted 7 lines
Signed-off-by Sergey Dyasli <[email protected]>Reviewed-by Jan Beulich <[email protected]>---
v2 --> v3:
- Removed "= 0" from enumbootscrub_mode
- Removednum_online_nodes()fromprintk()
- Added Reviewed-by
Quoted 1 line
I think your patch (v2?) is already committed.
Hmm, you are right: CommitDate: Wed Nov 7 09:34:17 2018 +0100 Sorry, I wasn't expecting that.
Though printk() in the committed version has a typo:
printk("Scrubbing free RAM on in background\n");
^^--
Thanks,
Sergey
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 22 lines · Sergey Dyasli
Quoted 19 lines · Wei Liu
Quoted 10 lines · Sergey Dyasli
Scrubbing RAM during boot may take a long time on machines with lots of RAM. Add 'idle' option to bootscrub which marks all pages dirty initially so they will eventually be scrubbed in idle-loop on every online CPU.
It's guaranteed that the allocator will return scrubbed pages by doing eager scrubbing during allocation (unless
MEMF_no_scrubwas provided).Use the new 'idle' option as the default one.
Quoted 7 lines
Signed-off-by Sergey Dyasli <[email protected]>Reviewed-by Jan Beulich <[email protected]>---
v2 --> v3:
- Removed "= 0" from enumbootscrub_mode
- Removednum_online_nodes()fromprintk()
- Added Reviewed-byQuoted 1 line
I think your patch (v2?) is already committed.
Quoted 7 lines
Hmm, you are right: CommitDate: Wed Nov 7 09:34:17 2018 +0100 Sorry, I wasn't expecting that.
Though
printk()in the committed version has a typo:printk("Scrubbing free RAM on in background\n"); ^^
Feel free to send a followup patch to fix that.
Wei.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel