From patchwork Mon Dec 2 12:58:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13895604 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53AE3E7716D for ; Thu, 5 Dec 2024 15:36:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 75CC06B0135; Thu, 5 Dec 2024 10:19:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1AD996B009D; Thu, 5 Dec 2024 10:19:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9EE846B00E2; Thu, 5 Dec 2024 10:19:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 614A96B0082 for ; Mon, 2 Dec 2024 07:58:29 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 20C8D141C35 for ; Mon, 2 Dec 2024 12:58:29 +0000 (UTC) X-FDA: 82850021856.20.4ED6456 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf26.hostedemail.com (Postfix) with ESMTP id 442CE140008 for ; Mon, 2 Dec 2024 12:58:18 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=A+6TVY3u; spf=pass (imf26.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733144299; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=sUfFB5Sjd5S9qMX11BGcSRAtxQGHOOZYHnvQVZdcklA=; b=CJD4URd3a3LALJE2Ay6u+ixgu1+Q1+dJMUl+/VqK6i2KalQu9rYzURuaPyc6cAGoIyjscI IDqh2Q0DdU0j2h4NrQx+9UNsO3UlVOnbTQI4J9y+r7F94oJHl+MJ11aGciT6Z/Is8BP/6Q BBEHYjlRS2JBWVB4WD3RaAUWya1wheE= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=A+6TVY3u; spf=pass (imf26.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733144299; a=rsa-sha256; cv=none; b=BmkDNmy1pdCrmFn9rUNxKIlkWoCDer64JeSwsbZuhdspnJrz6scyB9SEkJFpdkkzonP+H6 Tv5imQiS+Ee8z7kCecX9Kgss1a4/FqvRoekWuGlAZlb5d9AaSfcxPY011Sgx4DOWI6vMWs 0VBd3y8WvA8Tgwon4M2bWUiZP3PzNxU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733144306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=sUfFB5Sjd5S9qMX11BGcSRAtxQGHOOZYHnvQVZdcklA=; b=A+6TVY3uIGlEiVmh3ttwl3DO2wzzEO1zrqYg3JT7pl4GSp1JJhuzSIGOAV94M2mgb6ung3 /nL6oW0bn8jnMCjgr8qqUyFOLRvuwpXyEOtDLLujA3qVFbxd61C8Egm2SnpeVLsxenZP0a 6juUXiPdmwKZQTc38L6sHleVdRLwhPg= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-470-2CXO6SbxMjSM_j8vAM94cQ-1; Mon, 02 Dec 2024 07:58:21 -0500 X-MC-Unique: 2CXO6SbxMjSM_j8vAM94cQ-1 X-Mimecast-MFC-AGG-ID: 2CXO6SbxMjSM_j8vAM94cQ Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2D83A1953951; Mon, 2 Dec 2024 12:58:19 +0000 (UTC) Received: from t14s.cit.tum.de (unknown [10.39.194.150]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E7341195605A; Mon, 2 Dec 2024 12:58:13 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, David Hildenbrand , Andrew Morton , Oscar Salvador , Zi Yan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Naveen N Rao , Madhavan Srinivasan Subject: [PATCH v1 0/6] mm/page_alloc: gfp flags cleanups for alloc_contig_*() Date: Mon, 2 Dec 2024 13:58:06 +0100 Message-ID: <20241202125812.561028-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Rspamd-Server: rspam05 X-Stat-Signature: yeypt6sxntg9xd56o6eogm8hxexaerz6 X-Rspamd-Queue-Id: 442CE140008 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LpioXLGt6Cudv8t1X1BjeRMUTzWE0u+esK/M8RFyLfzoCTV1YKb+MJ8grefPslFne6Wrdg5dhuRIZcIVCjoN3qtwKviQMIw6C+s9xwDRU2dQ0hmN/nB8nUlzmNEGlecu9UZ3qXmkoAL3hPDVOnQ9KYd2N4BvI1MGFe77xk983LHQatqhE4EmhSU6ihpBxB/7OD5ZYJMFD3QefXXEaTYzvMjdrFCJ+r5jN/Pj9J67oxzd23Z2/oTHnq+mFZ2ZHXHpSRIA7TzRDhLMNRBKEUn4X5d4us8ghC1gY5cFZV2NAAnFW/xk89LiFp2MNpmZymxEUfNa1gTiv8XsV/TRvql30Vayxt9aQzJtShusjClbL/2ABemSlPUbPa0kycIiA2WBtlW9ptg85kcZAbeTj3KH2Bx0JgtIJu5JsjuGmZwDQB632J6TcERaDbsfU4xPdIxjC+8zFioZe78EPOMySuEeKEUo+m9WBjAC8ctz5tEY/5kT1cle6J+pmlQyROhR2pYSfPh+SvFqNnAFkLGhZiOPFKM2toAQI1k2kjWOV580qgDA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Let's clean up the gfp flags handling, and support __GFP_ZERO, such that we can finally remove the TODO in memtrace code. I did some alloc_contig_*() testing with virtio-mem and hugetlb; I did not test powernv/memtrace -- I cross-compiled it, though. Cc: Andrew Morton Cc: Oscar Salvador Cc: Zi Yan Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Cc: Naveen N Rao Cc: Madhavan Srinivasan David Hildenbrand (6): mm/page_isolation: don't pass gfp flags to isolate_single_pageblock() mm/page_isolation: don't pass gfp flags to start_isolate_page_range() mm/page_alloc: make __alloc_contig_migrate_range() static mm/page_alloc: sort out the alloc_contig_range() gfp flags mess mm/page_alloc: forward the gfp flags from alloc_contig_range() to post_alloc_hook() powernv/memtrace: use __GFP_ZERO with alloc_contig_pages() arch/powerpc/platforms/powernv/memtrace.c | 31 +++--------- include/linux/page-isolation.h | 2 +- mm/internal.h | 4 -- mm/memory_hotplug.c | 3 +- mm/page_alloc.c | 62 +++++++++++++++++++---- mm/page_isolation.c | 12 ++--- 6 files changed, 63 insertions(+), 51 deletions(-)