Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2038070pxb; Fri, 29 Jan 2021 11:18:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJyybYOcSsP1KGhqqo+imF89KJ9E/6ymhQFchbVTb4O8wVb8UudwgqUa+yHqLSQ/+BZsx+AB X-Received: by 2002:a17:906:404a:: with SMTP id y10mr6083308ejj.331.1611947891690; Fri, 29 Jan 2021 11:18:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611947891; cv=none; d=google.com; s=arc-20160816; b=PRdQVNYyr+LdyGhs6nYi5bYTcE652/cxAG4V3J1nPJjZpGmx4e3s+SrhViJ3VpVQsN dFh+w+FKfMS9j9qJ9+sOHyFRCJciQ3thiWJiEL0wbxlsLVFtUMIDjLjB+WKweFo8FJ5X 1mEnJUD+vIlXvJdgwry2R+3R26H8qW+0XChTNiKaZYK3mShrGMlvCHV3u/xXlxHl2cwO RUgaveiql3W1WKxqJimUua9MRIh2av/hcSskY2mnnaPiEXfkKpAtVbUCprOWYxsUnuVg VEZccsxvktn+rhIWc6KtE0vp8S6+Bk0TeU3ESjPriawbqUxl+VL5zO/A702sPHiUuVIf pxHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=gaI6OPXn00T7x/fWjtNIEnlv4T36Y5i9DpYyfu2PrY8=; b=yNSVgh8vmki/H4/7JSGvWNm3QzehrIrBZlKq5nVvSXB7uf05hPRWwZtEa64m8gyk0g MhN177ltZluJceOyTIh+MIygiB8Ekd+D4h/2duFmU9l0pZ03Ko1Mn3pLm3gTHdLPBM54 JRNbQglEsECk+/5HMq1fRwO+cR25F5Ft5mTXvfrmFSePmr98Jk7Hj69nsDyfmBxhJemO BfMDVb5MywcGdgoybE32e3cuoTptM7RtdrQxGbZkqKQhaBA0xUK4bM1vGZ4ka0HBLhrX YgKrHSoqGL0G/h7iNeBUQINZQNpwQYvSbd1ypum8bWpwiy5h1S9Yf5vygveMOVji3fYD vIaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=A4IKuG8G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e18si5286216ejj.130.2021.01.29.11.17.45; Fri, 29 Jan 2021 11:18:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=A4IKuG8G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230249AbhA2TOs (ORCPT + 99 others); Fri, 29 Jan 2021 14:14:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232555AbhA2TNp (ORCPT ); Fri, 29 Jan 2021 14:13:45 -0500 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29C43C06174A for ; Fri, 29 Jan 2021 11:13:02 -0800 (PST) Received: by mail-ed1-x52d.google.com with SMTP id bx12so11783682edb.8 for ; Fri, 29 Jan 2021 11:13:02 -0800 (PST) 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=gaI6OPXn00T7x/fWjtNIEnlv4T36Y5i9DpYyfu2PrY8=; b=A4IKuG8Gg5BkWo/2OBvRWlae087pil//44x54DbKXaoDSZcyD4mBzaUKJh6ERZwZs0 8p+A48Wff73q87hwKQKzT6wwLK9E+b16IBj1BBQxq5Nmh6SaVl3/6C0pWIOLrSEuw+qj zXPqxlrcCV41q0Fm1JoTq+bn+4SwW9kE8m7zvZUEf6zsQHDoXvhfGs4wUy1XEMFteSYp 1ijwRDoY9ABR5pPvO6iqPx+KsbshRJ+oIdabk+XeoPxWE6ZMYCfEVJMCP1RAUOA+dF3R /34AGN0ku1A4QsIZQKh4V+T7XpMYco4FQMsjXOuG7oUNi0ddbiCaPlWehxUU3fxxwT0z uIYA== 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=gaI6OPXn00T7x/fWjtNIEnlv4T36Y5i9DpYyfu2PrY8=; b=DrqIuDXP+fcK8mfox9ps+7wSjlJb1MHf14sAzEmLui4XsBmUNiowSeAs4tyMED73xP kPtH90soW0kZACiihQ/9/AQkuVs6BoARvLIg7j5/OmTA7Q8fTqC+2nUtNWMpm3qIIe2Q 6Dq3RJJqUQXF7pxPRsOuez4LCEoS9zD78uXET8GObqx4t/QjtRucsz1mGLesJF0SsnkQ U9/2Kmri4f5CHBlmNSKL5WRPLjukaZC/l7hF99hnaUFb15CQGMpakvF6Hi04yPZhWj+X JYxEGNl2pB8MYc7q+p/mtfUMXH8EpR22S+5Mz1uFyyKiqRfC9mLsyaKOkm5YSx/xfurH +uvg== X-Gm-Message-State: AOAM531ttxteYkKN2we9MHnqM/mg+MdnsqKyudt92yRuvyJKKtnfpYEi 7xrkLZg6KVdVTxRz90EaQwBX3VkaIcUjUWpaU7Ddhg== X-Received: by 2002:aa7:cd87:: with SMTP id x7mr7216981edv.210.1611947580910; Fri, 29 Jan 2021 11:13:00 -0800 (PST) MIME-Version: 1.0 References: <8c2b75fe-a3e5-8eff-7f37-5d23c7ad9742@redhat.com> <94797c92-cd90-8a65-b879-0bb5f12b9fc5@redhat.com> <92912784-f3a3-b5a5-2d45-4c86ae26315f@redhat.com> In-Reply-To: From: Pavel Tatashin Date: Fri, 29 Jan 2021 14:12:25 -0500 Message-ID: Subject: Re: dax alignment problem on arm64 (and other achitectures) To: David Hildenbrand Cc: Anshuman Khandual , linux-mm , LKML , Sasha Levin , Tyler Hicks , Andrew Morton , Dan Williams , Michal Hocko , Oscar Salvador , Vlastimil Babka , Joonsoo Kim , Jason Gunthorpe , Marc Zyngier , Linux ARM , Will Deacon , James Morse , James Morris Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 29, 2021 at 2:06 PM Pavel Tatashin wrote: > > > > Definitely, but we should try figuring out what's going on here. I > > > assume on x86-64 it behaves differently? > > > > Yes, we should root cause. I highly suspect that there is somewhere > > alignment miscalculations happen that cause this memory waste with the > > offset 16M. I am also not sure why the 2M label size was increased, > > and why 16M is now an alignment requirement. > > This appears to be because even if we set vmemmap to be outside of the > dax device, the alignment calculates the maximum size of vmemmap for > this device, and subtracts it from the devdax size. > See [1], line 795 is where this offset is calculated. > > This also explains why with 64K pages, the 16M offset worked: because > fewer struct pages were able to fit within 16M - label size. > > [1] https://soleen.com/source/xref/linux/drivers/nvdimm/pfn_devs.c?r=b7b3c01b&mo=18459&fi=718#795 Actually, strike the previous e-mail. The extra space is when we reserve vmemmap from devdax. IFF we do it from mem, the extra space is not added. Now, this alignment makes total sense. Pasha