From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81F96C43331 for ; Thu, 2 Apr 2020 07:36:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4206D20678 for ; Thu, 2 Apr 2020 07:36:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4206D20678 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E52A98E0008; Thu, 2 Apr 2020 03:36:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E03348E0007; Thu, 2 Apr 2020 03:36:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CF11E8E0008; Thu, 2 Apr 2020 03:36:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0143.hostedemail.com [216.40.44.143]) by kanga.kvack.org (Postfix) with ESMTP id B81858E0007 for ; Thu, 2 Apr 2020 03:36:15 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 75151180ACEE4 for ; Thu, 2 Apr 2020 07:36:15 +0000 (UTC) X-FDA: 76662106710.07.bun86_8deb42fc3d255 X-HE-Tag: bun86_8deb42fc3d255 X-Filterd-Recvd-Size: 5198 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Thu, 2 Apr 2020 07:36:15 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id a25so2974638wrd.0 for ; Thu, 02 Apr 2020 00:36:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=xkG5ET7XWQR6Bs9madxK9IME3VWiyyi7TqIYnv+0quw=; b=qOPzH9JtkkoCLlZc6itWN/eZqa+gjNXydoIhGaNfBIfE51bv+F10DOe6Qf/h6bbwzR lh6ai4isJ7/VqbnSeM9cYExqNP2GjIoSWxSvDzrxLrADxvGVTD3tGz0llh0aW3E9ZU3Q vmKRrTmsjl8VJJbmNxXVtlDCg29nC0Rju+QG1SzPmjrYSD86KKUspI7fl+KO3VQJ24y1 /axKqPn2wZ7Ab4JzTVY9UnTj97briwIKw9quYTQv2zKrBn9+HKDVBuTq8vvcXLw6gCVu snrYTzlBBimg6WIjB8RGPKnYmCuOGdN853l+kybpli5Fm9JG62F8n1+3HGLcbtzDV8dA 7dxA== X-Gm-Message-State: AGi0PuYw2rmT6Ge3fG0beGS6gS4mtjgKH96NBhVK1oaXpv1claIUlNAN AIm0OdMsymnY0ozU8kZwh7w= X-Google-Smtp-Source: APiQypItNRsRHgeptfl803NPYB7zyFU3diPIxZHlh6/l5VgogD6aIbyqMj93jMjBr9VnVLoo9ti4Hw== X-Received: by 2002:a5d:6045:: with SMTP id j5mr2017736wrt.401.1585812973674; Thu, 02 Apr 2020 00:36:13 -0700 (PDT) Received: from localhost (ip-37-188-180-223.eurotel.cz. [37.188.180.223]) by smtp.gmail.com with ESMTPSA id a13sm6415179wrt.64.2020.04.02.00.36.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2020 00:36:12 -0700 (PDT) Date: Thu, 2 Apr 2020 09:36:12 +0200 From: Michal Hocko To: Daniel Jordan Cc: Pavel Tatashin , linux-kernel@vger.kernel.org, akpm@linux-foundation.org, linux-mm@kvack.org, dan.j.williams@intel.com, shile.zhang@linux.alibaba.com, ktkhai@virtuozzo.com, david@redhat.com, jmorris@namei.org, sashal@kernel.org Subject: Re: [PATCH] mm: initialize deferred pages with interrupts enabled Message-ID: <20200402073612.GG22681@dhcp22.suse.cz> References: <20200401193238.22544-1-pasha.tatashin@soleen.com> <20200401200027.vsm5roobllewniea@ca-dmjordan1.us.oracle.com> <20200401200855.d23xcwznr5cm67p2@ca-dmjordan1.us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200401200855.d23xcwznr5cm67p2@ca-dmjordan1.us.oracle.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed 01-04-20 16:08:55, Daniel Jordan wrote: [...] > From: Daniel Jordan > Date: Fri, 27 Mar 2020 17:29:05 -0400 > Subject: [PATCH] mm: call touch_nmi_watchdog() on max order boundaries in > deferred init > > deferred_init_memmap() disables interrupts the entire time, so it calls > touch_nmi_watchdog() periodically to avoid soft lockup splats. Soon it > will run with interrupts enabled, at which point cond_resched() should > be used instead. > > deferred_grow_zone() makes the same watchdog calls through code shared > with deferred init but will continue to run with interrupts disabled, so > it can't call cond_resched(). > > Pull the watchdog calls up to these two places to allow the first to be > changed later, independently of the second. The frequency reduces from > twice per pageblock (init and free) to once per max order block. This makes sense but I am not really sure this is necessary for the stable backport. > Signed-off-by: Daniel Jordan Acked-by: Michal Hocko > --- > mm/page_alloc.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 212734c4f8b0..4cf18c534233 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -1639,7 +1639,6 @@ static void __init deferred_free_pages(unsigned long pfn, > } else if (!(pfn & nr_pgmask)) { > deferred_free_range(pfn - nr_free, nr_free); > nr_free = 1; > - touch_nmi_watchdog(); > } else { > nr_free++; > } > @@ -1669,7 +1668,6 @@ static unsigned long __init deferred_init_pages(struct zone *zone, > continue; > } else if (!page || !(pfn & nr_pgmask)) { > page = pfn_to_page(pfn); > - touch_nmi_watchdog(); > } else { > page++; > } > @@ -1813,8 +1811,10 @@ static int __init deferred_init_memmap(void *data) > * that we can avoid introducing any issues with the buddy > * allocator. > */ > - while (spfn < epfn) > + while (spfn < epfn) { > nr_pages += deferred_init_maxorder(&i, zone, &spfn, &epfn); > + touch_nmi_watchdog(); > + } > zone_empty: > pgdat_resize_unlock(pgdat, &flags); > > @@ -1908,6 +1908,7 @@ deferred_grow_zone_locked(pg_data_t *pgdat, struct zone *zone, > first_deferred_pfn = spfn; > > nr_pages += deferred_init_maxorder(&i, zone, &spfn, &epfn); > + touch_nmi_watchdog(); > > /* We should only stop along section boundaries */ > if ((first_deferred_pfn ^ spfn) < PAGES_PER_SECTION) > -- > 2.25.0 > -- Michal Hocko SUSE Labs