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.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 E4B0EC47094 for ; Mon, 7 Jun 2021 20:41:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 608CA61182 for ; Mon, 7 Jun 2021 20:41:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 608CA61182 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EAC526B006C; Mon, 7 Jun 2021 16:41:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E83526B006E; Mon, 7 Jun 2021 16:41:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D247D6B0070; Mon, 7 Jun 2021 16:41:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0185.hostedemail.com [216.40.44.185]) by kanga.kvack.org (Postfix) with ESMTP id 9C82E6B006C for ; Mon, 7 Jun 2021 16:41:29 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 3AF22180AD802 for ; Mon, 7 Jun 2021 20:41:29 +0000 (UTC) X-FDA: 78228098298.15.A9F9372 Received: from mail-oi1-f173.google.com (mail-oi1-f173.google.com [209.85.167.173]) by imf25.hostedemail.com (Postfix) with ESMTP id 9C5E16001029 for ; Mon, 7 Jun 2021 20:38:31 +0000 (UTC) Received: by mail-oi1-f173.google.com with SMTP id u11so19397817oiv.1 for ; Mon, 07 Jun 2021 13:38:33 -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=L6FIDTCFEtrXgKbHDhwTWqzryApfXRNgdkxabvY4188=; b=IjissTbP2H5cet6FCXTNl30Wp/VnCNmo3Y5bDLrdmPw1OIa9KCe4dop9+z/NgHVKNP a32GJSPU3fxmjbnqn1NuINGqgPuTab6SCPQC9DeMX8HkhnsV5peb1jkl6uuCPo+pJw0Y kXf18RhlkE2MuxSUw1Rz/wilF/sWAe/0oN84WRr0IKOXTQwi445Y6212a3rLHISFG79b aZGcxn8JblTw+/ScVEUtiJwvg5bcWsDuILE+CjtpZmuuJsupYPj1DoCMPnw73IeOPn85 rB1OvMnlwtA1PvF4EW+PyIseEWwr/W3UFAKOqQMik1X8h/QxFnuPcEksSRx2HnmXidTk 9DLQ== 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=L6FIDTCFEtrXgKbHDhwTWqzryApfXRNgdkxabvY4188=; b=Bgb/bI5AnQedXhOgxV5cJyhyIk4WP14D5fZ3AqPphqRMejIm0gWLeR1Rfpk+3CsU3Z rMllEBibkdHV2O4zrrtUf1+VWu0cHeMYm0ua5sR7/gOESLVOGun5OWWHvUBU9BlJ6jsi fxnYe89HIqo3fTduzoS6ppUD4GjIowgoeCk3dVOCFdMqKRIxer4IWJGXl70fwsb1uXY8 YgaovmxsIozoWu4e1BrWYiITBUIr+M4gSk2bb3IwgxompcLND7cSmbDn1wLIo01Ea1qH yWQQlWtQA7RKDWAYNLnwdWxmz6+kUqwXJhkCvH2OmySFfs7rGWF7nNnh0LGAP4tIem8G t1bw== X-Gm-Message-State: AOAM5336HgN7cE8NZHVj48dByAX2MDYALkVmRIcsfBY1NmCCekICk+lA mMARNuY4TWwOauKE4pHo38CFWMoEDriBn/3mx8ubK5qb9Iw= X-Google-Smtp-Source: ABdhPJxLdqGwcZ+2kEFzaars2FEGU1U2AgrynhV6aFbI97/DYi0LMFPol174B5blpjQDiF+1RfKj+i5Pqb+ntWQzbFk= X-Received: by 2002:a17:90a:414a:: with SMTP id m10mr686202pjg.149.1623094378041; Mon, 07 Jun 2021 12:32:58 -0700 (PDT) MIME-Version: 1.0 References: <20210325230938.30752-1-joao.m.martins@oracle.com> <20210325230938.30752-10-joao.m.martins@oracle.com> <840290bd-55cc-e77a-b13d-05c6fd361865@oracle.com> In-Reply-To: <840290bd-55cc-e77a-b13d-05c6fd361865@oracle.com> From: Dan Williams Date: Mon, 7 Jun 2021 12:32:47 -0700 Message-ID: Subject: Re: [PATCH v1 09/11] mm/page_alloc: reuse tail struct pages for compound pagemaps To: Joao Martins Cc: Linux MM , Linux NVDIMM , Ira Weiny , Matthew Wilcox , Jason Gunthorpe , Jane Chu , Muchun Song , Mike Kravetz , Andrew Morton Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 9C5E16001029 Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=intel-com.20150623.gappssmtp.com header.s=20150623 header.b=IjissTbP; spf=none (imf25.hostedemail.com: domain of dan.j.williams@intel.com has no SPF policy when checking 209.85.167.173) smtp.mailfrom=dan.j.williams@intel.com; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=intel.com (policy=none) X-Stat-Signature: sgffnqbnibsizriuo3c9yh99kcqmqypy X-HE-Tag: 1623098311-342312 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000004, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Jun 7, 2021 at 6:49 AM Joao Martins wrote: [..] > > Given all of the above I'm wondering if there should be a new > > "compound specific" flavor of this routine rather than trying to > > cleverly inter mingle the old path with the new. This is easier > > because you have already done the work in previous patches to break > > this into helpers. So just have memmap_init_zone_device() do it the > > "old" way and memmap_init_compound() handle all the tail page init + > > optimizations. > > > I can separate it out, should be easier to follow. > > Albeit just a note, I think memmap_init_compound() should be the new normal as metadata > more accurately represents what goes on the page tables. That's regardless of > vmemmap-based gains, and hence why my train of thought was to not separate it. > > After this series, all devmap pages where @geometry matches @align will have compound > pages be used instead. And we enable that in device-dax as first user (in the next patch). > altmap or not so far just differentiates on the uniqueness of struct pages as the former > doesn't reuse base pages that only contain tail pages and consequently makes us initialize > all tail struct pages. I think combining the cases into a common central routine makes the code that much harder to maintain. A small duplication cost is worth it in my opinion to help readability / maintainability.