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=-3.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 467B7C2D0F0 for ; Wed, 1 Apr 2020 20:31:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F0DA520719 for ; Wed, 1 Apr 2020 20:31:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="IGkoDtyi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F0DA520719 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A012D8E0007; Wed, 1 Apr 2020 16:31:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9B0D38E0006; Wed, 1 Apr 2020 16:31:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8C6E88E0007; Wed, 1 Apr 2020 16:31:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0167.hostedemail.com [216.40.44.167]) by kanga.kvack.org (Postfix) with ESMTP id 7312B8E0006 for ; Wed, 1 Apr 2020 16:31:42 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 327BC180AD81D for ; Wed, 1 Apr 2020 20:31:42 +0000 (UTC) X-FDA: 76660432044.06.dress76_ed4fb8332707 X-HE-Tag: dress76_ed4fb8332707 X-Filterd-Recvd-Size: 5848 Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) by imf04.hostedemail.com (Postfix) with ESMTP for ; Wed, 1 Apr 2020 20:31:41 +0000 (UTC) Received: by mail-ed1-f66.google.com with SMTP id o1so1535982edv.1 for ; Wed, 01 Apr 2020 13:31:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DBjdSPXE/6dhZ17WWAfxRA8tbpzcbJh3eAJ5O42gqfY=; b=IGkoDtyiaTzsf7pLuMQaRFwOG+a1DG9slQei/GLTqufGtEScaDuD2aB1yN+jU6u+25 ZXNmMKn2i4MP1Ph6a8oOW5esuVF/HoFHCUICHiRC0mp8tgHDOlDXRX+ruVZ4uYEqtfWN NPDuwuU0ILplPzPl4UJIln7jg8+W1jxVwiw9Ww3H9vm5WWInr7rb6o0uKdXqeK5kzfhA 0oWSZ26/mK1r/CE4ffghM4xEpcursiDq3KY8dEtjrGExtUR8vHoUVWuJtU5z1mKwkZLd obKs5zldxxwkQHkRNbcDuYRegWotG89fydZQdqO9PD+iPrYOKCKIPVFnOdiLonbZCSTN nQfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DBjdSPXE/6dhZ17WWAfxRA8tbpzcbJh3eAJ5O42gqfY=; b=Nu/4FYJDtYCQJx2px0yNhmnosE8xsCFy/lsvLNWrzb9U/dN35y8xcBhF7Wkeqq9q0R /xBzZHUOAb3dauA46PyHrXAcwW1Jy0WOayItDV+o+Z9Cgfhlf5uuxyBwPWn84yXXyUKp NQ+fJb4x9qppnikRMfgTWiBOK7x/BZwZA2yZ1y2XUlOGkIHm/qwTpHbk5PBIB93+LkUZ rk7SuyHh+JBpjfTbKdLRNTGJZODvh6VujrAFlvrxBr/toYcKa1H9H8kwDsQuECaznyN2 s84vainx9E3HxphJmRub7Q83cLGIWVTQY2dtLgu7uTVYAfJcSLuXjhxILnJuM9fXF9JZ Q4jA== X-Gm-Message-State: ANhLgQ3IEbYJd3DnO+Q6G0DQJO8ItseZ7LOYZSJNrqlOynjDtp5edwOJ NJG/HAmMV0r8pjbDXYfcmpNjZDykSAuS1Dij8bAqUg== X-Google-Smtp-Source: ADFU+vswBjP4j1n+6ACzm+zV8axSXvSjQK2m5q3sTL1QuKcC7l/nLC1liTOl4YgcGuVPOSE92R8QvVrYyliozn9Ixjo= X-Received: by 2002:a17:907:414d:: with SMTP id od21mr22683254ejb.178.1585773100664; Wed, 01 Apr 2020 13:31:40 -0700 (PDT) MIME-Version: 1.0 References: <20200401193238.22544-1-pasha.tatashin@soleen.com> <20200401200027.vsm5roobllewniea@ca-dmjordan1.us.oracle.com> <20200401200855.d23xcwznr5cm67p2@ca-dmjordan1.us.oracle.com> In-Reply-To: <20200401200855.d23xcwznr5cm67p2@ca-dmjordan1.us.oracle.com> From: Pavel Tatashin Date: Wed, 1 Apr 2020 16:31:29 -0400 Message-ID: Subject: Re: [PATCH] mm: initialize deferred pages with interrupts enabled To: Daniel Jordan Cc: LKML , Andrew Morton , Michal Hocko , linux-mm , Dan Williams , Shile Zhang , Kirill Tkhai , David Hildenbrand , James Morris , Sasha Levin Content-Type: text/plain; charset="UTF-8" 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, Apr 1, 2020 at 4:10 PM Daniel Jordan wrote: > > On Wed, Apr 01, 2020 at 04:00:27PM -0400, Daniel Jordan wrote: > > On Wed, Apr 01, 2020 at 03:32:38PM -0400, Pavel Tatashin wrote: > > > Initializing struct pages is a long task and keeping interrupts disabled > > > for the duration of this operation introduces a number of problems. > > > > > > 1. jiffies are not updated for long period of time, and thus incorrect time > > > is reported. See proposed solution and discussion here: > > > lkml/20200311123848.118638-1-shile.zhang@linux.alibaba.com > > > 2. It prevents farther improving deferred page initialization by allowing > > > > not allowing > > > inter-node multi-threading. > > > > intra-node > > > > ... > > > After: > > > [ 1.632580] node 0 initialised, 12051227 pages in 436ms > > > > Fixes: 3a2d7fa8a3d5 ("mm: disable interrupts while initializing deferred pages") > > Reported-by: Shile Zhang > > > > > Signed-off-by: Pavel Tatashin > > > > Freezing jiffies for a while during boot sounds like stable to me, so > > > > Cc: [4.17.x+] > > > > > > Can you please add a comment to mmzone.h above node_size_lock, something like > > > > * Must be held any time you expect node_start_pfn, > > * node_present_pages, node_spanned_pages or nr_zones to stay constant. > > + * Also synchronizes pgdat->first_deferred_pfn during deferred page > > + * init. > > ... > > spinlock_t node_size_lock; > > > > > @@ -1854,18 +1859,6 @@ deferred_grow_zone(struct zone *zone, unsigned int order) > > > return false; > > > > > > 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; > > > - } > > > - > > > > Huh, looks like this wasn't needed even before this change. > > > > > > The rest looks fine. > > > > Reviewed-by: Daniel Jordan > > ...except for I forgot about the touch_nmi_watchdog() calls. I think you'd > need something kind of like this before your patch. Thank you for review. You are right, I will add your patch, and modify my to change touch_nmi_watchdog() to cond_resched(). Pasha