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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDC32C0015E for ; Wed, 26 Jul 2023 08:31:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4F4618D0003; Wed, 26 Jul 2023 04:31:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4A4C68D0001; Wed, 26 Jul 2023 04:31:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 345E48D0003; Wed, 26 Jul 2023 04:31:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 268558D0001 for ; Wed, 26 Jul 2023 04:31:10 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id E71981C9C12 for ; Wed, 26 Jul 2023 08:31:09 +0000 (UTC) X-FDA: 81053093058.03.2AEE04C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf29.hostedemail.com (Postfix) with ESMTP id B3FE5120025 for ; Wed, 26 Jul 2023 08:31:07 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ZxD0PWhU; spf=pass (imf29.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690360267; h=from:from:sender: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:dkim-signature; bh=o/8TBEU2aeN4aopJ2IRbNvdTcHHJiwsIyoYlbscqtTk=; b=ap9cGJJg/KVYbt17HiozfN1PtqRfkoilEO+lu3jvlzk+cFtMqRPxNNXJd+pL7AAJPU2LhP 1TvC2RhBlnYyp5oWJWhBm4vCeHdefQP1p6aSAKXrlobN7q9UGpopAYELkxW2ogRjYYOFei PxGIwDQN49IisvdFnDb3Q07ZfILzYaQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690360267; a=rsa-sha256; cv=none; b=pI67PLvFRI/Dk4Mm6POGe1BxoYDnaoa1keMRJs5LADxbjxx45atGxjF6TjyIA1PRBpLzu9 tqbpk6EIwVuqvQKRoAhGTj7uKKF1c/eBAiNjfmPGRbfHUtgwe6kOzfbbqp6QsdePgGAb+5 43cNdhrTtYyRIPRFNKG1M8vTAQlBRcw= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ZxD0PWhU; spf=pass (imf29.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690360266; 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=o/8TBEU2aeN4aopJ2IRbNvdTcHHJiwsIyoYlbscqtTk=; b=ZxD0PWhUwnePxr+tbyJugM5NDBXjR3UbXlGN4pFr20mHtqAaB+8jFK13VA7+EZhuRb90z7 KqZJdyfRoERCqmKX46T9Ix1axN4sb5CiqyzhpBmqSS3LL+2jhNFb0tMQHzrGp4RNI7/NrJ 4lcg+E12NDkP6f7jGC5Pg3c0vHpvLC0= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-649-MgnTIWLEMcqLB8VKjxqVYg-1; Wed, 26 Jul 2023 04:31:05 -0400 X-MC-Unique: MgnTIWLEMcqLB8VKjxqVYg-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-3fbe590234aso38394165e9.1 for ; Wed, 26 Jul 2023 01:31:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690360264; x=1690965064; h=content-transfer-encoding:in-reply-to:subject:organization:from :references:cc:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=o/8TBEU2aeN4aopJ2IRbNvdTcHHJiwsIyoYlbscqtTk=; b=FJzSTd3wzkrozf0LQ/YuDI8jjkXztFGrKALruEfITsnxZvB6mZbPui8GEwZfBT1gPp dZ9DKtsf1bpxEBcN4Z7Y76yl8uzupgDFyZ/vrM46c0kMM1YDmdaHUc9dU/5n5zMRg6On VFQLCs1FPkRLWMWmszenz8diMKrbBAuPvYuoFXAR8nCf4FY55MSW6xbau5Jcm6TGWoAq s2lmoFwX5yJjJsX6uGQljzd7iYYHK3EF5ned+pg0MvKtgKEuId258Y132XVSYJhhL4PL eUbSsSENSJ1/zOi6XZ5uE+mzWm1WmlNuIUqLeCItG243SiS4hOin9OxCAJjEuwf2RoXK 0ZxA== X-Gm-Message-State: ABy/qLZd7+QWpeV+6JJF1O4HAChGxX2z9RFzXlLXkR1ha7BT5kR2sxPL hm9sSOGZWn+9hy4axhaH8tRqwCmXhOtO9qq87xVXxBuBDXjUSAm7v6nrW3BpUU4PCocQ0titRvA Fk2BvRy/RfyoH350/MAs= X-Received: by 2002:a05:600c:2281:b0:3fd:2a34:e867 with SMTP id 1-20020a05600c228100b003fd2a34e867mr835252wmf.25.1690360264248; Wed, 26 Jul 2023 01:31:04 -0700 (PDT) X-Google-Smtp-Source: APBJJlHryebkUbQGetMhiB7/gQUnN1wLgo9/ViGR56iSz8IUVNC1EfMeqI/ocBmFhgTOKOpVKbJNCQ== X-Received: by 2002:a05:600c:2281:b0:3fd:2a34:e867 with SMTP id 1-20020a05600c228100b003fd2a34e867mr835236wmf.25.1690360263814; Wed, 26 Jul 2023 01:31:03 -0700 (PDT) Received: from ?IPV6:2003:cb:c705:f600:a519:c50:799b:f1e3? (p200300cbc705f600a5190c50799bf1e3.dip0.t-ipconnect.de. [2003:cb:c705:f600:a519:c50:799b:f1e3]) by smtp.gmail.com with ESMTPSA id 12-20020a05600c25cc00b003fbb06af219sm1309455wml.32.2023.07.26.01.31.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Jul 2023 01:31:03 -0700 (PDT) Message-ID: <61234a18-7797-722e-ae14-1aa352c4d850@redhat.com> Date: Wed, 26 Jul 2023 10:31:02 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 To: Ross Zwisler Cc: Michal Hocko , Mike Rapoport , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Matthew Wilcox , Mel Gorman , Vlastimil Babka References: <20230718220106.GA3117638@google.com> <20230719075952.GH1901145@kernel.org> <9770454d-f840-c7cf-314e-ce81839393e3@redhat.com> <20230719230515.GA3654720@google.com> From: David Hildenbrand Organization: Red Hat Subject: Re: collision between ZONE_MOVABLE and memblock allocations In-Reply-To: <20230719230515.GA3654720@google.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Stat-Signature: rdc84aiqzjcgcu3n3zw4kwku1zad5t48 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: B3FE5120025 X-Rspam-User: X-HE-Tag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YWUzEYd1KA1ry78Uhebb+/DoyDS2m4JhJD+aV9BCHVjiQbBDvfwXTfds6EgU3Kd5e6aBCtbgEsr9ulkK2v17T+ykDcoXq99wmO8jb9R2HKkn1f2iSipUc85x3juGc5FyPezrhCXWOchnUCIlgkJVw2NDh9kZFFYb8ln/6GXlXRelUNTlhL9Kzcdj4RMeOsYETrmWo5Mu7nad8NpbIfvBweaQZK5cwmItxL7FBDJ+BarSjwGybzo62OYAU2RoqbgiYIszuH9NsJTnfclokmXdpIL1/c6W27WOD0Cvr7Sh5i344AayahrOXlv5OB6xwa9APcBT8AigcQubg5LEUUA4M58ISkN0G/XhytA9hlzbCb0hRIbEL0IYRdD9ZBwelJeFZevTpxV+X35rO5ego= 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: >> As an alternative, we might use the "memmap=nn[KMG]!ss[KMG]" [1] parameter >> to mark some memory as protected. >> >> That memory can then be configured as devdax device and online to >> ZONE_MOVABLE (dev/dax). >> >> [1] https://docs.pmem.io/persistent-memory/getting-started-guide/creating-development-environments/linux-environments/linux-memmap > > I've previously been reconfiguring devdax memory like this: > > ndctl create-namespace --reconfig=namespace0.0 -m devdax -f > daxctl reconfigure-device --mode=system-ram dax0.0 > > Is this how you've been doing it, or is there something else I should > consider? No, exactly like that. > > I just sent mail to Michal outlining my use case, hopefully it makes sense. Yes, thanks for sharing, I'll dig deeper into that next. > > I had thought about using 'memmap=' in the first kernel and the worry was that > I'd have to support many different machines with different memory > configurations, and have to hard-code memory offsets and lengths for the > various memmap= kernel command line parameters. Indeed. > If I can make ZONE_MOVABLE > work that's preferable because the kernel will choose the correct usermem-only > region for me, and then I can just use that region for the crash kernel and > 3rd kernel boots. It really sounds like you might be better off using CMA or alloc_contig_pages(). The latter is unreliable, though, and the memory cannot be used for other purposes once alloc_contig_pages() succeeded See arch/powerpc/platforms/powernv/memtrace.c one one user that needs to set aside a lot of memory to store HW traces. -- Cheers, David / dhildenb