mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: David Hildenbrand <david@redhat.com>
Cc: Pavel Tatashin <pasha.tatashin@soleen.com>,
	linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	linux-mm@kvack.org, dan.j.williams@intel.com,
	shile.zhang@linux.alibaba.com, daniel.m.jordan@oracle.com,
	ktkhai@virtuozzo.com, jmorris@namei.org, sashal@kernel.org,
	vbabka@suse.cz
Subject: Re: [PATCH v2 2/2] mm: initialize deferred pages with interrupts enabled
Date: Thu, 2 Apr 2020 09:47:32 +0200	[thread overview]
Message-ID: <20200402074732.GJ22681@dhcp22.suse.cz> (raw)
In-Reply-To: <bd3db378-f5d5-0058-0a42-4ed6033439a8@redhat.com>

On Thu 02-04-20 09:38:54, David Hildenbrand wrote:
> > +	/*
> > +	 * Once we unlock here, the zone cannot be grown anymore, thus if an
> > +	 * interrupt thread must allocate this early in boot, zone must be
> > +	 * pre-grown prior to start of deferred page initialization.
> > +	 */
> > +	pgdat_resize_unlock(pgdat, &flags);
> > +
> >  	/* Only the highest zone is deferred so find it */
> >  	for (zid = 0; zid < MAX_NR_ZONES; zid++) {
> >  		zone = pgdat->node_zones + zid;
> > @@ -1809,11 +1816,9 @@ static int __init deferred_init_memmap(void *data)
> >  	 */
> >  	while (spfn < epfn) {
> >  		nr_pages += deferred_init_maxorder(&i, zone, &spfn, &epfn);
> > -		touch_nmi_watchdog();
> > +		cond_resched();
> 
> I do wonder if this change is strictly required in this patch (IOW, if
> we could keep calling touch_nmi_watchdog() also without holding a spinlock)

Exactly. I would go with your patch on top.
 
> Anyhow, it's the right thing to do.
> 
> >  	}
> >  zone_empty:
> > -	pgdat_resize_unlock(pgdat, &flags);
> > -
> >  	/* Sanity check that the next zone really is unpopulated */
> >  	WARN_ON(++zid < MAX_NR_ZONES && populated_zone(++zone));
> >  
> > @@ -1855,17 +1860,6 @@ deferred_grow_zone(struct zone *zone, unsigned int order)
> >  
> >  	pgdat_resize_lock(pgdat, &flags);
> >  
> > -	/*
> > -	 * If deferred pages have been initialized while we were waiting for
> > -	 * the lock, return true, as the zone was grown.  The caller will retry
> > -	 * this zone.  We won't return to this function since the caller also
> > -	 * has this static branch.
> > -	 */
> > -	if (!static_branch_unlikely(&deferred_pages)) {
> > -		pgdat_resize_unlock(pgdat, &flags);
> > -		return true;
> > -	}
> > -
> >  	/*
> >  	 * If someone grew this zone while we were waiting for spinlock, return
> >  	 * true, as there might be enough pages already.
> > 
> 
> 
> I think we should also look into cleaning up deferred_grow_zone( next),
> we still have that touch_nmi_watchdog() in there. We should rework
> locking. (I think Michal requested that as well)
> 
> For now, this seems to survive my basic testing (RCU stalls gone)
> 
> -- 
> Thanks,
> 
> David / dhildenb
> 

-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2020-04-02  7:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-01 22:57 [PATCH v2 0/2] " Pavel Tatashin
2020-04-01 22:57 ` [PATCH v2 1/2] mm: call touch_nmi_watchdog() on max order boundaries in deferred init Pavel Tatashin
2020-04-02  7:23   ` David Hildenbrand
2020-04-02  7:46   ` Michal Hocko
2020-04-02 11:36   ` Vlastimil Babka
2020-04-01 22:57 ` [PATCH v2 2/2] mm: initialize deferred pages with interrupts enabled Pavel Tatashin
2020-04-02  7:14   ` David Hildenbrand
2020-04-02 15:49     ` Pavel Tatashin
2020-04-02  7:38   ` David Hildenbrand
2020-04-02  7:47     ` Michal Hocko [this message]
2020-04-02 15:13       ` Pavel Tatashin
2020-04-02 17:16         ` Michal Hocko
2020-04-02 18:25           ` Pavel Tatashin
2020-04-02 12:09   ` Vlastimil Babka
2020-04-02 15:05     ` 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=20200402074732.GJ22681@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=dan.j.williams@intel.com \
    --cc=daniel.m.jordan@oracle.com \
    --cc=david@redhat.com \
    --cc=jmorris@namei.org \
    --cc=ktkhai@virtuozzo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pasha.tatashin@soleen.com \
    --cc=sashal@kernel.org \
    --cc=shile.zhang@linux.alibaba.com \
    --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

all inboxes | Powered by JetHome®