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=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 9C94CC433E0 for ; Fri, 29 Jan 2021 13:19:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D038264DED for ; Fri, 29 Jan 2021 13:19:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D038264DED Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EB19F6B006C; Fri, 29 Jan 2021 08:19:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E38BC6B0070; Fri, 29 Jan 2021 08:19:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D00E86B0071; Fri, 29 Jan 2021 08:19:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0119.hostedemail.com [216.40.44.119]) by kanga.kvack.org (Postfix) with ESMTP id B65316B006C for ; Fri, 29 Jan 2021 08:19:15 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 2EBA01EE6 for ; Fri, 29 Jan 2021 13:19:15 +0000 (UTC) X-FDA: 77758868670.22.chair95_5116b6b275a8 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 062AB18038C3C for ; Fri, 29 Jan 2021 13:19:15 +0000 (UTC) X-HE-Tag: chair95_5116b6b275a8 X-Filterd-Recvd-Size: 7385 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by imf35.hostedemail.com (Postfix) with ESMTP for ; Fri, 29 Jan 2021 13:19:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611926353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aXSNbd07ta4zmyw7U+kBhDwTYhz2zdv+oZTIEvnM49g=; b=PjN3DDlXQ9Un4GdnpTxWCkXD9pTZyMIKa/Q+u8ErIgVi0QkPFXYxzSmH1utARbwsGnRV+s wvMsdt+FX04SWow4JOUpZhV+HR0R/3Us/JY9u8qwTcyI2mvRe4g/JzqIXA7LL/E6Vn0e4A JteRMhP/+0FimW7EKZs72sGosQXEjZE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-506-2PsjMVcsO96uGzTYsQPtIg-1; Fri, 29 Jan 2021 08:19:09 -0500 X-MC-Unique: 2PsjMVcsO96uGzTYsQPtIg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 97E121800D41; Fri, 29 Jan 2021 13:19:06 +0000 (UTC) Received: from [10.36.113.219] (ovpn-113-219.ams2.redhat.com [10.36.113.219]) by smtp.corp.redhat.com (Postfix) with ESMTP id CFE7D60622; Fri, 29 Jan 2021 13:19:01 +0000 (UTC) To: Pavel Tatashin , Anshuman Khandual Cc: 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 References: <8c2b75fe-a3e5-8eff-7f37-5d23c7ad9742@redhat.com> <94797c92-cd90-8a65-b879-0bb5f12b9fc5@redhat.com> From: David Hildenbrand Organization: Red Hat GmbH Subject: Re: dax alignment problem on arm64 (and other achitectures) Message-ID: <92912784-f3a3-b5a5-2d45-4c86ae26315f@redhat.com> Date: Fri, 29 Jan 2021 14:19:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Content-Transfer-Encoding: quoted-printable 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 29.01.21 03:06, Pavel Tatashin wrote: >>> Might be related to the broken custom pfn_valid() implementation for >>> ZONE_DEVICE. >>> >>> https://lkml.kernel.org/r/1608621144-4001-1-git-send-email-anshuman.k= handual@arm.com >>> >>> And essentially ignoring sub-section data in there for now as well (b= ut >>> might not be that relevant yet). In addition, this might also be rela= ted to >>> >>> https://lkml.kernel.org/r/161058499000.1840162.702316708443239771.stg= it@dwillia2-desk3.amr.corp.intel.com >> >> I will check it, and see what I find. I saw that panic almost a year >> ago, things might have changed since then. >=20 > Hi David, >=20 > There is no panic anymore, but I also can't offset by 2M anymore, the > minimum that works now is 16M, and if alignment is less than 16M > creating devdax device fails. I wonder why we get such different namespace sizes? Where do the=20 differences come from? This looks very weird. >=20 > So, I tried the new ARM64 patch that reduces section sizes, and two > alignments for pmem: regular 2G alignment, and 2G+16M alignment. > (subtracted 16M from the bottom) >=20 > ***** 4K page, 6G RAM, 2G PRAM ***** > BOOT: > 40000000-1bfffffff : System RAM > 1c0000000-23fffffff : namespace0.0 > DEVDAX: > 40000000-1bfffffff : System RAM > 1c0000000-1c21fffff : namespace0.0 > 1c2200000-23fffffff : dax0.0 > HOTPLUG: > 40000000-1bfffffff : System RAM > 1c0000000-1c21fffff : namespace0.0 > 1c8000000-23fffffff : dax0.0 > 1c8000000-23fffffff : System RAM (kmem) 128M Wasted (E= xpected) The namespace spans 34MB?? >=20 > ***** 4K page, 6G-16M RAM, 2G+16M PRAM ***** > BOOT: > 40000000-1beffffff : System RAM > 1bf000000-23fffffff : namespace0.0 > DEVDAX: > 40000000-1beffffff : System RAM > 1bf000000-1c11fffff : namespace0.0 > 1c1200000-23fffffff : dax0.0 > HOTPLUG: > 40000000-1beffffff : System RAM > 1bf000000-1c11fffff : namespace0.0 > 1c8000000-23fffffff : dax0.0 > 1c8000000-23fffffff : System RAM (kmem) 144M Wasted (?= ???) The namespace spans 34MB?? >=20 > ***** 64K page, 6G RAM, 2G PRAM ***** > BOOT: > 40000000-1bfffffff : System RAM > 1c0000000-23fffffff : namespace0.0 > DEVDAX: > 40000000-1bfffffff : System RAM > 1c0000000-1dfffffff : namespace0.0 > 1e0000000-23fffffff : dax0.0 > HOTPLUG: > 40000000-1bfffffff : System RAM > 1c0000000-1dfffffff : namespace0.0 The namespace spans 512MB ?!? What? > 1e0000000-23fffffff : dax0.0 > 1e0000000-23fffffff : System RAM (kmem) 512M Wasted (E= xpected) >=20 > ***** 64K page, 6G-16M RAM, 2G+16M PRAM ***** > BOOT: > 40000000-1beffffff : System RAM > 1bf000000-23fffffff : namespace0.0 > DEVDAX: > 40000000-1beffffff : System RAM > 1bf000000-1bf3fffff : namespace0.0 > 1bf400000-23fffffff : dax0.0 > HOTPLUG: > 40000000-1beffffff : System RAM > 1bf000000-1bf3fffff : namespace0.0 The namespace now consumes 4MB ?!? > 1c0000000-23fffffff : dax0.0 > 1c0000000-23fffffff : System RAM (kmem) 16M Wasted (Op= timal) Good :) I guess more optimal would be 2MB/0MB :) >=20 > In all three cases only System RAM, namespace0.0, and dax0.0 were > printed from /proc/iomem. > BOOT content of iomem right after boot > DEVDAX content of iomem after devdax is created > ndctl create-namespace --mode devdax -e namespace0.0" > HOTPLUG content of imem after dax0.0 is hotplugged: > echo dax0.0 > /sys/bus/dax/drivers/device_dax/unbind > echo dax0.0 > /sys/bus/dax/drivers/kmem/new_id >=20 >=20 > The most surprising part is why with 4K pages and 16M offset 144M is > wasted? For whatever reason, when devdax is created 34 goes wasted to > the label? Something is wrong here.. However, I am happy with 64K > pages result, and that only 16M is wasted, of course optimally, we > should be using any memory here, but it is still much better than what > we have now. Definitely, but we should try figuring out what's going on here. I=20 assume on x86-64 it behaves differently? Thanks --=20 Thanks, David / dhildenb