From: Andrew Morton <akpm@linux-foundation.org>
To: Pavel Tatashin <pasha.tatashin@oracle.com>
Cc: steven.sistare@oracle.com, daniel.m.jordan@oracle.com,
m.mizuma@jp.fujitsu.com, mhocko@suse.com,
catalin.marinas@arm.com, takahiro.akashi@linaro.org,
gi-oh.kim@profitbricks.com, heiko.carstens@de.ibm.com,
baiyaowei@cmss.chinamobile.com, richard.weiyang@gmail.com,
paul.burton@mips.com, miles.chen@mediatek.com, vbabka@suse.cz,
mgorman@suse.de, hannes@cmpxchg.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [v5 1/2] mm: disable interrupts while initializing deferred pages
Date: Tue, 13 Mar 2018 13:11:56 -0700 [thread overview]
Message-ID: <20180313131156.f156abe1822a79ec01c4800a@linux-foundation.org> (raw)
In-Reply-To: <20180313194546.k62tni4g4gnds2nx@xakep.localdomain>
On Tue, 13 Mar 2018 15:45:46 -0400 Pavel Tatashin <pasha.tatashin@oracle.com> wrote:
> > >
> > > We must remove cond_resched() because we can't sleep anymore. They were
> > > added to fight NMI timeouts, so I will replace them with
> > > touch_nmi_watchdog() in a follow-up fix.
> >
> > This makes no sense. Any code section where we can add cond_resched()
> > was never subject to NMI timeouts because that code cannot be running with
> > disabled interrupts.
> >
>
> Hi Andrew,
>
> I was talking about this patch:
>
> 9b6e63cbf85b89b2dbffa4955dbf2df8250e5375
> mm, page_alloc: add scheduling point to memmap_init_zone
>
> Which adds cond_resched() to memmap_init_zone() to avoid NMI timeouts.
>
> memmap_init_zone() is used both, early in boot, when non-deferred struct
> pages are initialized, but also may be used later, during memory hotplug.
>
> As I understand, the later case could cause the timeout on non-preemptible
> kernels.
>
> My understanding, is that the same logic was used here when cond_resched()s
> were added.
>
> Please correct me if I am wrong.
Yes, the message is a bit confusing and the terminology is perhaps
vague. And it's been a while since I played with this stuff, so from
(dated) memory:
Soft lockup: kernel has run for too long without rescheduling
Hard lockup: kernel has run for too long with interrupts disabled
Both of these are detected by the NMI watchdog handler.
9b6e63cbf85b89b2d fixes a soft lockup by adding a manual rescheduling
point. Replacing that with touch_nmi_watchdog() won't work (I think).
Presumably calling touch_softlockup_watchdog() will "work", in that it
suppresses the warning. But it won't fix the thing which the warning
is actually warning about: starvation of the CPU scheduler. That's
what the cond_resched() does.
I'm not sure what to suggest, really. Your changelog isn't the best:
"Vlastimil Babka reported about a window issue during which when
deferred pages are initialized, and the current version of on-demand
initialization is finished, allocations may fail". Well... where is
ths mysterious window? Without such detail it's hard for others to
suggest alternative approaches.
next prev parent reply other threads:[~2018-03-13 20:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-09 22:08 [v5 0/2] initialize pages on demand during boot Pavel Tatashin
2018-03-09 22:08 ` [v5 1/2] mm: disable interrupts while initializing deferred pages Pavel Tatashin
2018-03-12 20:04 ` Andrew Morton
2018-03-13 16:04 ` Pavel Tatashin
2018-03-13 18:55 ` Andrew Morton
2018-03-13 19:45 ` Pavel Tatashin
2018-03-13 20:11 ` Andrew Morton [this message]
2018-03-13 20:43 ` Pavel Tatashin
2018-03-13 21:24 ` Andrew Morton
2018-03-14 0:59 ` Pavel Tatashin
2018-03-09 22:08 ` [v5 2/2] mm: initialize pages on demand during boot Pavel Tatashin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180313131156.f156abe1822a79ec01c4800a@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=baiyaowei@cmss.chinamobile.com \
--cc=catalin.marinas@arm.com \
--cc=daniel.m.jordan@oracle.com \
--cc=gi-oh.kim@profitbricks.com \
--cc=hannes@cmpxchg.org \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=m.mizuma@jp.fujitsu.com \
--cc=mgorman@suse.de \
--cc=mhocko@suse.com \
--cc=miles.chen@mediatek.com \
--cc=pasha.tatashin@oracle.com \
--cc=paul.burton@mips.com \
--cc=richard.weiyang@gmail.com \
--cc=steven.sistare@oracle.com \
--cc=takahiro.akashi@linaro.org \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome