From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796196027; b=xNrMK6j8VTt/rDrKA3LsBypQdXjI3FaPwanZRs4jWHu7FFV8RBv+9xi0fqWfqnZkXehf aMwBzaar9L6pBDwFqRlQ7xiiFF3krP0CkqnMhSkaJW7zcIZ3t7bUtTFXgNSxkPKjOwenr GI7Lsz2+Vxq6SBLay5DhBSwihh8NXOb+r1nx251nePkAI9g5REzJ0cEGR9LVZNl7+qGz+ 908TnvQyvBnZza5nCOO9Wa1L61Ya/It2RomA4EjAhWwTPpkHXHzMj9Xxlo6g31eiaTX+q pqd+LCB9C3jG7ILyedxCkw6VDeBcjijB1bB7PUTZQzO/zoZ+rVY7kKJaMUVr+AUvV1g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796196027; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=qKgnjfpYbL9QdXwfuT21mcr5ZH+v65JW2wFw8mUvg54=; b=lisIU0aa3kZaumXkDwDMv8IkHKyzoJ5GCl58vlFL7lvvc6DYcBLK4TUO6o+jOizh+qRI Ydbx0hZUCamKn2JGK+w9sXtUToR1ht0sHwAyhrlFTrONxYJrwM6oCfxdn54DNEgwfMgrY pvAwA1Qd9tanDpuXcpfFTEavupNW0gttvCF+gnjSv3oynlqT3a2laJpAYTg/KW/ui8L8l 6IXXgkAhjxXc2SW1DRYMgxvBFMIttVPhtttE4mtXc0ILK3885RssweLdLyrN1oJjK6lvi sTeMEWbvQRIbszloxTIVovZwV0qa/cLjZXg8SmILKdKWux7WJCGZPGa5FZBE8fk+dKg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=HaXEHqXJ; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE53F606A31A for ; Wed, 2 Dec 2026 07:20:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=HaXEHqXJ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15D9B1F000C1; Wed, 2 Dec 2026 07:20:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796196027; bh=qKgnjfpYbL9QdXwfuT21mcr5ZH+v65JW2wFw8mUvg54=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=HaXEHqXJwDDWn1pRopg1Ya0Wg/7PqkLqUjz4xhsRVpR2KbLWBE1A+gp0QWqQ4Nzn1 wpbv3PCvw/pAxtrqxg5HNx2WfY5Ws3Ry45Xtieu+xfm4mkbnPpJzA4fZnTSSOMDr3Q x6N5ZTxbv4XoLXHhrwWH/Wr0fkq9ENqPQoLbX6zmq8B2jkHLlYT7yLzr4IlciKpEek hYa4eaenX2UGiLZyxM0vG6TbWvt5dwYTsMFffKmMXfsjnVlQNG3yXrOMqbVmi0RfQq H0RZAkfLgnnfRvEHuLsH2X+2YNMFR5IrpQfeQma9xuarXGiUm2lcAGHUojunoyYGOk HjdZQpRooJ2cw== Date: Wed, 2 Dec 2026 09:20:22 +0200 From: Mike Rapoport To: Norman Herms Cc: "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" Subject: Re: mm/memtest: the reserved-region array is reallocated inside the range under test Message-ID: References: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Nov 23, 2026 at 05:15:28PM +0000, Norman Herms wrote: > Hi Mike, > > On a board whose DRAM fails one word in every 256 bytes, memtest() > reserves every failing word on its own, 512 reservations over 1.6 MiB. > Past the 128 static entries, memblock_double_array() allocates the new > reserved array from free memory inside the range memtest() is still > reading back, and the array's own entries then fail the compare: > another 42 KiB at the top of RAM (0x1bf3c2000-0x1bf3cc800 here, inside > the tested range 0x60100000-0x1bf3cd040) is reserved as bad, in runs > of 16 bytes every 24 bytes, the size of struct memblock_region. > > With memtest=4 the next pattern is written over the live array, and > the board resets during that pattern; we have not separated that from > a 16 s boot watchdog. > > Coalescing nearby bad words, or reserving only after a range's verify > pass, would avoid it. Unfortunately neither of those solve the general case :( Coalescing only reduces the chance that a reservation will fall onto a bad region. Reserving after a pass means that we need to keep the intermediate state somewhere. If it's static array we may run out of space, if we allocate it we're back to potentially hitting a bad range. > Seen on 6.18.54 (arm64, Allwinner A733, 6 GiB); mm/memtest.c is unchanged > in linux-next. > > Measured on my board by AI agents, analysis with an AI assistant; > a report, not a Tested-by. > > Norman > -- Sincerely yours, Mike.