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=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 129DEC433DF for ; Sat, 10 Oct 2020 10:36:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 75B412158C for ; Sat, 10 Oct 2020 10:36:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="rKy3ckBB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 75B412158C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 824866B005C; Sat, 10 Oct 2020 06:36:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7D450900002; Sat, 10 Oct 2020 06:36:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6C1036B0062; Sat, 10 Oct 2020 06:36:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0050.hostedemail.com [216.40.44.50]) by kanga.kvack.org (Postfix) with ESMTP id 3C20D6B005C for ; Sat, 10 Oct 2020 06:36:44 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id C952F362D for ; Sat, 10 Oct 2020 10:36:43 +0000 (UTC) X-FDA: 77355662286.28.wine91_12038c1271e8 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id A4B176C05 for ; Sat, 10 Oct 2020 10:36:43 +0000 (UTC) X-HE-Tag: wine91_12038c1271e8 X-Filterd-Recvd-Size: 5208 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Sat, 10 Oct 2020 10:36:43 +0000 (UTC) Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com [209.85.210.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0701B21D41 for ; Sat, 10 Oct 2020 10:36:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602326202; bh=drBUl94hJDiJbg7EAVxrflroZLL9cGY6sJkpslPiZ5s=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=rKy3ckBBBgFebn68RQgydnukpiggooqY/F0UdxKn+PD4vBKQFsw9OUH0z/Br8qzHL vqXLEt7HvxX5ixXoMa6fe3GoyAotCaowYAzljQILgN2nuY+ugEd4yxrmWqTA8qruKo /9s7DKu5OmwTNMIx2nhbM/00epBYdkcLbPkrKE5w= Received: by mail-ot1-f49.google.com with SMTP id f10so11334157otb.6 for ; Sat, 10 Oct 2020 03:36:41 -0700 (PDT) X-Gm-Message-State: AOAM53367t5klvxu22J/r+8SNKZRXjgqoVDduEMdPScgSrKK7q0oo+3B 4ttqN9hxHy5jOa93DG+l44pP6tBFqAij2msFwA4= X-Google-Smtp-Source: ABdhPJyRUmME/uNQCpEvmy5TmuigC5HqxkAmy4br3cKJSuYPDqK1iFTDzWqlHrlHAracvofdjaHYJW7dOhpWJoeIxWo= X-Received: by 2002:a9d:6a85:: with SMTP id l5mr12561956otq.77.1602326201362; Sat, 10 Oct 2020 03:36:41 -0700 (PDT) MIME-Version: 1.0 References: <20201001172320.GQ21544@gaia> <20201002115541.GC7034@gaia> <12f33d487eabd626db4c07ded5a1447795eed355.camel@suse.de> <20201009071013.GA12208@lst.de> <513833810c15b5efeab7c3cbae1963a78c71a79f.camel@suse.de> <20201009152433.GA19953@e121166-lin.cambridge.arm.com> <20201009171051.GL23638@gaia> In-Reply-To: <20201009171051.GL23638@gaia> From: Ard Biesheuvel Date: Sat, 10 Oct 2020 12:36:30 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/4] of/fdt: Update zone_dma_bits when running in bcm2711 To: Catalin Marinas Cc: Lorenzo Pieralisi , Nicolas Saenz Julienne , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Will Deacon , Linux Kernel Mailing List , Linux Memory Management List , iommu@lists.linux-foundation.org, Rob Herring , linux-rpi-kernel@lists.infradead.org, Frank Rowand , Christoph Hellwig , Linux ARM , Robin Murphy 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, 9 Oct 2020 at 19:10, Catalin Marinas wrote: > > On Fri, Oct 09, 2020 at 06:23:06PM +0200, Ard Biesheuvel wrote: > > On Fri, 9 Oct 2020 at 17:24, Lorenzo Pieralisi > > wrote: > > > We can move this check to IORT code and call it from arm64 if it > > > can be made to work. > > > > Finding the smallest value in the IORT, and assigning it to > > zone_dma_bits if it is < 32 should be easy. But as I understand it, > > having these separate DMA and DMA32 zones is what breaks kdump, no? So > > how is this going to fix the underlying issue? > > If zone_dma_bits is 32, ZONE_DMA32 disappears into ZONE_DMA (GFP_DMA32 > allocations fall back to ZONE_DMA). > > kdump wants DMA-able memory and, without a 30-bit ZONE_DMA, that would > be the bottom 32-bit. With the introduction of ZONE_DMA, this suddenly > became 1GB. We could change kdump to allocate ZONE_DMA32 but this one > may also be small as it lost 1GB to ZONE_DMA. However, the kdump kernel > would need to be rebuilt without ZONE_DMA since it won't have any. IIRC > (it's been a while since I looked), the kdump allocation couldn't span > multiple zones. > > In a separate thread, we try to fix kdump to use allocations above 4G as > a fallback but this only fixes platforms with enough RAM (and maybe it's > only those platforms that care about kdump). > One thing that strikes me as odd is that we are applying the same shifting logic to ZONE_DMA as we are applying to ZONE_DMA32, i.e., if DRAM starts outside of the zone, it is shifted upwards. On a typical ARM box, this gives me [ 0.000000] Zone ranges: [ 0.000000] DMA [mem 0x0000000080000000-0x00000000bfffffff] [ 0.000000] DMA32 [mem 0x00000000c0000000-0x00000000ffffffff] [ 0.000000] Normal [mem 0x0000000100000000-0x0000000fffffffff] i.e., the 30-bit addressable range has bit 31 set, which is weird. I wonder if it wouldn't be better (and less problematic in the general case) to drop this logic for ZONE_DMA, and simply let it remain empty unless there is really some memory there.