Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp90571lqb; Tue, 16 Apr 2024 09:33:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUNyCPedgxTfAauK8RFEy3PHjwsp0JdLi3vU9bXRAMqqjzGRs3zHK1nNnFCgBEUpsfITIgKqsdeoD3ug5ZgG4Cgv3DA9GmWcOW085zwUg== X-Google-Smtp-Source: AGHT+IEBLAA+iuzvaGxuxxk0xcXSZwunUl1HQWUXdaEtOHjetraLC32YkODszD9A/3G0Y1RSdmr/ X-Received: by 2002:a17:906:f1c7:b0:a52:fb9:27ad with SMTP id gx7-20020a170906f1c700b00a520fb927admr8429207ejb.48.1713285195605; Tue, 16 Apr 2024 09:33:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713285195; cv=pass; d=google.com; s=arc-20160816; b=J3DAcOiWs/VR6yCKrhu1f2GhBGv0DRCO+/UY3Q9aQJukZZ5cgnb0q+ivU3jE1nG4yX n6WOLvwzFPgYAzccroDhje95pcyMaidhrkZoaAYUZkANmUHzvTnIzeTXzHEdZ2pg3/BE lheKTRedA7xvQSPN8VgaZgxyDGZ1h1j+b8OY0vKGnqnbZC2hDi2e84psbS6oa+UKL8O2 MiluJDDwdH0uRZz62Ywsc7Uqo3vjepFShFCM6uHRiovh5Xt6gNUBeAqfpvAtX71tcioE PjPN62XFa4YAZB+Qlbb/99Vd21jzyE7vSFfpU9uUcnlRaVsq+GAA0YLepdn8ADbIfvla 079A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=xcpJJICR69oR9NLsfkT7wEgZ/8NVWP7NuWm4X+7u3Z8=; fh=R8olTB8XBM+kYmlbHD3Pg4Jmf/goVW9TS0cYiOW5HRo=; b=r7gTRc9wXdOHBemtC/lfVV0o7ABtbDYnFM2BzgF7kWppFhxfSAJxhfErNs8SGkBsy6 eJYvN+bvaV6HbAmbsTJ9p0mNfpjvM73Nc332thB/3CteoJ1dA48vGmPW8246g8wJO+ZE wizJrUCKtqQXn7vA4K6BtN+kVNwpkrDh8y8lC9HhSBNlhfs5rxy8ez+sVd6vg0d4Sfod sAatriWjYrFucFvJN45T7tc+XdJPPDVRxbFT5A7BRQiPzwKWcvno/1sAeYFrjVvujtfL TXIcYpXXTnRDO2u4McnA9piDp5423lwBZVhxgIzW+kiHJoe93kN3Bh4rP300Q7ryUxdG i98w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YtqvXTIW; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-ext4+bounces-2108-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-ext4+bounces-2108-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id sh35-20020a1709076ea300b00a520a15a9ecsi6291129ejc.22.2024.04.16.09.33.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 09:33:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4+bounces-2108-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YtqvXTIW; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-ext4+bounces-2108-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-ext4+bounces-2108-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 584761F21D2E for ; Tue, 16 Apr 2024 16:33:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DD832374EB; Tue, 16 Apr 2024 16:33:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YtqvXTIW" X-Original-To: linux-ext4@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5CB3FF4E7; Tue, 16 Apr 2024 16:33:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713285185; cv=none; b=s8pwpq6n6NsXFN0BGpXliKNQhp8JXF07TG+obAhtHNJL5esQUXuFP83KH4PRelg3iriavFqXViT0y9TAYtifxCDIJm3Q2Ia0nx5Qbsds8Zw+x1z2OUQM0HXF5a/dif8hTv7ussB//4311UdvBEMVC/TlcbZ+NZZTbf4mg4KPyxc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713285185; c=relaxed/simple; bh=gTJHR1KdErAk/qzXo5EJZZiXgCceiHY4vGZi+g7gbDI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uX/Ehk+X8ROePKpNbLh0hrBuTff2WuB7F7Qalic4AavQToWJFPW5K4Aa66TVz8GnclLbUWt3Cs4LMr+5emwoUYxuDLIyDQ5ak/EH2CiK/CVceOIdbHhtBXo27DPd3WCJQbKAguzDDNKzEZY0Ygx0swICzUWc3lITUhCmDJhhLxg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YtqvXTIW; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D926C113CE; Tue, 16 Apr 2024 16:32:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713285184; bh=gTJHR1KdErAk/qzXo5EJZZiXgCceiHY4vGZi+g7gbDI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YtqvXTIWp4JmR1FEXjRm/DaLcxcqVbM2sHNsTceCNUlja61mLU46RASB4axT8jg7S ccSAtBcXO0XJgcAOAkoSXCk08wv1/gy8wYOwNQKVpNrnIWb1U96Y0fr1kbgyU4fuSM LDei7oagYypXMxOvgDkPZQ34bTr9dFttMUMB/hKcpj5EezRXogMzMk+ZFPnCCpGH0+ /JF9F1R7RPCGjHwJCNQHo0pzQdq0BwDUuRvACQZ0id1Qh2GX6bTVvG1fVIVdX1v12L t7hmZH/NYURJMwWh2rUMqairNtEvXdZJNhrJA4dZinneJD+IcysEK6n3rjvUQaYSpk neOgd64QhpAxw== Date: Tue, 16 Apr 2024 19:31:54 +0300 From: Mike Rapoport To: Nam Cao Cc: =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= , Christian Brauner , Andreas Dilger , Al Viro , linux-fsdevel , Jan Kara , Linux Kernel Mailing List , linux-riscv@lists.infradead.org, Theodore Ts'o , Ext4 Developers List , Conor Dooley , "Matthew Wilcox (Oracle)" , Anders Roxell , Alexandre Ghiti Subject: Re: riscv32 EXT4 splat, 6.8 regression? Message-ID: References: <20240416-deppen-gasleitung-8098fcfd6bbd@brauner> <8734rlo9j7.fsf@all.your.base.are.belong.to.us> <20240416171713.7d76fe7d@namcao> <20240416173030.257f0807@namcao> <87v84h2tee.fsf@all.your.base.are.belong.to.us> <20240416181944.23af44ee@namcao> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240416181944.23af44ee@namcao> On Tue, Apr 16, 2024 at 06:19:44PM +0200, Nam Cao wrote: > On 2024-04-16 Bj?rn T?pel wrote: > > Nam Cao writes: > > > > > Fixed version: > > > > > > diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c > > > index fa34cf55037b..af4192bc51d0 100644 > > > --- a/arch/riscv/mm/init.c > > > +++ b/arch/riscv/mm/init.c > > > @@ -245,6 +245,7 @@ static void __init setup_bootmem(void) > > > * be done as soon as the kernel mapping base address is determined. > > > */ > > > if (!IS_ENABLED(CONFIG_64BIT)) { > > > + memblock_reserve(__pa(-PAGE_SIZE), PAGE_SIZE); > > > max_mapped_addr = __pa(~(ulong)0); > > > if (max_mapped_addr == (phys_ram_end - 1)) > > > memblock_set_current_limit(max_mapped_addr - 4096); > > > > Nice! > > > > Can't we get rid of the if-statement, and max_mapped_address as well? > > I don't see why not :D > > Best regards, > Nam > > diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c > index fa34cf55037b..f600cfee0aef 100644 > --- a/arch/riscv/mm/init.c > +++ b/arch/riscv/mm/init.c > @@ -197,7 +197,6 @@ early_param("mem", early_mem); > static void __init setup_bootmem(void) > { > phys_addr_t vmlinux_end = __pa_symbol(&_end); > - phys_addr_t max_mapped_addr; > phys_addr_t phys_ram_end, vmlinux_start; > > if (IS_ENABLED(CONFIG_XIP_KERNEL)) > @@ -238,17 +237,9 @@ static void __init setup_bootmem(void) > /* > * memblock allocator is not aware of the fact that last 4K bytes of > * the addressable memory can not be mapped because of IS_ERR_VALUE > - * macro. Make sure that last 4k bytes are not usable by memblock > - * if end of dram is equal to maximum addressable memory. For 64-bit > - * kernel, this problem can't happen here as the end of the virtual > - * address space is occupied by the kernel mapping then this check must > - * be done as soon as the kernel mapping base address is determined. > + * macro. Make sure that last 4k bytes are not usable by memblock. > */ It's not only memblock, but buddy as well, so maybe /* * The last 4K bytes of the addressable memory can not be used * because of IS_ERR_VALUE macro. Make sure that last 4K bytes are * not usable by kernel memory allocators. */ > - if (!IS_ENABLED(CONFIG_64BIT)) { > - max_mapped_addr = __pa(~(ulong)0); > - if (max_mapped_addr == (phys_ram_end - 1)) > - memblock_set_current_limit(max_mapped_addr - 4096); > - } > + memblock_reserve(__pa(-PAGE_SIZE), PAGE_SIZE); Ack. > min_low_pfn = PFN_UP(phys_ram_base); > max_low_pfn = max_pfn = PFN_DOWN(phys_ram_end); > -- Sincerely yours, Mike.