Re: [Xen-devel] [PATCH v3 4/9] mm: Scrub memory from idle loop

2017-05-12 Thread Boris Ostrovsky
On 05/12/2017 04:17 AM, Dario Faggioli wrote: > On Thu, 2017-05-11 at 13:05 -0400, Boris Ostrovsky wrote: >> On 05/11/2017 11:48 AM, Dario Faggioli wrote: >> >>> It probably would be at least a bit better, if scrub_free_pages() >>> would >>> check for softirqs() _before_ starting any scrubbing (whi

Re: [Xen-devel] [PATCH v3 4/9] mm: Scrub memory from idle loop

2017-05-12 Thread Dario Faggioli
On Thu, 2017-05-11 at 13:05 -0400, Boris Ostrovsky wrote: > On 05/11/2017 11:48 AM, Dario Faggioli wrote: > > > It probably would be at least a bit better, if scrub_free_pages() > > would > > check for softirqs() _before_ starting any scrubbing (which I don't > > think it does, right now, am I righ

Re: [Xen-devel] [PATCH v3 4/9] mm: Scrub memory from idle loop

2017-05-11 Thread Boris Ostrovsky
On 05/11/2017 11:48 AM, Dario Faggioli wrote: > On Thu, 2017-05-11 at 10:19 -0400, Boris Ostrovsky wrote: diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 90e2b1f..a5f62b5 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -118,7 +118,8 @@ sta

Re: [Xen-devel] [PATCH v3 4/9] mm: Scrub memory from idle loop

2017-05-11 Thread Dario Faggioli
On Thu, 2017-05-11 at 10:19 -0400, Boris Ostrovsky wrote: > > > diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c > > > index 90e2b1f..a5f62b5 100644 > > > --- a/xen/arch/x86/domain.c > > > +++ b/xen/arch/x86/domain.c > > > @@ -118,7 +118,8 @@ static void idle_loop(void) > > >  { > > >

Re: [Xen-devel] [PATCH v3 4/9] mm: Scrub memory from idle loop

2017-05-11 Thread Boris Ostrovsky
>> diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c >> index 90e2b1f..a5f62b5 100644 >> --- a/xen/arch/x86/domain.c >> +++ b/xen/arch/x86/domain.c >> @@ -118,7 +118,8 @@ static void idle_loop(void) >> { >> if ( cpu_is_offline(smp_processor_id()) ) >> play_dead(

Re: [Xen-devel] [PATCH v3 4/9] mm: Scrub memory from idle loop

2017-05-11 Thread Dario Faggioli
On Fri, 2017-04-14 at 11:37 -0400, Boris Ostrovsky wrote: > Instead of scrubbing pages during guest destruction (from > free_heap_pages()) do this opportunistically, from the idle loop. > > Signed-off-by: Boris Ostrovsky > --- > Changes in v3: > * If memory-only nodes exist, select the closest on

Re: [Xen-devel] [PATCH v3 4/9] mm: Scrub memory from idle loop

2017-05-08 Thread Jan Beulich
>>> On 05.05.17 at 18:49, wrote: > On 05/05/2017 12:05 PM, Jan Beulich wrote: > On 05.05.17 at 17:23, wrote: >>> On 05/05/2017 10:51 AM, Jan Beulich wrote: >>> On 05.05.17 at 16:27, wrote: > On 05/05/2017 10:14 AM, Jan Beulich wrote: > On 05.05.17 at 16:10, wrote: >>

Re: [Xen-devel] [PATCH v3 4/9] mm: Scrub memory from idle loop

2017-05-05 Thread Boris Ostrovsky
On 05/05/2017 12:05 PM, Jan Beulich wrote: On 05.05.17 at 17:23, wrote: >> On 05/05/2017 10:51 AM, Jan Beulich wrote: >> On 05.05.17 at 16:27, wrote: On 05/05/2017 10:14 AM, Jan Beulich wrote: On 05.05.17 at 16:10, wrote: > On 05.05.17 at 15:42, wrote: >>

Re: [Xen-devel] [PATCH v3 4/9] mm: Scrub memory from idle loop

2017-05-05 Thread Jan Beulich
>>> On 05.05.17 at 17:23, wrote: > On 05/05/2017 10:51 AM, Jan Beulich wrote: > On 05.05.17 at 16:27, wrote: >>> On 05/05/2017 10:14 AM, Jan Beulich wrote: >>> On 05.05.17 at 16:10, wrote: On 05.05.17 at 15:42, wrote: > Otoh there's not much to scrub yet until Dom0 had

Re: [Xen-devel] [PATCH v3 4/9] mm: Scrub memory from idle loop

2017-05-05 Thread Boris Ostrovsky
On 05/05/2017 10:51 AM, Jan Beulich wrote: On 05.05.17 at 16:27, wrote: >> On 05/05/2017 10:14 AM, Jan Beulich wrote: >> On 05.05.17 at 16:10, wrote: >>> On 05.05.17 at 15:42, wrote: Otoh there's not much to scrub yet until Dom0 had all its memory allocated, and we

Re: [Xen-devel] [PATCH v3 4/9] mm: Scrub memory from idle loop

2017-05-05 Thread Jan Beulich
>>> On 05.05.17 at 16:27, wrote: > On 05/05/2017 10:14 AM, Jan Beulich wrote: > On 05.05.17 at 16:10, wrote: >> On 05.05.17 at 15:42, wrote: >>> Otoh there's not much to scrub yet until Dom0 had all its memory >>> allocated, and we know which pages truly remain free (wanting

Re: [Xen-devel] [PATCH v3 4/9] mm: Scrub memory from idle loop

2017-05-05 Thread Boris Ostrovsky
On 05/05/2017 10:14 AM, Jan Beulich wrote: On 05.05.17 at 16:10, wrote: > On 05.05.17 at 15:42, wrote: >> Otoh there's not much to scrub yet until Dom0 had all its memory >> allocated, and we know which pages truly remain free (wanting >> what is currently the boot time scrub

Re: [Xen-devel] [PATCH v3 4/9] mm: Scrub memory from idle loop

2017-05-05 Thread Jan Beulich
>>> On 05.05.17 at 16:10, wrote: On 05.05.17 at 15:42, wrote: > Otoh there's not much to scrub yet until Dom0 had all its memory > allocated, and we know which pages truly remain free (wanting > what is currently the boot time scrubbing done on them). But that > point in time

Re: [Xen-devel] [PATCH v3 4/9] mm: Scrub memory from idle loop

2017-05-05 Thread Jan Beulich
>>> On 05.05.17 at 15:42, wrote: Otoh there's not much to scrub yet until Dom0 had all its memory allocated, and we know which pages truly remain free (wanting what is currently the boot time scrubbing done on them). But that point in time may still be earlier than when we swit

Re: [Xen-devel] [PATCH v3 4/9] mm: Scrub memory from idle loop

2017-05-05 Thread Boris Ostrovsky
+bool scrub_free_pages(void) { struct page_info *pg; unsigned int zone, order; unsigned long i; +unsigned int cpu = smp_processor_id(); +bool preempt = false; +nodeid_t node; -ASSERT(spin_is_locked(&heap_lock)); >>

Re: [Xen-devel] [PATCH v3 4/9] mm: Scrub memory from idle loop

2017-05-05 Thread Jan Beulich
>>> On 04.05.17 at 19:09, wrote: > On 05/04/2017 11:31 AM, Jan Beulich wrote: > On 14.04.17 at 17:37, wrote: >>> --- a/xen/common/page_alloc.c >>> +++ b/xen/common/page_alloc.c >>> @@ -1035,16 +1035,82 @@ merge_and_free_buddy(struct page_info *pg, unsigned >>> int node, >>> return pg; >

Re: [Xen-devel] [PATCH v3 4/9] mm: Scrub memory from idle loop

2017-05-04 Thread Boris Ostrovsky
On 05/04/2017 11:31 AM, Jan Beulich wrote: On 14.04.17 at 17:37, wrote: >> --- a/xen/common/page_alloc.c >> +++ b/xen/common/page_alloc.c >> @@ -1035,16 +1035,82 @@ merge_and_free_buddy(struct page_info *pg, unsigned >> int node, >> return pg; >> } >> >> -static void scrub_free_pages

Re: [Xen-devel] [PATCH v3 4/9] mm: Scrub memory from idle loop

2017-05-04 Thread Jan Beulich
>>> On 14.04.17 at 17:37, wrote: > --- a/xen/common/page_alloc.c > +++ b/xen/common/page_alloc.c > @@ -1035,16 +1035,82 @@ merge_and_free_buddy(struct page_info *pg, unsigned > int node, > return pg; > } > > -static void scrub_free_pages(unsigned int node) > +static nodemask_t node_scrubb

[Xen-devel] [PATCH v3 4/9] mm: Scrub memory from idle loop

2017-04-14 Thread Boris Ostrovsky
Instead of scrubbing pages during guest destruction (from free_heap_pages()) do this opportunistically, from the idle loop. Signed-off-by: Boris Ostrovsky --- Changes in v3: * If memory-only nodes exist, select the closest one for scrubbing * Don't scrub from idle loop until we reach SYS_STATE_ac