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,URIBL_BLOCKED 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 08EC8C433E9 for ; Fri, 29 Jan 2021 20:26:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5A13264DE7 for ; Fri, 29 Jan 2021 20:26:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5A13264DE7 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 3C0898D0002; Fri, 29 Jan 2021 15:26:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 36EE38D0001; Fri, 29 Jan 2021 15:26:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 284C58D0002; Fri, 29 Jan 2021 15:26:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 128078D0001 for ; Fri, 29 Jan 2021 15:26:12 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id CF2C21EF1 for ; Fri, 29 Jan 2021 20:26:11 +0000 (UTC) X-FDA: 77759944542.03.crack79_280691e275ab Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id 9800628A4E9 for ; Fri, 29 Jan 2021 20:26:11 +0000 (UTC) X-HE-Tag: crack79_280691e275ab X-Filterd-Recvd-Size: 5219 Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Fri, 29 Jan 2021 20:26:10 +0000 (UTC) Received: by mail-ed1-f42.google.com with SMTP id f1so12000374edr.12 for ; Fri, 29 Jan 2021 12:26:10 -0800 (PST) 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=uYaEhe2BhsLmqOBndIe4KIykrf2Qm1MAXwsQhK8h2oI=; b=Cvz/8cQzusi9dgoQgXG8FRGLehVhS/gcTlRV7Sh6Q6kyB0uRZktk5+fyKkMtS2dP1q DQR9OwYHUsD0tFY7DK6Zas9ticlBA6iuS+/+WVfohEMKcLs3nmgzAF1nV7rfyg1Cd38d xYykiSk7ym5PAwhheB07AuGswjwX6X2wWtc/9xxbLo2/yI2gBSfb4C52P99f/Gp5rZpf aLyIPsCDARLTBPz7P9xwnWWh6wxX2S/fw9/5Yr223BVJ3rRQE0AKenKAKC8PJtYC4fsu h+uqq7955FMKRcI7SSSORtR7EycZDIAQE5x0KyQpr/fAg+cFeWuZgWuvtdldRGUD3gds uSPg== 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=uYaEhe2BhsLmqOBndIe4KIykrf2Qm1MAXwsQhK8h2oI=; b=oWpD1DgWLVnodzlojjGi4yQhmZTrgYso/ngZKrwQw2FJH/C15xAwnnSJWnDzk7cpMI S6HV7GHLB3yDGnL9xJdN0k1G7DIlSh+fMpg5R8G6Q77vmwtSOSyS6jBeSPl/0TYja87k 9Saz2KmhYS3k0YUip52E6g+WyzcVtOZSJRubfs/7Qzaa7H8V8VIz/8b3gPj0nKVTUplB CtIhV8gI6pv6rdDhtTjuAR2/BbUddh9QbERR8ujcFADWtqhTLfOTKrQVGGzsyDu+MHMB oMahr4xK2uUdXl7cTWPlPeIuLumWY59BA+NOkO1xettdRBNPrlx5Bne6QOYIR7TQfhMm rxuA== X-Gm-Message-State: AOAM531b63rsdrfhK3g8BHjS99lyxBjKnj/hOdl67JAJjvTjHWDs9GMI gZk1az6NOGJW8EiTeiTOsk2/GKSj2UNFD5Kv/JoQZw== X-Google-Smtp-Source: ABdhPJwDgwEW2Uk/fBvDxPQqbJMbn1cet9/TMoAxpBbbEp8orDs/Qtzkh4Fkd4Sy6NzN2S3GArLAIHXkX0SylrvknfA= X-Received: by 2002:aa7:dace:: with SMTP id x14mr7265846eds.300.1611951969280; Fri, 29 Jan 2021 12:26:09 -0800 (PST) MIME-Version: 1.0 References: <8c2b75fe-a3e5-8eff-7f37-5d23c7ad9742@redhat.com> In-Reply-To: From: Dan Williams Date: Fri, 29 Jan 2021 12:26:07 -0800 Message-ID: Subject: Re: dax alignment problem on arm64 (and other achitectures) To: Pavel Tatashin Cc: David Hildenbrand , linux-mm , LKML , Sasha Levin , Tyler Hicks , Andrew Morton , 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" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Jan 29, 2021 at 5:51 AM Pavel Tatashin wrote: > > > Since we last talked about this the enabling for EFI "Special Purpose" > > / Soft Reserved Memory has gone upstream and instantiates device-dax > > instances for address ranges marked with EFI_MEMORY_SP attribute. > > Critically this way of declaring device-dax removes the consideration > > of it as persistent memory and as such no metadata reservation. So, if > > you are willing to maintain the metadata external to the device (which > > seems reasonable for your environment) and have your platform firmware > > / kernel command line mark it as EFI_CONVENTIONAL_MEMORY + > > EFI_MEMORY_SP, then these reserve-free dax-devices will surface. > > Hi Dan, > > This is cool. Does it allow conversion between devdax and fsdax so DAX > aware filesystem can be installed and data can be put there to be > preserved across the reboot? > It does not because it's not "pmem" by this designation. Instead if you want fsdax, zero metadata on the device, and the ability to switch from fsdax to devdax I think that could be achieved with a new sysfs attribute at the region-device level. Currently the mode of a namespace with no metadata on it defaults to "raw" mode where "raw" treats the pmem as a persistent memory block device with no DAX capability. There's no reason the default could instead be devdax with pages mapped. Something like: ndctl disable-region region0 echo 1 > /sys/bus/nd/devices/region0/pagemap echo devdax > /sys/bus/nd/devices/region0/raw_default ndctl enable-region region0 ...where the new pagemap attribute does set_bit(ND_REGION_PAGEMAP, &nd_region->flags), and raw_default arranges for the namespace to be shunted over to devdax.