Re: [Xen-devel] [PATCH v2 4/4] mm: Don't request scrubbing until dom0 is running

2017-08-31 Thread Wei Liu
On Thu, Aug 31, 2017 at 09:16:14AM -0400, Boris Ostrovsky wrote:
> There is no need to scrub pages freed during dom0 construction since
> once dom0 is ready the heap will be scrubbed by scrub_heap_pages() anyway,
> setting scrub_debug at the end.
> 
> Signed-off-by: Boris Ostrovsky 

Reviewed-by: Wei Liu 

___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel


[Xen-devel] [PATCH v2 4/4] mm: Don't request scrubbing until dom0 is running

2017-08-31 Thread Boris Ostrovsky
There is no need to scrub pages freed during dom0 construction since
once dom0 is ready the heap will be scrubbed by scrub_heap_pages() anyway,
setting scrub_debug at the end.

Signed-off-by: Boris Ostrovsky 
---
Changes in v2:
* Use '||' instead of '|'. Drop '!!'
* Clarified commit message.

 xen/common/page_alloc.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 2b8bb95..dbad1e1 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -2248,16 +2248,12 @@ void free_domheap_pages(struct page_info *pg, unsigned 
int order)
 
 spin_unlock_recursive(>page_alloc_lock);
 
-#ifndef CONFIG_SCRUB_DEBUG
 /*
  * Normally we expect a domain to clear pages before freeing them,
  * if it cares about the secrecy of their contents. However, after
  * a domain has died we assume responsibility for erasure.
  */
-scrub = !!d->is_dying;
-#else
-scrub = true;
-#endif
+scrub = d->is_dying || scrub_debug;
 }
 else
 {
-- 
1.8.3.1


___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel