From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 8DE8B32B992 for ; Fri, 19 Dec 2025 17:38:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766165936; cv=none; b=jOBklpJJZnNKAbUGENDKAgHJN0GCi/HnVJTPLHeeIZEq4wnnLTKe0PDr4fwXtyNsYyEsbHm5wtaZzNmbKR3pLWHjRk1UBtqoAgeMmQBuJQfp2v4U/uupbtQcE/P0rthB3/kI0dIUVpLXIeBgZYv1umzvkoK2UJj5DrRg2do8bHE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766165936; c=relaxed/simple; bh=psMiM3mRS7AI/+qt2SIcnAIiUo94iq9EYSzXgujJd2Y=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=aL+wlfmoyThDKOep45OzPkJn1TQBxy/cqlGBRTXDaZjpHv/58JUrE4BlLklOL6bihuwrUoiGv+OYdHMVq72IGH21pj6zvxSeRxkgJNxf89Ck5mTa+hJAhT4ODfOxvP/QRoYs0z8eIccs4IOcu09eENO9aeIGlogMBi+WnkxREH4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=U9iFsI83; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=JRFUhRwT; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=U9iFsI83; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=JRFUhRwT; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="U9iFsI83"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="JRFUhRwT"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="U9iFsI83"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="JRFUhRwT" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 945EA336FB; Fri, 19 Dec 2025 17:38:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1766165932; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VGvFR7VRtSBd6YuWyK7fF4KvZ/6HteMl6uD6VpFe+m8=; b=U9iFsI833t/QXgfqB0Fzc6z/4gBTEcDkzjQ5NkZcbyv5oH6XQ3S77zyAmbJW2vSNS/3Lo8 07Lt/LWUq498CxXM4qxFui13r1ycTnuklukU1M0WMxRiMsx8H2vyW30rNNcmIa4sq5Nnmx E9mH49yF3UOW/hoFOg6GJ+ZnqJlXjgA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1766165932; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VGvFR7VRtSBd6YuWyK7fF4KvZ/6HteMl6uD6VpFe+m8=; b=JRFUhRwTcZ9lSk1p7plbtnZZnSuVUwDe2zJ7smD0Dp4xQ21aupNuQacUxGKG9m/7Kio6I5 Ahv1BHrLZVWoElCA== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1766165932; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VGvFR7VRtSBd6YuWyK7fF4KvZ/6HteMl6uD6VpFe+m8=; b=U9iFsI833t/QXgfqB0Fzc6z/4gBTEcDkzjQ5NkZcbyv5oH6XQ3S77zyAmbJW2vSNS/3Lo8 07Lt/LWUq498CxXM4qxFui13r1ycTnuklukU1M0WMxRiMsx8H2vyW30rNNcmIa4sq5Nnmx E9mH49yF3UOW/hoFOg6GJ+ZnqJlXjgA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1766165932; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VGvFR7VRtSBd6YuWyK7fF4KvZ/6HteMl6uD6VpFe+m8=; b=JRFUhRwTcZ9lSk1p7plbtnZZnSuVUwDe2zJ7smD0Dp4xQ21aupNuQacUxGKG9m/7Kio6I5 Ahv1BHrLZVWoElCA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 73A833EA63; Fri, 19 Dec 2025 17:38:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 5DXnG6yNRWlTYAAAD6G6ig (envelope-from ); Fri, 19 Dec 2025 17:38:52 +0000 From: Vlastimil Babka Subject: [PATCH RFC v2 0/3] tweaks for __alloc_pages_slowpath() Date: Fri, 19 Dec 2025 18:38:50 +0100 Message-Id: <20251219-thp-thisnode-tweak-v2-0-0c01f231fd1c@suse.cz> 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: 7bit X-B4-Tracking: v=1; b=H4sIAKqNRWkC/32NTQ7CIBSEr9K8tRh41Zq6amLiAdyaLig8LTGBB hB/Gu4u4QAuZvHNZGZWCOQNBTg2K3hKJhhnC+CmATVLeydmdGFAjnuBomNxXopMsE4Tiy+SD6Z 6hVJNrezwAKW4eLqZdx29wuV8grGYpRKd/9SjJGr0bzMJxhmnXd9r0WqkaQjPQFv1hTHn/APIn +UNtwAAAA== X-Change-ID: 20251216-thp-thisnode-tweak-c9c2acb3a627 To: Andrew Morton , Suren Baghdasaryan , Michal Hocko , Brendan Jackman , Johannes Weiner , Zi Yan , David Rientjes , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Mike Rapoport , Joshua Hahn , Pedro Falcato Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Vlastimil Babka X-Mailer: b4 0.14.3 X-Spam-Flag: NO X-Spam-Score: -2.80 X-Spam-Level: X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-0.998]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; FUZZY_RATELIMITED(0.00)[rspamd.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEMAIL_TO(0.00)[linux-foundation.org,google.com,suse.com,cmpxchg.org,nvidia.com,kernel.org,oracle.com,gmail.com,suse.de]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWELVE(0.00)[16]; RCVD_COUNT_TWO(0.00)[2]; TAGGED_RCPT(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; TO_DN_SOME(0.00)[] RFC, feel free to ignore until next year... Sending just in case some feedback will materialize. Since v1 the main motivating fix (patch 1 of v1) was sent separately: https://lore.kernel.org/all/20251219-costly-noretry-thisnode-fix-v1-1-e1085a4a0c34@suse.cz/ In patch 2 of v1 I have proposed not to attempt reclaim for costly __GFP_NORETRY allocations at all. Johannes suggested that we should not change the semantics that much, so now instead we allow them all (except with __GFP_THISNODE). The main idea that remains is that we don't decide based on the exact compaction result anymore. Patch 3 is a cleanup also based on a suggestion from Johannes, and Patch 4 became the obvious next step in that direction. These should be making no functional changes. Signed-off-by: Vlastimil Babka --- Changes in v2: - actual THP reclaim fix sent separately - allow one reclaim attempt for __GFP_NORETRY allocations - further __alloc_pages_slowpath() cleanups - Link to v1: https://patch.msgid.link/20251216-thp-thisnode-tweak-v1-0-0e499d13d2eb@suse.cz --- Vlastimil Babka (3): mm/page_alloc: ignore the exact initial compaction result mm/page_alloc: refactor the initial compaction handling mm/page_alloc: simplify __alloc_pages_slowpath() flow mm/page_alloc.c | 169 ++++++++++++++++++++++++++------------------------------ 1 file changed, 77 insertions(+), 92 deletions(-) --- base-commit: 81a5997c0d5ac4cb3ce65f1128197cb751ccd15b change-id: 20251216-thp-thisnode-tweak-c9c2acb3a627 Best regards, -- Vlastimil Babka