Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3623356imm; Tue, 17 Jul 2018 07:48:18 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcMIF1Brp+nGQ4bpwPunzQZhLEIunvqnZS/Y1OoDbBXdRzeMb6/q5PRh0ly3zqs7gistK4A X-Received: by 2002:a62:21c3:: with SMTP id o64-v6mr984353pfj.21.1531838898632; Tue, 17 Jul 2018 07:48:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531838898; cv=none; d=google.com; s=arc-20160816; b=b+RqkuqnShS68/1/r/cFFZsfhL49Ba3kPoVX+xBfUkW2qhHiPhe+4zyBsan1Q4Aawr O+aFp3xze3OduxXjHF5lfYBx2tz+h6n1HxPrulDrrzyjppRORwL0NeRdZMeRWgHvk3ai ThiFD7hViuuj3L1CudHt8/Oj3/t27F+ht1G95jKhtIrsSjGJ2bauskUv8gvzvzBO6Ol9 MGkXg/P5Z0yW+6InKUwLDHBpBe+T9FnhHyzj5S9+0Nm53wiHXOWzG6XqidRC9s1Sdp1r oksbR19kEf+bnlHjuwnqTQHGLhBYviL9KR5apc6zn7aKQWByhuj36aHaCA1D82E5337h ZjWg== 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 :arc-authentication-results; bh=LVlUeDYJUcqbSEDZzTsYNjx4zU/4OM5tIjC0oYAoGW8=; b=n1pSZBHnEp819v9X4bdnToDOY9xkcm+UDTfir2vD+Tf7sg5yxZbWr0tfSnwJ5sCVzR 3bpXqC1WL+uYrgTX4ik13nzp1GNrmiLxvFO6Oq3rS0YDImQsd7PafP4+Lhigr84t93Fw R+lD7pTLguSLCKWr7/rOR7hNCJqiT93JPOt9m986ZsgjomzC6dM9/9g+rlN1CnCHmkCf haFgyhgeP3AM2z52HNe1BTYwPTjM5b+OrjkAy34Vc1e3/UY9XYlKFxXGy0BUkogzWiK1 W96WKDBmrS2mMQ1kS4yNXc5xHIW3rI4soc/9+XAkSFVroD93EQe6IBSK0HCw02aP5k+D Axwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=WHcy+Pt7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bc5-v6si964403plb.413.2018.07.17.07.48.03; Tue, 17 Jul 2018 07:48:18 -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=@oracle.com header.s=corp-2018-07-02 header.b=WHcy+Pt7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731841AbeGQPUU (ORCPT + 99 others); Tue, 17 Jul 2018 11:20:20 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:45364 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729727AbeGQPUU (ORCPT ); Tue, 17 Jul 2018 11:20:20 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w6HEiKe2094326 for ; Tue, 17 Jul 2018 14:47:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : references : in-reply-to : from : date : message-id : subject : to : cc : content-type; s=corp-2018-07-02; bh=LVlUeDYJUcqbSEDZzTsYNjx4zU/4OM5tIjC0oYAoGW8=; b=WHcy+Pt7G6XERwdU/52Jgy0De4YDjyDAoJQLOHOI0C4KODspEFCdaxz0+2izlw3/MqzX 12bUsWbrsOqIIwxlXJQHrO+/vbeLunk6OsYSjGIji49PPZe+IVcldXlsboZlUvl/Xe5h kuZP3j2PBJt/LRQP4S0kaf2xG8TX5wT/y4XCJ7iOeZLuY9N0Dr01FwNmVyDPpY5ISR/X UtR+EJVGqqDBjybyR/HMWuwfP387kSQiWcTglnqANe+7/VgsvLaU1DUa07ES6o9vXv2K 9FXjFiMAJIPA2CHTc0OqCmiayNPJbX/njjBsjU42jF+iqspALhvI3KVoWjrucVA7Fi/E mw== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2k7a3t12ca-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 17 Jul 2018 14:47:18 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w6HElH6P020016 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 17 Jul 2018 14:47:18 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w6HElHwR005503 for ; Tue, 17 Jul 2018 14:47:17 GMT Received: from mail-oi0-f54.google.com (/209.85.218.54) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 17 Jul 2018 07:47:17 -0700 Received: by mail-oi0-f54.google.com with SMTP id q11-v6so2477406oic.12 for ; Tue, 17 Jul 2018 07:47:17 -0700 (PDT) X-Gm-Message-State: AOUpUlHcc5m5DC35gQeM4gS5HqJzGv+5PRmv8oYH/LuSNKflNEdbT6fk nqemIF4GXj/9PmH37If4ZaxbpaXUs4Z+WQ6c+yM= X-Received: by 2002:aca:3bc2:: with SMTP id i185-v6mr2130311oia.156.1531838835402; Tue, 17 Jul 2018 07:47:15 -0700 (PDT) MIME-Version: 1.0 References: <153176041838.12695.3365448145295112857.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: From: Pavel Tatashin Date: Tue, 17 Jul 2018 10:46:39 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 00/14] mm: Asynchronous + multithreaded memmap init for ZONE_DEVICE To: dan.j.williams@intel.com Cc: Andrew Morton , tony.luck@intel.com, yehs1@lenovo.com, vishal.l.verma@intel.com, jack@suse.cz, willy@infradead.org, dave.jiang@intel.com, hpa@zytor.com, tglx@linutronix.de, dalias@libc.org, fenghua.yu@intel.com, Daniel Jordan , Yoshinori Sato , benh@kernel.crashing.org, Michal Hocko , paulus@samba.org, hch@lst.de, jglisse@redhat.com, mingo@redhat.com, mpe@ellerman.id.au, Heiko Carstens , x86@kernel.org, logang@deltatee.com, ross.zwisler@linux.intel.com, jmoyer@redhat.com, jthumshirn@suse.de, schwidefsky@de.ibm.com, Linux Memory Management List , linux-nvdimm@lists.01.org, LKML Content-Type: text/plain; charset="UTF-8" X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8956 signatures=668706 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=3 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807170155 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > Hi Dan, > > > > I am worried that this work adds another way to multi-thread struct > > page initialization without re-use of already existing method. The > > code is already a mess, and leads to bugs [1] because of the number of > > different memory layouts, architecture specific quirks, and different > > struct page initialization methods. > > Yes, the lamentations about the complexity of the memory hotplug code > are known. I didn't think this set made it irretrievably worse, but > I'm biased and otherwise certainly want to build consensus with other > mem-hotplug folks. > > > > > So, when DEFERRED_STRUCT_PAGE_INIT is used we initialize struct pages > > on demand until page_alloc_init_late() is called, and at that time we > > initialize all the rest of struct pages by calling: > > > > page_alloc_init_late() > > deferred_init_memmap() (a thread per node) > > deferred_init_pages() > > __init_single_page() > > > > This is because memmap_init_zone() is not multi-threaded. However, > > this work makes memmap_init_zone() multi-threaded. So, I think we > > should really be either be using deferred_init_memmap() here, or teach > > DEFERRED_STRUCT_PAGE_INIT to use new multi-threaded memmap_init_zone() > > but not both. > > I agree it would be good to look at unifying the 2 async > initialization approaches, however they have distinct constraints. All > of the ZONE_DEVICE memmap initialization work happens as a hotplug > event where the deferred_init_memmap() threads have already been torn > down. For the memory capacities where it takes minutes to initialize > the memmap it is painful to incur a global flush of all initialization > work. So, I think that a move to rework deferred_init_memmap() in > terms of memmap_init_async() is warranted because memmap_init_async() > avoids a global sync and supports the hotplug case. > > Unfortunately, the work to unite these 2 mechanisms is going to be > 4.20 material, at least for me, since I'm taking an extended leave, > and there is little time for me to get this in shape for 4.19. I > wouldn't be opposed to someone judiciously stealing from this set and > taking a shot at the integration, I likely will not get back to this > until September. Hi Dan, I do not want to hold your work, so if Michal or Andrew are OK with the general approach of teaching memmap_init_zone() to be async without re-using deferred_init_memmap() or without changing deferred_init_memmap() to use the new memmap_init_async() I will review your patches. Thank you, Pavel >