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 2E5AFC43331 for ; Thu, 2 Apr 2020 07:46:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D1C022063A for ; Thu, 2 Apr 2020 07:46:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D1C022063A 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 59D7B8E0008; Thu, 2 Apr 2020 03:46:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 548758E0007; Thu, 2 Apr 2020 03:46:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 437F68E0008; Thu, 2 Apr 2020 03:46:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0150.hostedemail.com [216.40.44.150]) by kanga.kvack.org (Postfix) with ESMTP id 2BEFD8E0007 for ; Thu, 2 Apr 2020 03:46:19 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id ED18E582A for ; Thu, 2 Apr 2020 07:46:18 +0000 (UTC) X-FDA: 76662132036.06.pigs61_543495c67094f X-HE-Tag: pigs61_543495c67094f X-Filterd-Recvd-Size: 5254 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by imf23.hostedemail.com (Postfix) with ESMTP for ; Thu, 2 Apr 2020 07:46:18 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id s8so805744wrt.7 for ; Thu, 02 Apr 2020 00:46:18 -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=CDCBs32L1KcXkZ7wG0r7SiXyvbQn5EWGQiflqAKz2OE=; b=IAjZp0bn2qSv/XV3PAg9xZ+DN/kXoMKMNLOFpw0MS5bjX2Ck1XzIvtj3SO9MiWyJlT 4pkAQKb1ifIDw2QoYqf5tSKKPgLGg9zm6vi7rE+9sPDIDdfNSz+oHnWij5M3YW1+zt3q FbUMQV3xwvgR2gFSCeO5E9wkEgSNvJtKzzmZfQ5h9ITTGGjFoasJ/gQ/TXF137TuCEZ+ +MUt/qn64Vh1f3Ou19rcJJez0CuHb3O5iYR2Mh/oxxFM7kVzWV5Gny4GnT8x1/6xp2s6 O5U0HCdLoFzrdMuxvbf+NDVdk4ivSnzcDY9zNZHukVFjP60LFmCsDxjurO/0b+VX6xab pmaw== X-Gm-Message-State: AGi0PuZBzIQOnMqV8r56sT8z1SA2+YQGYe0ipFdkfdxucBlUzBdE6Z4v JHeLTNZKgomXinswrFBdE3Y= X-Google-Smtp-Source: APiQypLDUOaH4PG1oEwOpBo0rvJqszmH5HaUgyIoZbvL77QLnerpzPGsO/LyOynGM3AR+fsBhN1urg== X-Received: by 2002:adf:f1ce:: with SMTP id z14mr2140994wro.68.1585813577515; Thu, 02 Apr 2020 00:46:17 -0700 (PDT) Received: from localhost (ip-37-188-180-223.eurotel.cz. [37.188.180.223]) by smtp.gmail.com with ESMTPSA id f3sm6311128wmj.24.2020.04.02.00.46.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2020 00:46:16 -0700 (PDT) Date: Thu, 2 Apr 2020 09:46:15 +0200 From: Michal Hocko To: Pavel Tatashin Cc: 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, david@redhat.com, jmorris@namei.org, sashal@kernel.org, vbabka@suse.cz Subject: Re: [PATCH v2 1/2] mm: call touch_nmi_watchdog() on max order boundaries in deferred init Message-ID: <20200402074615.GI22681@dhcp22.suse.cz> References: <20200401225723.14164-1-pasha.tatashin@soleen.com> <20200401225723.14164-2-pasha.tatashin@soleen.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200401225723.14164-2-pasha.tatashin@soleen.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: I have only now noticed that you have reposted. On Wed 01-04-20 18:57:22, Pavel Tatashin wrote: > From: Daniel Jordan > > 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. > > Fixes: 3a2d7fa8a3d5 ("mm: disable interrupts while initializing deferred pages") > Cc: stable@vger.kernel.org # 4.17+ This patch is not fixing anything, right? It cleans up the code to make further changes easier which is good. > Signed-off-by: Daniel Jordan > Signed-off-by: Pavel Tatashin 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 3c4eb750a199..e8ff6a176164 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++; > } > @@ -1809,8 +1807,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); > > @@ -1894,6 +1894,7 @@ deferred_grow_zone(struct zone *zone, unsigned int order) > 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.17.1 > -- Michal Hocko SUSE Labs