Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2077371pxb; Fri, 29 Jan 2021 12:30:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJONR8DmIl2+wVZetq52uZhKZUVW1s3rIwxENHCpNHJ9IGi/VjwGMN97qPaW0kWfnk6Ee0 X-Received: by 2002:a05:6402:50ca:: with SMTP id h10mr7151801edb.181.1611952217629; Fri, 29 Jan 2021 12:30:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611952217; cv=none; d=google.com; s=arc-20160816; b=btzs6ET3pKFOPQHcFPoiDbmoErQ24oCRd7bVl6TJKpV8s5W7YEJW1F3y5nESGsz/6x aPQcXF7HgtIa8VlNjiROuvjEDShhdSoR0LCbpZ4uYJ+B6d5YApHIB+43Cl7L86XUERRP USoGghTD/kgimyMMJScS372DHxpRWZayx3BlPoKCFmXNaId+i3oUrR3nwWvNwmhQBJUU UU9kqBmLvvJv7UqGK/KN9Qf2+4eN/Hq8+It9BhfgM3SFJcB10ZFSCQsv3LTqfvksnvaN z2OiymbMYE4mOlz8QC67Hgc5ItnZUkLxxa60FflfoA+YxmaTMw114HF6vt8MhGZZMQTV HZsw== 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=uYaEhe2BhsLmqOBndIe4KIykrf2Qm1MAXwsQhK8h2oI=; b=EKCB29uZCcPuIFGafbO+PsqJ7hq3yXNC41fG9kt3yWJZ3lrYPTmuXOvcmxZggcIGPH ObKDh7yELRCNTsZPBSyhonXJ0zWl8KGSGaH4yUUNe/O2v0fURF7IRTFOh8zzU6qX24zk 5TbJVc5SYQonNXqySAwBnLeenUZxlSskUeTNqgdDVjoL6Ubhz2wcwKB+5MhkdCK4Kezb eWGyKdDmlpjypTLjCTP4oZag8ZyGV3KXXfNO1RXOXub4gdxnZrFcXvdJtY3lOQ9BOqfy TaVe9hvWWPHrgZHNRNP9yHWjcbvQ6ZwVo0X0EsyTYAi3G5Uf1bdd3nrp6F/Ur8+1+zlU wPuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b="Cvz/8cQz"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c15si5416513ejr.124.2021.01.29.12.29.52; Fri, 29 Jan 2021 12:30:17 -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=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b="Cvz/8cQz"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231485AbhA2U27 (ORCPT + 99 others); Fri, 29 Jan 2021 15:28:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232906AbhA2U0w (ORCPT ); Fri, 29 Jan 2021 15:26:52 -0500 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A6BEC061573 for ; Fri, 29 Jan 2021 12:26:10 -0800 (PST) Received: by mail-ed1-x536.google.com with SMTP id bx12so12019095edb.8 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=Fk6x9a3EYYZ193PrTcSdeVYFVQsmcEH14Xcjl0cXRGAIeEKchDe948ufThq6fhbyPr UBtCPyJqRu3sfdW3xoyRoMPyvg796oLLUgygFwZyvFNIPbs5+56x1zPO/UEOgxPKCjoo 8VbniKaDMtIASdo/8RVujCEa3Q1ZQ+Z3LYkzM1Vw3LrQhirc1rSNk80IbUuSSJUGGMD+ Z0bknM03k0ZzylXZ/v3e/foJlWi7MthYDDU6riW/dgrBIUqUbrN6vsUh95TQ3MU2bO/l F/kprh+Rh/ihXh22JBSEdJzBjcFCVfQTBzMCId9vXPkPz0hPWby1sP4G904Wa3JZYF9W eDEg== X-Gm-Message-State: AOAM530Drbp7ioDtVV1WgUyyW1LeVhG2g252Kyvt3fZnrV1tV6+OdExy wdTSuJ2MDJrQM5gB1npNhPTkiBl9JYlZLGxPk/1bnA== 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.