Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp994239ybb; Wed, 1 Apr 2020 13:33:26 -0700 (PDT) X-Google-Smtp-Source: APiQypLKoV1ddW9cEuU/qB5w7go/LPzra3T4Yf/6CGi8VIWnhEhNFRTO5M+PhvIjsFJ9+ertsWgt X-Received: by 2002:a05:6808:abc:: with SMTP id r28mr119662oij.161.1585773206200; Wed, 01 Apr 2020 13:33:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585773206; cv=none; d=google.com; s=arc-20160816; b=G319RpsV/l7ksppDUpawWyMc0Sg16b1GbG8ZLe8bsMlOpinMLL9m1/BnM9LhpIUFBR JVeG82Mib6jV6q9IjVS20hLjlcKj/gAo+8pvqM1i14Fg6lyt6dTNsKcDe2jlTOhprEz4 AOfC7yg+xHAy4OHeRer0/pSRNPFKIad/mpjPYa7ODpKFXfvKODraWCt9AxNKR7aD5e3B 7SbOdfgFYvpukcqgSAhSCyowUD4zb+vx9EUL3wAVOIzCNN5Dc/7RsdEnlCR2cAKVfuoM Fb7wofA4USitQTErvJ+IbPbaIhE4ZVjePeOOa2Dd0aPfhaf0EyUEl7tjUCMTv/PY/N78 2bBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=DBjdSPXE/6dhZ17WWAfxRA8tbpzcbJh3eAJ5O42gqfY=; b=jw/U2RkCSiL1KLjXB3ArgX/1xrYAS86EKbhGSySdcFqGK+M76WhPPWfxkh0h2oEUYA nC68UaGzA/LffKqc37lQ5c7kp6IT+3zUcN8mGNwcU+fF//Rbb3YGpW7NgiKMlXtFgcA4 dYa99Z2sA+m3IflooV2p9AaslxHwx5dc/6rUKAMb0vcV3QHvR+SXu2iFvs8cUaX7SqGg ihBeJquPcS/Ad7UtUNyyyfO63KAPSzBKtN+D+2Jwzuw7t6x+xP6w9FrklaPV47SCSQl9 /YqBT6MLqsi4dq1uZMvsBhYWRuNw7M7gx+FZL2hpDohN2oqxPiyq0SQqsIXh1IGHSvjz 3QNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=IGkoDtyi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e25si1195792oti.274.2020.04.01.13.33.13; Wed, 01 Apr 2020 13:33:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=IGkoDtyi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732619AbgDAUbm (ORCPT + 99 others); Wed, 1 Apr 2020 16:31:42 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:43162 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732337AbgDAUbm (ORCPT ); Wed, 1 Apr 2020 16:31:42 -0400 Received: by mail-ed1-f68.google.com with SMTP id bd14so1459868edb.10 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=abFFz4fFxIoBmGAVyvliOCSSpkYUHH/6wor1WoLHTrt+Qt3Wep6bMGhb8LAmtuRrOC PJX3jBgWB68tpkKZn6/Yn3mEqihZIR9GACasAHb7KJ4wAr+cGtDg1IIUxDSohdokaHSD VwDJlP9Es9UZJJIKUg+PpX/h8eyq7xtypmuBkr6phVBjON7O1BhGa7lbvXtgjfY9A0Zd tHTiyReHSDuKtjxv/5HGv91L9wh9w2PZf8PNT9izKrGt5QoROsBySrOi2z2sRNfWNJiJ DToOIOYBuJbm4hURPqpPHOhPVnWqflx5FbCBReIzsTzxr1V7uHUaqshPE+U1UvL/gtxr h18Q== X-Gm-Message-State: ANhLgQ3XdPDK0UhpdikXwsbeX9psbEQW2jfvV48XydX3i+zJ5SW3sjD5 ernRVPlpF6AlcP385Zh+qOMoIuTA6OcWdPl+YnB1vA== 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" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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