Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp3676544imd; Mon, 29 Oct 2018 10:35:15 -0700 (PDT) X-Google-Smtp-Source: AJdET5eaNeguv6+ZBX5lW9snH6IW9dI9MqXtzDOqcY4Ht+Y+cfqmRuvTTj/UBzFxNKYbdXo3nqxt X-Received: by 2002:a63:1444:: with SMTP id 4mr14485467pgu.430.1540834515715; Mon, 29 Oct 2018 10:35:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540834515; cv=none; d=google.com; s=arc-20160816; b=Y0NoE8h3SWgaVChU3/aw8CXpBf5QjMk7RUgqGMQ/utMjrZBnRua1MubQM4GOPKHZs7 QK3rx3IHzYbRbsvY5J34xWKRwc8DpzQqeSq5Akf3ARt1cGrAAg7Owpvq+6ki9hbgeJD0 7w3PoJhcv2VPu2+LZuw9ToUCW9/bUSaWA2FAzM0K0fcpG0b9M4bzz13iW3CA03c2kiOX R1B3hkwMuSqhApIyfgQjgU4yJFE/fQLSNZHNgKn0qLrzj+N9pQEh+gco0p2GRdqpjYxr kb2x/vop5z14eChepqTOZ3xMb7KvxztLBh97YkB6YbtcNUshTzK8XzIntvJPPSDc1TaO 7W+g== 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=E8MprY7VTm9p0yfpD9lSRFyDxBGNr193lmRNNx0JyUg=; b=wg8XU5/ptkGKcBYIUApYP/O+oEfid/YHtmI+AnOpCf1QMkDcdEg4ihjnIrrRiSLG1K A8SAT0en5abOg+yu/SzTmvd7B/TizMSZunwuvYktICxKHPzKaI+xZJDjBuHbyzsI1Z8V FGJP9AE7+LIUi+hDeUoaWySgVYfPNtAKOQsxhDA24zVYi8KNDchsXS8yha87I9YSCdmA /Trxb2YBCWm4YAYZNUBH35DjCaT9nkq6GmGRwqwUICRdJg8H75/uNQ6nbW573kTBiwWv VSViehl58Mr7MQwQgEEADeUlVgTfeh5PdGzQ2dHbewRV+7QsNJMoQc3U/FwUKRr+VXHz VDtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=ERmFGWaT; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h5-v6si1982194pfg.226.2018.10.29.10.35.00; Mon, 29 Oct 2018 10:35:15 -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=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=ERmFGWaT; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727677AbeJ3CYK (ORCPT + 99 others); Mon, 29 Oct 2018 22:24:10 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:35428 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726532AbeJ3CYJ (ORCPT ); Mon, 29 Oct 2018 22:24:09 -0400 Received: by mail-oi1-f193.google.com with SMTP id v198-v6so5072177oif.2 for ; Mon, 29 Oct 2018 10:34:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=E8MprY7VTm9p0yfpD9lSRFyDxBGNr193lmRNNx0JyUg=; b=ERmFGWaTpLpbrDnTCFAtYXkC/eW6TfOmgw+UVU0niqOQl1nqY7oY4xy8BA2Nm1G1Dr GJI01ajNUXjuX5XI3rgsdn+9f9okIePdkFynNm5u4lXTbPX24q1T15a6p8ipmQVOBUoW 3FO50j4MeIzri8HTFM1SFqtXsPqb+TKBytjoCuooCkyjVZsfJDyjGy/b6STmrVcMUIgr UP49h8F4xq31VPHOMcfKbaGZr3mtaT0Tih4hRKuIq1ke4F5E0nJOLwgRjVIeMMejpNwX l8rIEQHZ2QRX8Mq/oz3qe+r+VKhbbbFTSElOv98B5bzhfk3LEdiB+5IXbjovIIk4tQU1 D2Qg== 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=E8MprY7VTm9p0yfpD9lSRFyDxBGNr193lmRNNx0JyUg=; b=n6Z7A2XCeRncCTu1v+VZq9HTe/BnmrLG9mLrYI52QPvbgZgxBzIba/Y9HvnZvpEpup DR1vqFWVmtJhM5tpKG4Lixb9ztsLab2TiesnC3a9GWeHoLP024MrB9DY17EHzYVxx8Md cFpnr9p0Eet1/HXDtcFruAO6xalz+49ur/uJ+KUbF+eKZj/+HP/aZRNEVjwjOwxdqxI0 DnJDRjURHTBNO6KE8Xb9q/fcO+7g/M1J1SrkF/36ioWa9Zf7cjYx3x0xbJIxq+4ZWz+d N4lpWkwpGk9R16SrMKsJxI5hWDTNu+kTJBo0MMghIHsDWKREoL1NXeHhEVDWBpNXq6nC 8wgw== X-Gm-Message-State: AGRZ1gLfY0GPPgXkeT+417Bu5FT4nj/pZaPods0N7Jp5v7Glt/Gx4Rhv E+pRDqIvZKoOW/FAtfxnq2+3nC/LiorFDl8uxyf2kw== X-Received: by 2002:aca:590b:: with SMTP id n11-v6mr8492487oib.232.1540834474488; Mon, 29 Oct 2018 10:34:34 -0700 (PDT) MIME-Version: 1.0 References: <98c35e19-13b9-0913-87d9-b3f1ab738b61@linux.intel.com> <20181010185242.GP5873@dhcp22.suse.cz> <20181011085509.GS5873@dhcp22.suse.cz> <6f32f23c-c21c-9d42-7dda-a1d18613cd3c@linux.intel.com> <20181017075257.GF18839@dhcp22.suse.cz> <971729e6-bcfe-a386-361b-d662951e69a7@linux.intel.com> <20181029141210.GJ32673@dhcp22.suse.cz> <84f09883c16608ddd2ba88103f43ec6a1c649e97.camel@linux.intel.com> <20181029163528.GL32673@dhcp22.suse.cz> <18dfc5a0db11650ff31433311da32c95e19944d9.camel@linux.intel.com> <20181029172415.GM32673@dhcp22.suse.cz> In-Reply-To: <20181029172415.GM32673@dhcp22.suse.cz> From: Dan Williams Date: Mon, 29 Oct 2018 10:34:22 -0700 Message-ID: Subject: Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap To: Michal Hocko Cc: alexander.h.duyck@linux.intel.com, Linux MM , Andrew Morton , Linux Kernel Mailing List , linux-nvdimm , Pasha Tatashin , Dave Hansen , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , rppt@linux.vnet.ibm.com, Ingo Molnar , "Kirill A. Shutemov" , Zhang Yi 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 Mon, Oct 29, 2018 at 10:24 AM Michal Hocko wrote: > > On Mon 29-10-18 10:01:28, Alexander Duyck wrote: > > On Mon, 2018-10-29 at 17:35 +0100, Michal Hocko wrote: [..] > > > You are already doing per-page initialization so I fail to see a larger > > > unit to operate on. > > > > I have a patch that makes it so that we can work at a pageblock level > > since all of the variables with the exception of only the LRU and page > > address fields can be precomputed. Doing that is one of the ways I was > > able to reduce page init to 1/3 to 1/4 of the time it was taking > > otherwise in the case of deferred page init. > > You still have to call set_page_links for each page. But let's assume we > can do initialization per larger units. Nothing really prevent to hide > that into constructor as well. A constructor / indirect function call makes sense when there are multiple sub-classes of object initialization, on the table I only see 3 cases: typical hotplug, base ZONE_DEVICE, ZONE_DEVICE + HMM. I think we can look to move the HMM special casing out of line, then we're down to 2. Even at 3 cases we're better off open-coding than a constructor for such a low number of sub-cases to handle. I do not foresee more cases arriving, so I struggle to see what the constructor buys us in terms of code readability / maintainability?