> -----Original Message-----
> From: Michal Hocko <mho...@kernel.org>
> Sent: Monday, 17 June 2019 5:47 PM
> To: Alastair D'Silva <alast...@au1.ibm.com>
> Cc: alast...@d-silva.org; Arun KS <aru...@codeaurora.org>; Mukesh Ojha
> <mo...@codeaurora.org>; Logan Gunthorpe <log...@deltatee.com>; Wei
> Yang <richard.weiy...@gmail.com>; Peter Zijlstra <pet...@infradead.org>;
> Ingo Molnar <mi...@kernel.org>; linux...@kvack.org; Qian Cai
> <c...@lca.pw>; Thomas Gleixner <t...@linutronix.de>; Andrew Morton
> <a...@linux-foundation.org>; Mike Rapoport <r...@linux.vnet.ibm.com>;
> Baoquan He <b...@redhat.com>; David Hildenbrand <da...@redhat.com>;
> Josh Poimboeuf <jpoim...@redhat.com>; Pavel Tatashin
> <pasha.tatas...@soleen.com>; Juergen Gross <jgr...@suse.com>; Oscar
> Salvador <osalva...@suse.com>; Jiri Kosina <jkos...@suse.cz>; linux-
> ker...@vger.kernel.org
> Subject: Re: [PATCH 4/5] mm/hotplug: Avoid RCU stalls when removing large
> amounts of memory
> 
> On Mon 17-06-19 14:36:30,  Alastair D'Silva  wrote:
> > From: Alastair D'Silva <alast...@d-silva.org>
> >
> > When removing sufficiently large amounts of memory, we trigger RCU
> > stall detection. By periodically calling cond_resched(), we avoid
> > bogus stall warnings.
> >
> > Signed-off-by: Alastair D'Silva <alast...@d-silva.org>
> > ---
> >  mm/memory_hotplug.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index
> > e096c987d261..382b3a0c9333 100644
> > --- a/mm/memory_hotplug.c
> > +++ b/mm/memory_hotplug.c
> > @@ -578,6 +578,9 @@ void __remove_pages(struct zone *zone, unsigned
> long phys_start_pfn,
> >             __remove_section(zone, __pfn_to_section(pfn),
> map_offset,
> >                              altmap);
> >             map_offset = 0;
> > +
> > +           if (!(i & 0x0FFF))
> > +                   cond_resched();
> 
> We already do have cond_resched before __remove_section. Why is an
> additional needed?

I was getting stalls when removing ~1TB of memory.


-- 
Alastair D'Silva           mob: 0423 762 819
skype: alastair_dsilva     msn: alast...@d-silva.org
blog: http://alastair.d-silva.org    Twitter: @EvilDeece



Reply via email to