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=-1.0 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 16FE8C43331 for ; Thu, 2 Apr 2020 07:47:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D7B832063A for ; Thu, 2 Apr 2020 07:47:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D7B832063A 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 AA0268E0009; Thu, 2 Apr 2020 03:47:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A29CB8E0007; Thu, 2 Apr 2020 03:47:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8F2D48E0009; Thu, 2 Apr 2020 03:47:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0080.hostedemail.com [216.40.44.80]) by kanga.kvack.org (Postfix) with ESMTP id 74A048E0007 for ; Thu, 2 Apr 2020 03:47:36 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 37506181AC9CB for ; Thu, 2 Apr 2020 07:47:36 +0000 (UTC) X-FDA: 76662135312.28.crime66_5f72fa674b449 X-HE-Tag: crime66_5f72fa674b449 X-Filterd-Recvd-Size: 4833 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Thu, 2 Apr 2020 07:47:35 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id r16so2289863wmg.5 for ; Thu, 02 Apr 2020 00:47:35 -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=NVV+XLCtvLiWJ+s+cYYfQ2jchm7WNaKV/wENiGONXA0=; b=aPioco7LvT/SN3ShcMwwe87HEzPvH5w1oOMtaUCWrKhGNGsCaFzxHoyny7QkUFeSb3 rFkPlOai519l5tcnOv0zFOh6IU0ZRt23jkTfJt4eMluI8ATYNXR8IKDWXRXf3peQ+J1q fEeuHL3qIfvrbOS7qXYxNZrONmTC6jDBZQde7VW6cjM5osxdb9SZQiThaZm2GDLcaS1U haacooCHcaaWb2OP2d/KfNvsSvuMPqEqOjuQ3mUPAOUy3YBdcN3Mt6vHXf8ltZJMIlUZ 9KOl2iAcgo9O4LBhClJCq3ESzaZmmfv0dioAFWfe84YPnXQYAk1SV6MO8kkM85ZJogUl 46kg== X-Gm-Message-State: AGi0PuY8pT52+iP2Hw50zRQAbmt7fAadPghaTmESeFPuyw+2onOCHfnR 907M02EoBw65Y1HuihLKrqY= X-Google-Smtp-Source: APiQypItsIJNCAbkqCX8//cpVrnP0EVMebPREAvn0zIOAKSRwEPmObDI0Ssbe2gV0A48K5yyAdGTkg== X-Received: by 2002:a1c:b144:: with SMTP id a65mr2274349wmf.54.1585813654567; Thu, 02 Apr 2020 00:47:34 -0700 (PDT) Received: from localhost (ip-37-188-180-223.eurotel.cz. [37.188.180.223]) by smtp.gmail.com with ESMTPSA id c189sm6173913wmd.12.2020.04.02.00.47.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2020 00:47:33 -0700 (PDT) Date: Thu, 2 Apr 2020 09:47:32 +0200 From: Michal Hocko To: David Hildenbrand 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, 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 Message-ID: <20200402074732.GJ22681@dhcp22.suse.cz> References: <20200401225723.14164-1-pasha.tatashin@soleen.com> <20200401225723.14164-3-pasha.tatashin@soleen.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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