Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp82061lqb; Tue, 16 Apr 2024 09:20:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWJ9FYAPuD+I/uz6YU39oAhDiUTAl6jdsXt64AbMpNAulBYs2cSbwcKjz8Gqvvmym1nd1efvWfeotJLWO7fqYvHNIJwsrYUPDOwef5Y3w== X-Google-Smtp-Source: AGHT+IGUHF+bhm2VMRex0n8c1jZuL9M02gd3EdWzhe9r/tus1YHsk9gpAvYbP4lIh7Unr+YDYGc+ X-Received: by 2002:a17:906:81d6:b0:a54:3e6e:1c2d with SMTP id e22-20020a17090681d600b00a543e6e1c2dmr3641029ejx.12.1713284403706; Tue, 16 Apr 2024 09:20:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713284403; cv=pass; d=google.com; s=arc-20160816; b=xLu3pgkH/VKqUw/NKf6yjKc1XpgcIUf49l7s83dUqdaN+syEeBohi8inZxlZvLeLNj qjky2mdW6ulUuehMWqybGdtBfumDheS7iqwaLvBGSNpb8gbd6XyEhrBY0JFVeal0smQt gJiCePqUm9CQ1fWUpABfOWEe21uh5G650XgJf+6O4zF/GZJq+/rc2akn+istxXnzHLtX BOsfOoqtjMBuIxkUgfijfjnjGd/+uGENhBEbwz9PA3F+ibQA0wkiJKuuOwZLD+WPuUOy FGSm1eNwnwdjAqUoQid3u8RCbRQkFnsvH8Z2owV7kWpMzKe9loJ8l059/4qjPVY2y+J2 RWOg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:dkim-signature:dkim-signature:date; bh=A23kAXEf9C2KhbYlAYQaiPt99jI8MlAVS/+Sw78HXwk=; fh=RZFQQK3d+HS7eCqMyQ+dnNmw6s0XH5SCuU5jPf0sxc4=; b=0VFIEXlCnM7vc88kUWDEjoDlkE+i5vldGxgQUSYL/1ZhHH1KK+UnEqw0SGzEWsIJo2 upzxnrHG27drd79HIUtaPa0qJWm7ZhvlxDpzL13q3mS+hSv5sFO25rrpxg85Rixtc8FB w7+cfTu7qkDz2YbSOvOpC94yuu0D9n0XllFWA5RlS9yNfwBmYHDwK2JJLxtLlZP+dign m1w/IEDhoH5Eji0oo3CL1oZwj9EqFzCiRSh0APUw/KM3ltlo//ZruPkaM/OuuIxVbWwp 0wChw30pRxrVSdcoj5KngcI6csPhrSfpJqLs3s6MCv29EsX5R7VBYqqqi/ArusCzGfOw LSDQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=kJN1kvZz; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=4XT0Vx5x; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-147223-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147223-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id s8-20020a170906c30800b00a524307d5a5si4167735ejz.983.2024.04.16.09.20.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 09:20:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147223-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=kJN1kvZz; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=4XT0Vx5x; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-147223-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147223-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 6FFD71F22E79 for ; Tue, 16 Apr 2024 16:20:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E4F0B1327E7; Tue, 16 Apr 2024 16:19:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="kJN1kvZz"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="4XT0Vx5x" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 B7A8712D741; Tue, 16 Apr 2024 16:19:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713284392; cv=none; b=rxNzIMBL83f7RV8oDKpIgDV+j6H7zsqd3NGz4bIsN8pRP8u9c04TYg9afLAfwwVgSenwwVZZMKoTsgV+AYEayopLJlQd+Lvm3rAv/e2NTJSpwLmDqjoOMO27qAbllJFO2D4VmrpTPIsENfN/RAaF1Gfh8+3DQYNrjw32WupkKYk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713284392; c=relaxed/simple; bh=u8QCJiuXj8GqdD/HN6uB24dbcQOucYXQvVmuYLSt1EE=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=dRm+HQYCrqOGAT6Ay2UrNVcv1wBSB8LtF89zATB7F6cK0M+on9gK+NLrBAnGLedwiemsPhsyR5NgqcsuSr7DMD/DiNujjsmRtyyC0Omb2jBnhllc/cSvJjHAw/zzPHp4SopgdI1MyZqMi66FvJye8wDhdwSOb7d8p8xyAl9k9TU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=kJN1kvZz; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=4XT0Vx5x; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Tue, 16 Apr 2024 18:19:44 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1713284387; 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=A23kAXEf9C2KhbYlAYQaiPt99jI8MlAVS/+Sw78HXwk=; b=kJN1kvZz5VI9X1N44mbAnqG+ChDEeeB8pSyDOQ6ehcAFkalZx0dHpMGO5OuOv4Vvth9DDO YIkd6myOE8E0VxNvTutlXGo5yVZnBn28av6knai5Q+ZnF2v9MsZfsuA/rD3M4vXJerWTMn buMdeVp9l2uCQJqtF7+Dc9cVFTOHT5/p70lcg/xocSDSggwmX1S8stgD+E0MS0UoWlYVTa 5sq9E/LJ3rJMdxGXiG1eM9zOh0fpzg2XksNuZpcAFEX395HLswMEPpw5zgh1Bn+sy1dbVI NkPlvnarvQEiu0kNzsLznOIC91t1qIAQFcyVZnByx78jzgBPTBMt4g5fE8C5Hg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1713284387; 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=A23kAXEf9C2KhbYlAYQaiPt99jI8MlAVS/+Sw78HXwk=; b=4XT0Vx5xO8W/erNB63yAHRYfUcl16Pw8c0TDGAchcUnv7GWfAGkXmMBdMT37fDCP2dMi8A vE2JarnSJaBlAQDg== From: Nam Cao To: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= Cc: Mike Rapoport , 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: <20240416181944.23af44ee@namcao> In-Reply-To: <87v84h2tee.fsf@all.your.base.are.belong.to.us> 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 2024-04-16 Bj=C3=B6rn T=C3=B6pel wrote: > Nam Cao writes: >=20 > > 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 =3D __pa(~(ulong)0); > > if (max_mapped_addr =3D=3D (phys_ram_end - 1)) > > memblock_set_current_limit(max_mapped_addr - 4096); =20 >=20 > Nice! >=20 > 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 =3D __pa_symbol(&_end); - phys_addr_t max_mapped_addr; phys_addr_t phys_ram_end, vmlinux_start; =20 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. */ - if (!IS_ENABLED(CONFIG_64BIT)) { - max_mapped_addr =3D __pa(~(ulong)0); - if (max_mapped_addr =3D=3D (phys_ram_end - 1)) - memblock_set_current_limit(max_mapped_addr - 4096); - } + memblock_reserve(__pa(-PAGE_SIZE), PAGE_SIZE); =20 min_low_pfn =3D PFN_UP(phys_ram_base); max_low_pfn =3D max_pfn =3D PFN_DOWN(phys_ram_end);