From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta0.migadu.com (out-107.mta0.migadu.com [91.218.175.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 617792E414 for ; Sat, 15 Aug 2026 14:30:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.107 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786804255; cv=none; b=IF/K2/SZepM413ea/iiKbPsFduUTPc3n5r8nKZ4qNeSmozOipJ1BI16DNKxKrUZvKAZR+N1sUHOwiBRxkT6JNUWdXLzlaKdeS0l9V8/KZQM18nH/pPYPyPKLt+cSbw/gj7iIUm3G6tvpANt5uZOhCJTYmNtY1dhTYR8RWQaPcAA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786804255; c=relaxed/simple; bh=f0l24nJdKCPn3HKZrSe3W0vzuVprJAb/6eQIXz+8b4s=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=B6ECT1GbZU0cS9KoduPBCVVKdEBlXR9loZnhBFX5pGhpdGLr0hwFHyxCqWMyP7274VWxsijuU7PYFic6N/DFiah3u3nI1zypahvoYe3b0iUIzBLwn3etmekBjHrMazSYknLgRRS9SdGJPHkMyy3ZKQKrhctV4sXXexnCKoL+lBM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Ex1nmzfE; arc=none smtp.client-ip=91.218.175.107 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Ex1nmzfE" X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=f0l24nJdKCPn3HKZrSe3W0vzuVprJAb/6eQIXz+8b4s=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1786804250; v=1; x=1787409050; b=Ex1nmzfE9iGXU5fCmahNyVytG7kca6ipEWwEzWtf0vrvM/wpyjFCaoBLJqYjYnexwQpYFLNq khPZE/FHwgZxmh4xvv/X5IevlsbrGNds5D6v8H/J8w7pFZVbM+UsuUlQa1+oqz22SqeXUikWLto RFurkYXa3v8WU8MfeX2grlxo= X-Envelope-To: linux-kernel@vger.kernel.org Received: from localhost (77.97.51.77) by smtp.migadu.com with ESMTPS id aa0f9b3bd3bb642c; Sat, 15 Aug 2026 14:30:49 +0000 X-Migadu-Flow: FLOW_OUT Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sat, 15 Aug 2026 15:30:44 +0100 Message-Id: Cc: "Borislav Petkov" , "Dave Hansen" , "Peter Zijlstra" , "Andrew Morton" , "David Hildenbrand" , "Vlastimil Babka" , "Mike Rapoport" , "Wei Xu" , "Johannes Weiner" , "Zi Yan" , "Lorenzo Stoakes" , , , , "Sumit Garg" , "Will Deacon" , , , "Itazuri, Takahiro" , "Andy Lutomirski" , "David Kaplan" , "Thomas Gleixner" , "Patrick Bellasi" , "Reiji Watanabe" , "Sean Christopherson" Subject: Re: [PATCH v3 21/26] mm/page_alloc: implement FREETYPE_UNMAPPED allocations From: "Brendan Jackman" To: "Yosry Ahmed" X-Mailer: aerc 0.21.0 References: <20260726-page_alloc-unmapped-v3-0-6f5729aa9832@google.com> <20260726-page_alloc-unmapped-v3-21-6f5729aa9832@google.com> In-Reply-To: On Fri Aug 7, 2026 at 1:16 AM BST, Yosry Ahmed wrote: >> diff --git a/mm/compaction.c b/mm/compaction.c >> index 67b01af024e17..c9eb3947ffc79 100644 >> --- a/mm/compaction.c >> +++ b/mm/compaction.c >> @@ -1393,6 +1393,9 @@ static bool suitable_migration_source(struct compa= ct_control *cc, >> block_ft =3D get_pageblock_freetype(page); >> block_mt =3D free_to_migratetype(block_ft); >> >> + if (freetype_unmapped(get_pageblock_freetype(page))) >> + return false; >> + >> /* >> * CMA pages can only be taken by ALLOC_CMA requests. For anybod= y >> * else, vacating a CMA block consumes free pages the caller >> @@ -1444,6 +1447,9 @@ static bool suitable_migration_target(struct compa= ct_control *cc, >> return false; >> } >> >> + if (freetype_unmapped(get_pageblock_freetype(page))) >> + return false; >> + > > Do we also want to add safety checks in the page migration code? IIUC, > if we miss a check in the compaction code and try to compact an > unmapped pageblock the kernel will crash with a #PF in supervisor > mode. Shrug, yeah I would certainly be happy with sprinkling some more if (WARN_ON(freetype_unmapped(...))) return -1; here and there. But yeah this feels like a maintainer preference / philosophy question :D If the machine is gonna crash quite clearly anyway maybe it's not worth it, I dunno. >> if (cc->ignore_block_suitable) >> return true; >>