Re: [PATCH v2 2/2] mm: initialize deferred pages with interrupts enabled

From: David Hildenbrand
Date: Thu Apr 02 2020 - 03:14:57 EST


On 02.04.20 00:57, Pavel Tatashin wrote:
> Initializing struct pages is a long task and keeping interrupts disabled
> for the duration of this operation introduces a number of problems.
>
> 1. jiffies are not updated for long period of time, and thus incorrect time
> is reported. See proposed solution and discussion here:
> lkml/20200311123848.118638-1-shile.zhang@xxxxxxxxxxxxxxxxx
> 2. It prevents farther improving deferred page initialization by allowing
> intra-node multi-threading.
>
> We are keeping interrupts disabled to solve a rather theoretical problem
> that was never observed in real world (See 3a2d7fa8a3d5).
>
> Lets keep interrupts enabled. In case we ever encounter a scenario where
> an interrupt thread wants to allocate large amount of memory this early in
> boot we can deal with that by growing zone (see deferred_grow_zone()) by
> the needed amount before starting deferred_init_memmap() threads.
>
> Before:
> [ 1.232459] node 0 initialised, 12058412 pages in 1ms
>
> After:
> [ 1.632580] node 0 initialised, 12051227 pages in 436ms
>
> Fixes: 3a2d7fa8a3d5 ("mm: disable interrupts while initializing deferred pages")
> Cc: stable@xxxxxxxxxxxxxxx # 4.17+
>

Can you please add my details about the use of cond_resched() fixing
detection of RCU stalls?

https://lore.kernel.org/linux-mm/20200401104156.11564-2-david@xxxxxxxxxx/

In the meantime, I'll give these two patches a churn. Thanks


--
Thanks,

David / dhildenb