Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp713101imm; Fri, 27 Jul 2018 04:59:09 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeRkKFMZDSsj9YFoEZZeCdgDEboYF0/naIBKxPaCwLJg4MEWH7BbbhCLn7WA3jTnRRrew02 X-Received: by 2002:a62:8a83:: with SMTP id o3-v6mr6453246pfk.12.1532692749515; Fri, 27 Jul 2018 04:59:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532692749; cv=none; d=google.com; s=arc-20160816; b=cbuZpU7JXLvS7ubc+UIVl5Fa6hJEomTXu5BUR2aALy2wuZKNvaxJg4B48jNjUi3YzY odG2vciVoC6bp5MEA6TgBkFPkguD+dkQsPoDCgaUINSTSs6g3DZ6C3kh05MbtZ69dJ6o dcWXh5nmQ4/2hEQRgo7wIZV7xNql+ONh0mK3YGNMqPWRzs1XlZ2fj6zRnBY5NyNfwVkE +Rd8CWhbG6XNOr/2xPgkh1U3CSlk/wvQ0/r/hV0BRDZQeVuoYMQqYB7a06PD//clUGxV 3U25toSqmC/1veniBU4QJDrvEpP2U0xmJNw7t1Q/uOaf1h6l02LLRIS2YyqJrPUsNCfV KDuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=C346TXP08hQ83aqIVdDlTwEDeQFVwrj1FhJIUolPwHQ=; b=h/VPZX6p0swgPZrRRuxeiVflaIjF1fAFBrcGpkZt7vwIRS3MIq4PEA9ahgizytBvYm 4Z3S/19ST+Zc80QcjAFe3rMAO0wQK/MASbWJUvIBDFiKROZPOWvdfR9LYWwUSPCP6d82 Gkbco6f+VEnnyfivE/k3T+/kI3McL+ViPBiBcBiuoXjDpYJgpHGQVJoQIprqwbRfHwgp gfU8wW6BZ0Agcks7rN5Tk2FcXHyge1FKgociqbCdRk3ZdPqU/Mj3gMlVSjPQJuS3Djzg av/A4UaPymzwQ8n5vtu1ovwEf16U9ZIp6Bbse7X480pLpPLfh31lt2Z2O00ZnFSeoz+7 sxUA== ARC-Authentication-Results: i=1; mx.google.com; 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 j11-v6si3075124pll.234.2018.07.27.04.58.54; Fri, 27 Jul 2018 04:59:09 -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; 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 S1730801AbeG0NSX (ORCPT + 99 others); Fri, 27 Jul 2018 09:18:23 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:39426 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730425AbeG0NSX (ORCPT ); Fri, 27 Jul 2018 09:18:23 -0400 Received: by mail-wr1-f68.google.com with SMTP id h10-v6so4785047wre.6 for ; Fri, 27 Jul 2018 04:56:47 -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:user-agent; bh=C346TXP08hQ83aqIVdDlTwEDeQFVwrj1FhJIUolPwHQ=; b=FsbYcD463rXOccYNQd0vljHkmgmu2L5HxaQcESMP3Hpi7+KjhfG7OVCnoD+jnM2Ryt UvE0QIJ5zowjaNw1u9ZLc/7KAqOzyc8qNZJUClQZI5vXmcc3CTOfa46QXC2uUXzaRRbc fUuTnMMcURNRRAT4xhnND6DzTSCvxNno4f24/HGb/10P4wbXwHCYWCx1PbZC1eYY3n5K /RM9/CMBNwp5rG+CGzU6lffsQmf/J0FUoVhB1Yxk1D5IUK04/zKiBLzgBcuF3sHDT0pR qCL87MF1u0H5cB6FPbXVIaxCW4Rph2owcoUDp8QMRrAq2k/YB5HLGQdck6Ii4GePA44m lIRA== X-Gm-Message-State: AOUpUlGZq615zjBt2pg+xPtjUf5HKPNblzuoSqT60M46+iVN04geHwPB 6WOLmmN0HI5XqEidYg20CZM= X-Received: by 2002:adf:fb92:: with SMTP id a18-v6mr4336614wrr.278.1532692606771; Fri, 27 Jul 2018 04:56:46 -0700 (PDT) Received: from techadventures.net (techadventures.net. [62.201.165.239]) by smtp.gmail.com with ESMTPSA id a2-v6sm2944833wmb.6.2018.07.27.04.56.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jul 2018 04:56:46 -0700 (PDT) Received: by techadventures.net (Postfix, from userid 1000) id 100D8124400; Fri, 27 Jul 2018 13:56:45 +0200 (CEST) Date: Fri, 27 Jul 2018 13:56:45 +0200 From: Oscar Salvador To: Pavel Tatashin Cc: steven.sistare@oracle.com, daniel.m.jordan@oracle.com, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, kirill.shutemov@linux.intel.com, mhocko@suse.com, linux-mm@kvack.org, dan.j.williams@intel.com, jack@suse.cz, jglisse@redhat.com, jrdr.linux@gmail.com, bhe@redhat.com, gregkh@linuxfoundation.org, vbabka@suse.cz, richard.weiyang@gmail.com, dave.hansen@intel.com, rientjes@google.com, mingo@kernel.org, abdhalee@linux.vnet.ibm.com, mpe@ellerman.id.au Subject: Re: [PATCH v2 2/3] mm: calculate deferred pages after skipping mirrored memory Message-ID: <20180727115645.GA13637@techadventures.net> References: <20180726193509.3326-1-pasha.tatashin@oracle.com> <20180726193509.3326-3-pasha.tatashin@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180726193509.3326-3-pasha.tatashin@oracle.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 26, 2018 at 03:35:08PM -0400, Pavel Tatashin wrote: > update_defer_init() should be called only when struct page is about to be > initialized. Because it counts number of initialized struct pages, but > there we may skip struct pages if there is some mirrored memory. > > So move, update_defer_init() after checking for mirrored memory. > > Also, rename update_defer_init() to defer_init() and reverse the return > boolean to emphasize that this is a boolean function, that tells that the > reset of memmap initialization should be deferred. > > Make this function self-contained: do not pass number of already > initialized pages in this zone by using static counters. > > Signed-off-by: Pavel Tatashin > --- > mm/page_alloc.c | 45 +++++++++++++++++++++++++-------------------- > 1 file changed, 25 insertions(+), 20 deletions(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 6796dacd46ac..4946c73e549b 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -306,24 +306,33 @@ static inline bool __meminit early_page_uninitialised(unsigned long pfn) > } > > /* > - * Returns false when the remaining initialisation should be deferred until > + * Returns true when the remaining initialisation should be deferred until > * later in the boot cycle when it can be parallelised. > */ > -static inline bool update_defer_init(pg_data_t *pgdat, > - unsigned long pfn, unsigned long zone_end, > - unsigned long *nr_initialised) > +static bool __meminit > +defer_init(int nid, unsigned long pfn, unsigned long end_pfn) Hi Pavel, maybe I do not understand properly the __init/__meminit macros, but should not "defer_init" be __init instead of __meminit? I think that functions marked as __meminit are not freed up, right? Besides that, this looks good to me: Reviewed-by: Oscar Salvador -- Oscar Salvador SUSE L3