Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2034811pxb; Fri, 29 Jan 2021 11:12:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJxuoiyupNq7OxTyttIPUn0kHjjCQCG41iQQp/+O3DRt0sPfeGDxe0ovOhBkNXOcyXcCJv57 X-Received: by 2002:a17:906:4151:: with SMTP id l17mr6366933ejk.54.1611947572933; Fri, 29 Jan 2021 11:12:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611947572; cv=none; d=google.com; s=arc-20160816; b=KgoMmQSmaH0uXeRtH7W/QB6Wv6E6iYgej7cJsKhtW8RXxHHhcLCsuahOWixpmqHKEY FlL1uymRUdpNo6Lzv5dp69tvnz4TF/D9Mp570xZWpX/rzq4m1Cki6uv4s2mvDQtzfFKR wsSjw4tf/bT1djvX0FccGc8UUuICHmlTxPp0QW4bea52CNteedJgwOphXtyjJv3P7/l6 jS+5EOB2Al/Xj+g1q/wg+IOz2JL3B80oRUMdD2pCOQfTrxmX5kV+MBd+FD4B1jC+YG6O TQxEx1+TK8tkn2x3qQq3vk6KgFN6Q+wTIyxAzTH58LRTJSyXqMojqphXxJLqpw9nqU1c wACA== 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=vMk9WGzVPpcoDliWw6CE1qXVyF1iQxXPLajClJEgv98=; b=yPkZRoTrG5dRB9JMV42rd7HJnPrAKa9ogA/mt94PV3IV6w0nik1Vu2GN+gneECM/FN HOFl6FUF8aJc1buKDw4bvxKMBykKjTCJmV6pTi9USiEJIcNOtIBBf6fD2Pn1wm9seCUW K1nBAGGGGrqcBZE2wiIJCJG9aC81SwC3FGy2Z0QeytTaYjzBNkNWnhBeTLegkCa1ZOou YP0JomCRVMlFT7EgsLlL5cw2vLT6p/SU/JXmF3cbmSVGNFqIohrgUludTya0iibv2ifw iZuN9ML0H5B6Wu8IKw8Ou6QCjz+H9zZ3WKRcjAgRBlMRlZmU6nce9xG8p/GliGurOmiE p4Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=Z6Bk9oGB; 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 c3si5419281ejb.238.2021.01.29.11.12.28; Fri, 29 Jan 2021 11:12:52 -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=Z6Bk9oGB; 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 S231533AbhA2TJn (ORCPT + 99 others); Fri, 29 Jan 2021 14:09:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232752AbhA2THk (ORCPT ); Fri, 29 Jan 2021 14:07:40 -0500 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 706DBC061573 for ; Fri, 29 Jan 2021 11:07:00 -0800 (PST) Received: by mail-ed1-x531.google.com with SMTP id d2so11807884edz.3 for ; Fri, 29 Jan 2021 11:07:00 -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=vMk9WGzVPpcoDliWw6CE1qXVyF1iQxXPLajClJEgv98=; b=Z6Bk9oGBsdd9aKFm0lhB2VUOgbChso56sK1q34eUOnaYX0wqNSsvQ5K/bvfJdm2owu CsXHCKomyiChcgdeQrKTfW+4drbC2690CBgYZZZZx0mpwrm8Cx1TGmLXkSENJEf1+iOT dXYTRdxmmSomCTejkqVFKN9bz4257beF/X/78A+5gDkQEWTvp8LQSMVhrrPjH3PHVPqY JmFCFc9Q6CvfN1Ch2PGboI5r3XVS1sNow83cRzA9y+kgdr03IVNWwj+aQXYokNnbKbh/ 7h1Sb9xkjG9Q/fa4GB07AcVwQ7tCXh16lM30KTZZ060hTaQOdQNoCEb31ero8qhOWohJ LI8A== 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=vMk9WGzVPpcoDliWw6CE1qXVyF1iQxXPLajClJEgv98=; b=HukHN0labrvrzmaHB/BhQNQA2gAxTYWuTyuFwMeZC2EZ65MOQqldqj0esOFbwb2VlD w4EWkTuCX08mTeakbD/EXUziMHbdiesx0+FQyjTI8kpx/CT9lXgP8oad+txGM1iPocTM cBl5cBxfsFHA93xHBqImqT8sdtPqt8locaGXSPYMmLC7fsk/QdiIdb9GWJShseb5CWra 8qFi0ZcoNXY2rEFJDXpf2omyF5Rshzo/0OTnvRq/sKxNsnWMiy7Jaszlqn93iu/L3Vr7 YulrGWU/95lWYCPliQNKG+Ek3Qiw6Gpp40mfBp1PCLBlx8vH4rFgP7iqCjqtehA31d2c rd1g== X-Gm-Message-State: AOAM531IJ8ee8nGxzvPPQg4I9l9262R04CICLJ/dlbUUfSJBsxkO2Ove 8ZigQgn1E6KU5zJrHqTWJOgThfNZMcBgiYkY9OJJFA== X-Received: by 2002:a05:6402:402:: with SMTP id q2mr6948030edv.116.1611947219186; Fri, 29 Jan 2021 11:06:59 -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:06:23 -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 > > 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