From patchwork Tue Dec 3 08:37:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13895578 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 53FAAE7716C for ; Thu, 5 Dec 2024 15:30:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 86DA36B00CC; Thu, 5 Dec 2024 10:19:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7038B6B011C; Thu, 5 Dec 2024 10:19:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 866C06B0125; Thu, 5 Dec 2024 10:19:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 9F5026B007B for ; Tue, 3 Dec 2024 03:38:16 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 5177B1205EF for ; Tue, 3 Dec 2024 08:38:16 +0000 (UTC) X-FDA: 82852995288.25.2908FFE Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf25.hostedemail.com (Postfix) with ESMTP id 24CABA0005 for ; Tue, 3 Dec 2024 08:38:04 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="ORN/g3Qo"; spf=pass (imf25.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=1733215082; a=rsa-sha256; cv=none; b=gzBKT20357UD2vtUL/cDcgFemK+14FI4Q2kt37DSFjo7p9ej4xRToOX37jte+XcdUUcweY tqI+RpKwsRAtMOrewA8MkZMGpibSHncunoCOJ9RDqRwNKXkCvnIuPJ4uMy2J8sulvTP/XB DOID90BEQk+X5rjWavRb+DQN10HzP3E= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="ORN/g3Qo"; spf=pass (imf25.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=1733215082; 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:in-reply-to:references:references:dkim-signature; bh=adHjUEuwXA+ANkdOzZ/yc4IEWn5pdw/yGiEpqds38YQ=; b=Iyg8YPVV8EuVHaUAFyJmKunCNkcGAH5YfonnJxi2G7nAYH4EAMx2whD90ZHJJTcQDZnMad 4rUdbUD+a7razA+JEz2/88k3PxrESZahlIhw7ofhtzFryTeDmEFulD2L5YTsELHdVE+k7L uHSyyoYwAkkmyksOlRe6w1fembnblDk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733215093; 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: in-reply-to:in-reply-to:references:references; bh=adHjUEuwXA+ANkdOzZ/yc4IEWn5pdw/yGiEpqds38YQ=; b=ORN/g3Qoa4oR6d/bXC+IuJ+qGBSzncqddxfYxxlpObCMQTZgcCXVWWCym26eINSG8xs2Ae /8VjKK67mGqGr2lkINHabD4QIrmCWZSlzH6nEgg/+ZC64HOgqr7/kgmEL0vf9R/69pnOqn IxVG4BtTql0DVvC7ZY9ZrH+Dxil1cNY= Received: from mx-prod-mc-02.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-266-XLLS1IlrMmade3IZ0UMyDg-1; Tue, 03 Dec 2024 03:38:10 -0500 X-MC-Unique: XLLS1IlrMmade3IZ0UMyDg-1 X-Mimecast-MFC-AGG-ID: XLLS1IlrMmade3IZ0UMyDg Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2ED881944DC4; Tue, 3 Dec 2024 08:38:08 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.22.88.109]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 870B530000DF; Tue, 3 Dec 2024 08:38:03 +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 v2 1/6] mm/page_isolation: don't pass gfp flags to isolate_single_pageblock() Date: Tue, 3 Dec 2024 09:37:51 +0100 Message-ID: <20241203083756.112975-2-david@redhat.com> In-Reply-To: <20241203083756.112975-1-david@redhat.com> References: <20241203083756.112975-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Rspamd-Queue-Id: 24CABA0005 X-Stat-Signature: o34mq6por8tm9ktp575tc5hapxqm6z8i X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1733215084-27154 X-HE-Meta: U2FsdGVkX1+OC9map5wfWA15vobjb6665sle+bNQr9Vgf0ajPCm67F5gdl4AdCSz3mU7G5PFeEpjOd4pq2QLCgocXYiBw3XEj7YlneSean0SW4mOHcnAH9HoKkb0uoPVa5X1CU8PBZbMeXuCMNSnG1CSh0yCM7os7ysrZVrq1QZQD0XfVeq8L0w9pOaN2mof0zIV5OseJRqg/SNIVelndH6Gz1qJyJDCbNqvZmhKLM3+DHw5s7lCbC67QWo3SE+KOnu4zT1pkC9e4v5rV+90ngejOrZqcMzF0Ew7VkbyILpZPpdVQ3rEY8hsHf/WfZCgR866wot3tjSylCmiCIW6gBhUouM8u4bq23xETdjPdFHSGdo7StzdicYhkWw5xOEttesLwePwHjOEd1tCYmu9jeArC8hKEsuuyXxOE4AZmDTT+1E6/5/TD5jvnXkILecXbgMVKdXnQWNdvL3gZx68zT9D6yabE711m39pffxjuXyO4DFZIbwaAQAzQ0rRVPynoJk6Sw4vx8OqbtjmwbraFSETNVNJEj76i9EQMcAyLGSihl2o2wv8PiKnm2v+NZ30q/JFduqrQYHxk+ch2I1yqPx5WHO9n8xjtsH1+ri+1n+woIIm2OqJNrcAaxASx2LoyNLDciBaT3eaQa/QQEKIt07R3yhfOHlztQvIP59HCrUJVFqbkAn4oyi6CY+u7n/w378EmuTtR3EdkRvMZtBkNnarqPOXLj882q6mDfUPh0HuJ2HHf9CW0jCI4f32UWsh+9GFAsyK7JmhGfl5oWLQoIu79b2MNAWZzZY7fC2eoUQ4yGVyYJP92uN7IFZIt0jdqE510E4FhaKmHnmk8EAekmYZm276oeO2ELCD1fgFujUvLUXzE7Ta1GXj4DUQV8E0bAw7Km8qtloO9/H33p6yjAdulUB/WTX4IyI0dBnU0gTFLMUerrwgZJ6D38MoPZEpFKRoumaSAK1KNZxhw0J tshmrSuq K2sG5ebyW6lYjHoDOLP14sKaWF4CPJaj9zhXh3JFw1o97YWtL4w+fmltqpFzmgnBLH2ufiz5tTo+TeaZP0AFKFtxufZm5M87Cgn+1NQFMCv76RN+fnmWxOtnvY/8bYuybCpNyLSRyxP84AoVvcjG8SeLgExdNu2FKiEU53XhNUvaTBJQwxHIiaMo5KNUaiE2DmllC8iW7ZWwdd860+FgNjzqoCmVvLdaqLGOGbluwaZFblzRKKOmJPXn7eDr2M0Yw7qoqV/erUxmTrnMdQ/+Uu5BCpZiWO531Q36/8irLyUJg/0h9In712jGCY6ipnoFMeOravpP97xTRZkdWVHEP6AHF3VKs7itB1rwcnVrSW1dKua7jSYKh0tLxjqQHPPZH4OXo2MIvSYmj1ru7ZaNlXe+zxMEp7WNkSXos02+HK4H/a1o= 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: The flags are no longer used, we can stop passing them to isolate_single_pageblock(). Reviewed-by: Zi Yan Signed-off-by: David Hildenbrand --- mm/page_isolation.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mm/page_isolation.c b/mm/page_isolation.c index 7e04047977cf..e680d40d96de 100644 --- a/mm/page_isolation.c +++ b/mm/page_isolation.c @@ -286,7 +286,6 @@ __first_valid_page(unsigned long pfn, unsigned long nr_pages) * within a free or in-use page. * @boundary_pfn: pageblock-aligned pfn that a page might cross * @flags: isolation flags - * @gfp_flags: GFP flags used for migrating pages * @isolate_before: isolate the pageblock before the boundary_pfn * @skip_isolation: the flag to skip the pageblock isolation in second * isolate_single_pageblock() @@ -306,8 +305,7 @@ __first_valid_page(unsigned long pfn, unsigned long nr_pages) * the in-use page then splitting the free page. */ static int isolate_single_pageblock(unsigned long boundary_pfn, int flags, - gfp_t gfp_flags, bool isolate_before, bool skip_isolation, - int migratetype) + bool isolate_before, bool skip_isolation, int migratetype) { unsigned long start_pfn; unsigned long isolate_pageblock; @@ -489,7 +487,7 @@ int start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, bool skip_isolation = false; /* isolate [isolate_start, isolate_start + pageblock_nr_pages) pageblock */ - ret = isolate_single_pageblock(isolate_start, flags, gfp_flags, false, + ret = isolate_single_pageblock(isolate_start, flags, false, skip_isolation, migratetype); if (ret) return ret; @@ -498,7 +496,7 @@ int start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, skip_isolation = true; /* isolate [isolate_end - pageblock_nr_pages, isolate_end) pageblock */ - ret = isolate_single_pageblock(isolate_end, flags, gfp_flags, true, + ret = isolate_single_pageblock(isolate_end, flags, true, skip_isolation, migratetype); if (ret) { unset_migratetype_isolate(pfn_to_page(isolate_start), migratetype); From patchwork Tue Dec 3 08:37:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13895579 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 170D0E7716C for ; Thu, 5 Dec 2024 15:30:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A1C7C6B011B; Thu, 5 Dec 2024 10:19:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 816696B0131; Thu, 5 Dec 2024 10:19:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C0F0B6B0124; Thu, 5 Dec 2024 10:19:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id D69006B007B for ; Tue, 3 Dec 2024 03:38:23 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 91E781607C2 for ; Tue, 3 Dec 2024 08:38:23 +0000 (UTC) X-FDA: 82852995666.21.C74D5FE Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf02.hostedemail.com (Postfix) with ESMTP id 3BEFB8000E for ; Tue, 3 Dec 2024 08:37:57 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=LknuN6Z9; spf=pass (imf02.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=1733215093; 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:in-reply-to:references:references:dkim-signature; bh=WPPCObfnf5xw33aPmiPyCg8m61901qLXiqhqw8UMgIQ=; b=pHEvGCq8IN4aXT8GVa6Fm57qytNxLtrv141AdUvvPH/DbH5gpFDQ78uYl8JinQGgqak3dL oRwFXShXGXSjnKdR+b0EUkxHlbQTsQSOAuL7WWh45379K2Tdebj9Nuh/cpW8rlRQU252D7 7WEeGEWvVbwadPLIjd4UD/L/9jERwbU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733215093; a=rsa-sha256; cv=none; b=FuAFHH6lOsubd661TPaoB9XbO/9vjJIhLm8UD15oD14Uf8zVeUCYzwc+s+sWh+UA3Yh7Gk J3xG78ySf0N3jWT26cw0GQhd+yfmPY3jb/Vn9xgmG3wqPvey+IzQWIJICBz+vY8XkLt8ak BaXJ69LD3QCm9IklK2r1OF9TIU137f4= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=LknuN6Z9; spf=pass (imf02.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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733215101; 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: in-reply-to:in-reply-to:references:references; bh=WPPCObfnf5xw33aPmiPyCg8m61901qLXiqhqw8UMgIQ=; b=LknuN6Z9cz58PsamGVF4gsKRW7PWYLORFop6P2jTnyrk1kPwVjl8vlZqEHFdhU+Hr42n9p bAaapdq4L9hZ3GJ1tYODKs6w2wucojePE6BdcDp/9RHgvtje9EFWl6eYS/XHNSm0+ppW+M m3ln4SHkyr/nLC5+0xkKzyJneN2FYeg= Received: from mx-prod-mc-03.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-450-mLrc1REJMyeszWWKgLAW6A-1; Tue, 03 Dec 2024 03:38:16 -0500 X-MC-Unique: mLrc1REJMyeszWWKgLAW6A-1 X-Mimecast-MFC-AGG-ID: mLrc1REJMyeszWWKgLAW6A Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1F43F1955DCA; Tue, 3 Dec 2024 08:38:14 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.22.88.109]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9127830001A0; Tue, 3 Dec 2024 08:38:08 +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 v2 2/6] mm/page_isolation: don't pass gfp flags to start_isolate_page_range() Date: Tue, 3 Dec 2024 09:37:52 +0100 Message-ID: <20241203083756.112975-3-david@redhat.com> In-Reply-To: <20241203083756.112975-1-david@redhat.com> References: <20241203083756.112975-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 3BEFB8000E X-Stat-Signature: bgkhpatonr8o8wapq5cfo7jdnwjsdymq X-Rspam-User: X-HE-Tag: 1733215077-612526 X-HE-Meta: U2FsdGVkX1+AS1HOOtQ5vNOA7/Qtd3+Xwlz4qNUqyBAtPo01lZjst8hGlrIud6HR+L/6dMKCIYainqwZuwjnz6cgQHcZu151rZUWb4ac2+XEagty/fVYk7c/7pyEo2jhqs0vyLXffUmksQ02t1vOy/UYsTrff/7grTbL03+KMzaVOkhMltxYRHdiAKuRTpCZUxLSDHVNn26qZDPyfkU0+mMBa+m0mIqUDqTwpIT32TeBbjcCgO4XicxUJTApYkpGq3u5AOhKhTDdCqYWDf/e8FlRzaE2O46Ydskjc3mnUDt/76W8jvNRPL41iZ3ZNLjZkPzGJhhF3dGNqUnbU0ShVHGRDfjfvweK5feEMqqeUXL/zvDQg+/dGIGgkyq/mMFmPyqk9bPMk1WffLcJbxX4evMmq4992BTM4PDR5X1V9nutD+E1bkfNxGH1CWGhR23V3Mc3YLcd+E0sOGaONj3eIuF2HsT/WX71hBsoyvfsocpaWLnT/qoyhOTAFsI4QLHSxzNLKyHLYsFR5xN7kbAhy4n1T3U0trZ6iP0yzJJuc2lqrvSlNQBFTYJ+UMB8IKiUU6rM+NxF31vNRo48E3daN3JTBopJKMNXgJgEu3qoPsNa5GxfPJXju4SZflBMqbFv5HuIbdJBQlj4M9ygTpuIA3ouaMIPU9RQQql84/i2nIf53X+vchWLsrXy4yIbmLbcGbrwjvyV0+fgDaJUO5Np1faiuewp5dGW4zUcB31i9nUylbTTG9YGAWPyjDN/tTJfiy1JKe93F/FbZOrwwpfAMYS1SW+PuZ1H8niw+ZsfsUCfiE2vnuoYjPQin7ghZQ3ll6FyeZkxzc/JYneSVG1nhm/wsIofp/rs77PkBoozP43s+2TpGPQue/F3Onekl3ESXnqmcS2TWo7hu9go+y9A0B3Y6ZrVRYYWt2PanTVR8T+2/SsQu/w0A7842wASr7KMrwdkusEZY79h/Hsq2xJ nE5ipCWR fHbX86+IBZ2QJqfjLq9HlXJGqzWpGh5VC2maMUzjci8qXFJ3CDJn7yJhd97rYeJJm37lvIKs+cioK//gD4wA8lQguHxnBJB7zqPCyViJCuIUcweDhYrwky0ZbgqDmxGjKLNJ4N5PfwYBxJy0yjoocH7JGqJSJw/D/3yiu3EaveI25ivmZ4W+dVahyQtPi1glFOR0gCq+EWMCOEyJlMvknLSD648rjbHBUgH4JVAouA+mZ740MSg4DmgXMY0+Y7rCNLrBfcwTBbYjlnxX11b62KKpyxXIwhap5Uh8GNxNBuiDCcX1qMef+FqLIsmWprSnA+JLHsrDWJhEnwhZjV1YRLB+xwLkloN6O7xxQOf6HTfVEcvNM6opd177G0moniViyKxG9O/+TyUGtu0S5munkPsidyO23+W3jPeKZ7351O1tlqEU= 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: The parameter is unused, so let's stop passing it. Reviewed-by: Zi Yan Signed-off-by: David Hildenbrand --- include/linux/page-isolation.h | 2 +- mm/memory_hotplug.c | 3 +-- mm/page_alloc.c | 2 +- mm/page_isolation.c | 4 +--- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/linux/page-isolation.h b/include/linux/page-isolation.h index 73dc2c1841ec..898bb788243b 100644 --- a/include/linux/page-isolation.h +++ b/include/linux/page-isolation.h @@ -31,7 +31,7 @@ bool move_freepages_block_isolate(struct zone *zone, struct page *page, int migratetype); int start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, - int migratetype, int flags, gfp_t gfp_flags); + int migratetype, int flags); void undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, int migratetype); diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index c43b4e7fb298..9b184ba064a0 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1992,8 +1992,7 @@ int offline_pages(unsigned long start_pfn, unsigned long nr_pages, /* set above range as isolated */ ret = start_isolate_page_range(start_pfn, end_pfn, MIGRATE_MOVABLE, - MEMORY_OFFLINE | REPORT_FAILURE, - GFP_USER | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL); + MEMORY_OFFLINE | REPORT_FAILURE); if (ret) { reason = "failure to isolate range"; goto failed_removal_pcplists_disabled; diff --git a/mm/page_alloc.c b/mm/page_alloc.c index cc3296cf8c95..f371fbf2145b 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6451,7 +6451,7 @@ int alloc_contig_range_noprof(unsigned long start, unsigned long end, * put back to page allocator so that buddy can use them. */ - ret = start_isolate_page_range(start, end, migratetype, 0, gfp_mask); + ret = start_isolate_page_range(start, end, migratetype, 0); if (ret) goto done; diff --git a/mm/page_isolation.c b/mm/page_isolation.c index e680d40d96de..c608e9d72865 100644 --- a/mm/page_isolation.c +++ b/mm/page_isolation.c @@ -442,8 +442,6 @@ static int isolate_single_pageblock(unsigned long boundary_pfn, int flags, * and PageOffline() pages. * REPORT_FAILURE - report details about the failure to * isolate the range - * @gfp_flags: GFP flags used for migrating pages that sit across the - * range boundaries. * * Making page-allocation-type to be MIGRATE_ISOLATE means free pages in * the range will never be allocated. Any free pages and pages freed in the @@ -476,7 +474,7 @@ static int isolate_single_pageblock(unsigned long boundary_pfn, int flags, * Return: 0 on success and -EBUSY if any part of range cannot be isolated. */ int start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, - int migratetype, int flags, gfp_t gfp_flags) + int migratetype, int flags) { unsigned long pfn; struct page *page; From patchwork Tue Dec 3 08:37:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13895584 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 D3FE2E7716C for ; Thu, 5 Dec 2024 15:32:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A21F36B00E9; Thu, 5 Dec 2024 10:19:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 18ECF6B0123; Thu, 5 Dec 2024 10:19:24 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3F7776B00CA; Thu, 5 Dec 2024 10:19:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 26F786B007B for ; Tue, 3 Dec 2024 03:38:29 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id DAE1D120798 for ; Tue, 3 Dec 2024 08:38:28 +0000 (UTC) X-FDA: 82852995708.19.3E8F477 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf13.hostedemail.com (Postfix) with ESMTP id D0C2F20019 for ; Tue, 3 Dec 2024 08:38:12 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="X+dwj/SN"; spf=pass (imf13.hostedemail.com: domain of david@redhat.com designates 170.10.129.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=1733215101; 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:in-reply-to:references:references:dkim-signature; bh=LU3Y8BABokL9EuVXZz3YTSIe3emDP78aZncO4AsTCRE=; b=g0vPWuRDFj4sGiVDTt84NYOgAd5fBSbCpX303DEOdv3DtHfTTkbyWxtHW8f9BkAmD99K7F VfntRxhXL4iSJwpLk2GvksXUC2UvRMVB7IUr/TL/IQG5zbs/3bmfC2j5EobNq5JrxbwoDz YMeVBJsnIaLGRLiBeadHaDXmRBBb/48= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733215101; a=rsa-sha256; cv=none; b=7nxe/zMQVkhSpAr27aJeUzovXa86Rlh0+6iRctqkgrIJSAvYHnlgnoZFr+GKsBJ782xXG1 Nxjf9Rq6taR7oEHqrGtsuKTnZnc4pg5ZcjaTtTVXuRysDxBudN3ISwm1IZtqd89YPLxFqL fpHYQ/ktfUpDUidN+QYm1HZLXZXQSBs= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="X+dwj/SN"; spf=pass (imf13.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733215106; 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: in-reply-to:in-reply-to:references:references; bh=LU3Y8BABokL9EuVXZz3YTSIe3emDP78aZncO4AsTCRE=; b=X+dwj/SNBbgNSQ63HjCvkjhc4aBBaEZygfKPs3/1ENO42X/4GxKTh6NWHCzPyTP65y74cf s5qL8AUIUmEofRtpdT1BNJHmTTS2y/aQBqW1arZ/lSZkpImYZxJBUpq6QmWVrVBrThfJXR JAD+Hep5gJ/Einp+SvVXm0vviwJZHAs= Received: from mx-prod-mc-03.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-463-KsYeB2QvPViavZaAQQOzig-1; Tue, 03 Dec 2024 03:38:21 -0500 X-MC-Unique: KsYeB2QvPViavZaAQQOzig-1 X-Mimecast-MFC-AGG-ID: KsYeB2QvPViavZaAQQOzig Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6D7EA1955DC2; Tue, 3 Dec 2024 08:38:19 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.22.88.109]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B1C8F30001A0; Tue, 3 Dec 2024 08:38:14 +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 v2 3/6] mm/page_alloc: make __alloc_contig_migrate_range() static Date: Tue, 3 Dec 2024 09:37:53 +0100 Message-ID: <20241203083756.112975-4-david@redhat.com> In-Reply-To: <20241203083756.112975-1-david@redhat.com> References: <20241203083756.112975-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: D0C2F20019 X-Stat-Signature: hzn9owdn7ahr4pdz37xyyuwh7di5arfy X-Rspam-User: X-HE-Tag: 1733215092-287079 X-HE-Meta: U2FsdGVkX1+59mq5CwFOxA2e3f6Agh4aqGA/GPgxw5lFSZ99H4h/8UYti/hZC4cv/MaecgjrbVrF7WeTNu1MqF8BADKVpKzQrBbOCcQF8baqZDH9z5BJ082QPKN8yRRS3wSp3CqqWXxYDJHILn1jDwTWod96i35mji2ZuMYP7wBRpbBt9H3lQ6YH3aVvpxEtNsBT3/jLCchkdljq5Y/ZTTSik5OpOEDxZV+E1+r5Xi396Ffxz7tqerdzpxU9ZU/2AQH1w5V7KJYZBJMFb5ItoCrK9uXK/LGGgSx0ERKqxIcQZssD7F4/NHjmd15hCCqWr7K2Pl0/K3LfhNosxm7c37Yv6GHOBefg+8JPp0wSHcoWdJJ6sjvjZAQbllz82hzNqWhR7/oe8JjX2d1oy2h6CI1+PDhNQcgEIXJMVdgo5tSYkg31ggf/t1r87eRtrHK9JCo8HMa+91hZE1eCoa3+Il3qnbO8HENyDEZpDZ6p7CdSt80sSmKUb+jbbUNJxj/9ALNS+jKrmtouHdY5YTUCDXzPTwy0mTyyau8reizdH2Hp+uUv/8WHAg+LoL3HaYc94/DdpT03ZTO+8XxgZWF5KveEQ4iBkF0u15zfT91mFLf5Sy+vWTJI5VS88sM8MLmtIVek+lGgq+CnCkmQiz324XTuHUCyNoqPwUWdP+YCy5BsjpBGHR9fdpPyCp7oG6mbrgWSj28BlkVdTnFXuKrBDBFQa2748q6ClOTqLwAWIXne0bzlEATbDPCcoL2YWIdycOlx+ldybY1/ehAgpiJaZcCRdrsRndmlN7l1A0cptU0ZxjNoMuFKKbf/ETyQ4RZPCNbjL5s08TkTo+JQO2puvL3ZesqXY8jBhhlcG3ZgcZXaMILmJg+PS0HUgLUVyUOfc7WEJv9tncyhQrWg2pIUCY1WlL4isDWh9WVVD41fsJ5rhTK0Do71UX9Eauv8qD5U9DTRKtugidlRiy/lcBv TGBAWQd5 Ky32uZ+oy2bp8jEUyRVXnoh+XFyDSHnvSVSHjuwC26AR+fJ75o5T/acMTZHrcCuQzEldBr9ItzxbTKUIyGNEM5Kra/WJzdaqiymVEGK5bToo4k6VvXOIifFobNdXEoa+DjDv5m+pw33C0NUFlcvYyI9KZdZWjc9zDNmyInlQ6yFVJdsfPNRgdi7KIvFlCxcrvABCdrtX1+5nS3FSFuRSiBLcXgk0Na7svdmrsaaHkAL+xY3rz/0xvGLtIdmemMhackfJ0dhr5RzN/+1RvE15IiqFbhIobQMIMybhqTD3t+sJHQNxTgwEi4CiVfaD+618auMSRUyFNgusPiVXfVkiLL8HcNqt8Xv9mh1NIcs0VrTh4i25JJvm9asPSaEdf8/Vg6M/n57322xGcDvQyiuifWwFiE5tpqeC19bYEcjlZmwaznds= 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: The single user is in page_alloc.c. Reviewed-by: Zi Yan Signed-off-by: David Hildenbrand --- mm/internal.h | 4 ---- mm/page_alloc.c | 5 ++--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/mm/internal.h b/mm/internal.h index 74713b44bedb..4bd3685c33ef 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -839,10 +839,6 @@ int isolate_migratepages_range(struct compact_control *cc, unsigned long low_pfn, unsigned long end_pfn); -int __alloc_contig_migrate_range(struct compact_control *cc, - unsigned long start, unsigned long end, - int migratetype); - /* Free whole pageblock and set its migration type to MIGRATE_CMA. */ void init_cma_reserved_pageblock(struct page *page); diff --git a/mm/page_alloc.c b/mm/page_alloc.c index f371fbf2145b..ce7589a4ec01 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6284,9 +6284,8 @@ static void alloc_contig_dump_pages(struct list_head *page_list) * @migratetype: using migratetype to filter the type of migration in * trace_mm_alloc_contig_migrate_range_info. */ -int __alloc_contig_migrate_range(struct compact_control *cc, - unsigned long start, unsigned long end, - int migratetype) +static int __alloc_contig_migrate_range(struct compact_control *cc, + unsigned long start, unsigned long end, int migratetype) { /* This function is based on compact_zone() from compaction.c. */ unsigned int nr_reclaimed; From patchwork Tue Dec 3 08:37:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13895575 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 B3BB4E7716C for ; Thu, 5 Dec 2024 15:29:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E0C326B00F6; Thu, 5 Dec 2024 10:19:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2141E6B0139; Thu, 5 Dec 2024 10:19:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CF8736B0123; Thu, 5 Dec 2024 10:19:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 47A236B007B for ; Tue, 3 Dec 2024 03:38:32 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 0F1BF80796 for ; Tue, 3 Dec 2024 08:38:32 +0000 (UTC) X-FDA: 82852996170.18.A71D50E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf02.hostedemail.com (Postfix) with ESMTP id A26178000A for ; Tue, 3 Dec 2024 08:38:05 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Uuqqwqgf; spf=pass (imf02.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=1733215101; 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:in-reply-to:references:references:dkim-signature; bh=cjBW/vjYP3nNfvObrA09IpRDh5cADITJHgvHLWqOgrU=; b=omgiF275vb2j/+C4yRXno/kWUv/hlyx2TdsWE5Eh8R5dxB++xVu+fc5JlxUGm3jeXZz1TX Qz4gVRIgMXLPtz7EjaOwe4jRKt+Zled6F6tMg5h3HdLyioZxkO6Zwm1PsAvFOGkHw02Pjj KKt2j/fJsHhbe43/i7VzL+ruZ86s5gU= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Uuqqwqgf; spf=pass (imf02.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=1733215101; a=rsa-sha256; cv=none; b=0pUOPF/7yi/DAsQv+ifUAVVOch/llmZdF87mBaf+Zh3ewSItZ3Kk4t+UOBEoi/kB3GoRQT sHIeia/mSzXBJppAX6iNJh6PQ0SRSV2Yw4DQKo8f3vatvfcA56KrZ54TCqIDXfByAflR9L QpVbPQMtPYWc4TIUKKThZhCqEvlb7pA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733215109; 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: in-reply-to:in-reply-to:references:references; bh=cjBW/vjYP3nNfvObrA09IpRDh5cADITJHgvHLWqOgrU=; b=UuqqwqgfwENxHg46wMuvHbxEBvBCUZbPr6OXD8QR0QWcbIJcsybGN4bCZMGhBW1AA6G9MU 5/P70zCWcYuVnPRD4hPfm6eRPGut9jH0niVPbxHqneV4CKmVUtDCAS4dexEXxTUHXFPCDM nSTRwXNC3858n8taMee7ebjX9PXniZ4= 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-214-CYrUeKNrMp-SiLEqUiM59Q-1; Tue, 03 Dec 2024 03:38:26 -0500 X-MC-Unique: CYrUeKNrMp-SiLEqUiM59Q-1 X-Mimecast-MFC-AGG-ID: CYrUeKNrMp-SiLEqUiM59Q Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 58C311955D4B; Tue, 3 Dec 2024 08:38:24 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.22.88.109]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1120830000DF; Tue, 3 Dec 2024 08:38:19 +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 v2 4/6] mm/page_alloc: sort out the alloc_contig_range() gfp flags mess Date: Tue, 3 Dec 2024 09:37:54 +0100 Message-ID: <20241203083756.112975-5-david@redhat.com> In-Reply-To: <20241203083756.112975-1-david@redhat.com> References: <20241203083756.112975-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Rspamd-Server: rspam05 X-Stat-Signature: cyp16mxnxcshrhaxk4futa1w4kwnetk5 X-Rspamd-Queue-Id: A26178000A X-Rspam-User: X-HE-Tag: 1733215085-700855 X-HE-Meta: U2FsdGVkX19Z1tyO7ktGQCY1rlDkSezTKVkjqAHqSFn5plPRBkFmuLYSMyp6o2S2eaCTkM2xqi1dk0KFa0eoknhXKYXYlO7Wg7pNgn41QJHFZqgrcr1HqyBsbPVJc9UI+GGkDOkb1BTFp2Kao0iZ32RTVApwDS8GFCV5F+p/O0E2rifYYBn92sFZYVLI3l/VYMXEUe3pRGHRrxUU/AZUU5O61dHUzwB6qHrBDGoaVAWGP6AEfnDfDK2DC0DebgQ0Aa8AcAxAh1n8B7GQLTfsgbmyzulwa564ziKYB1xytdELv0Lh9yVp9CMsbYds1YUF28eKVR8+ogZi/d1OXes65eCyV9rLxlBVwBMy5zyn0b/F6mOLxzj+KykdN0+cRYOfS0RbhIY0Tma48Cqbz7cg0K0nByICmLrt+cK4lre1LyHVLiWFwqs04hyNAKeAdJW2L+ipl9M2oazsgB9v2xCHjTvBxDWbXnBpPRj5Cm/wmxagVqo88TB4CvHYshd3BQdKlANtwlA3T1THf3I01qxK2YsChFf+ESy+WGe74YWFn1x9weN0bfFGHB88TSy/ACg31m/mx4oD4tBMJpeUihA+NnRepxuHFDJ94xPa86zFVZnXc3Txt5e/t7mcc/BWA0b/y85CHxDbAegd3aeQYK7yUYFYQACmPpJwqg0jVTN26J9rHyiKrrqg/uFUJnDJ0IjwrvaMy7Tk9X26l4fPe/GNdAdDu2AErLzHoHh5gtn+kLrjAHcvaf0tu5imzCZKSnC4hBKKjqJtQlS6R8L+DQNyKgbLru9Y/PBnzdwkWkB+x2A1yiZp5rIinjo5bfVqL5AFwJziRjOZCg+oJvREFKtwRryxlb4FdID64bZhlSA7OvRmSe3nzVMK9yMwSoD7l7UomxYgvP+yxwXX2Co5wUpVh7hmjrKWWBIgOXLga8tAZbfJba5gZ/RiViOxN2q3AbNI9ul84eA7qXIu5siGPwy uC8VSNU4 504TXflxPB86X2VbIdBo7scaMgxAg8CqV06esYyc3bSQWB4GRJhzGvWjQQt2R6yM8vHq6Q1gEIleuGExqnaGd5kqD0Qt7d32+HHqqeZx7zIKjdSwkRKrPXKRdah3mEyyf8I/XAFk4a5FpN5m51gHKzlFAv8BWRizkLdUJoOaJ8NXqG6p4E7NDQqT6h3xpv7m/t1aJ91YxBqumQvfWyqv3w4+3VVGxH8qP7GDhzKq8SUo8Gk0OL3Q9dK1mi+snIA35cP2XHZSRBX52fQqSIdzgKY2w2bEUJaYtSo5rmpYbx7Q/vTjHCtmZsjGbB9yPaDJNdmuszryttQUC+SIrGASC2Vrubk0qyXnXhyGEThXKHQwP73I1ax41SogOtb2svxvIjem+QRJghgFUd9f150L+jN4X326RLYoQFutPuwMsYmtoiNg= 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: It's all a bit complicated for alloc_contig_range(). For example, we don't support many flags, so let's start bailing out on unsupported ones -- ignoring the placement hints, as we are already given the range to allocate. While we currently set cc.gfp_mask, in __alloc_contig_migrate_range() we simply create yet another GFP mask whereby we ignore the reclaim flags specify by the caller. That looks very inconsistent. Let's clean it up, constructing the gfp flags used for compaction/migration exactly once. Update the documentation of the gfp_mask parameter for alloc_contig_range() and alloc_contig_pages(). Acked-by: Zi Yan Signed-off-by: David Hildenbrand --- mm/page_alloc.c | 48 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index ce7589a4ec01..54594cc4f650 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6294,7 +6294,7 @@ static int __alloc_contig_migrate_range(struct compact_control *cc, int ret = 0; struct migration_target_control mtc = { .nid = zone_to_nid(cc->zone), - .gfp_mask = GFP_USER | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL, + .gfp_mask = cc->gfp_mask, .reason = MR_CONTIG_RANGE, }; struct page *page; @@ -6390,6 +6390,39 @@ static void split_free_pages(struct list_head *list) } } +static int __alloc_contig_verify_gfp_mask(gfp_t gfp_mask, gfp_t *gfp_cc_mask) +{ + const gfp_t reclaim_mask = __GFP_IO | __GFP_FS | __GFP_RECLAIM; + const gfp_t action_mask = __GFP_COMP | __GFP_RETRY_MAYFAIL | __GFP_NOWARN; + const gfp_t cc_action_mask = __GFP_RETRY_MAYFAIL | __GFP_NOWARN; + + /* + * We are given the range to allocate; node, mobility and placement + * hints are irrelevant at this point. We'll simply ignore them. + */ + gfp_mask &= ~(GFP_ZONEMASK | __GFP_RECLAIMABLE | __GFP_WRITE | + __GFP_HARDWALL | __GFP_THISNODE | __GFP_MOVABLE); + + /* + * We only support most reclaim flags (but not NOFAIL/NORETRY), and + * selected action flags. + */ + if (gfp_mask & ~(reclaim_mask | action_mask)) + return -EINVAL; + + /* + * Flags to control page compaction/migration/reclaim, to free up our + * page range. Migratable pages are movable, __GFP_MOVABLE is implied + * for them. + * + * Traditionally we always had __GFP_HARDWALL|__GFP_RETRY_MAYFAIL set, + * keep doing that to not degrade callers. + */ + *gfp_cc_mask = (gfp_mask & (reclaim_mask | cc_action_mask)) | + __GFP_HARDWALL | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL; + return 0; +} + /** * alloc_contig_range() -- tries to allocate given range of pages * @start: start PFN to allocate @@ -6398,7 +6431,9 @@ static void split_free_pages(struct list_head *list) * #MIGRATE_MOVABLE or #MIGRATE_CMA). All pageblocks * in range must have the same migratetype and it must * be either of the two. - * @gfp_mask: GFP mask to use during compaction + * @gfp_mask: GFP mask. Node/zone/placement hints are ignored; only some + * action and reclaim modifiers are supported. Reclaim modifiers + * control allocation behavior during compaction/migration/reclaim. * * The PFN range does not have to be pageblock aligned. The PFN range must * belong to a single zone. @@ -6424,11 +6459,14 @@ int alloc_contig_range_noprof(unsigned long start, unsigned long end, .mode = MIGRATE_SYNC, .ignore_skip_hint = true, .no_set_skip_hint = true, - .gfp_mask = current_gfp_context(gfp_mask), .alloc_contig = true, }; INIT_LIST_HEAD(&cc.migratepages); + gfp_mask = current_gfp_context(gfp_mask); + if (__alloc_contig_verify_gfp_mask(gfp_mask, (gfp_t *)&cc.gfp_mask)) + return -EINVAL; + /* * What we do here is we mark all pageblocks in range as * MIGRATE_ISOLATE. Because pageblock and max order pages may @@ -6571,7 +6609,9 @@ static bool zone_spans_last_pfn(const struct zone *zone, /** * alloc_contig_pages() -- tries to find and allocate contiguous range of pages * @nr_pages: Number of contiguous pages to allocate - * @gfp_mask: GFP mask to limit search and used during compaction + * @gfp_mask: GFP mask. Node/zone/placement hints limit the search; only some + * action and reclaim modifiers are supported. Reclaim modifiers + * control allocation behavior during compaction/migration/reclaim. * @nid: Target node * @nodemask: Mask for other possible nodes * From patchwork Tue Dec 3 08:37:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13895594 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 A4007E7716C for ; Thu, 5 Dec 2024 15:34:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0097C6B0093; Thu, 5 Dec 2024 10:19:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 520266B00C4; Thu, 5 Dec 2024 10:19:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 26EBC6B00EC; Thu, 5 Dec 2024 10:19:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id A62F86B007B for ; Tue, 3 Dec 2024 03:38:34 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 5BEF61207B0 for ; Tue, 3 Dec 2024 08:38:34 +0000 (UTC) X-FDA: 82852996002.13.8073AEA Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf09.hostedemail.com (Postfix) with ESMTP id D05DA14000D for ; Tue, 3 Dec 2024 08:38:23 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=QHNhI4bo; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf09.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733215106; a=rsa-sha256; cv=none; b=DldEHeU0sfO/gmCMBy262G47qaBD3+EttUZbEl9oUcaXxwV/ogFxNgknkGe+he0AtOuTZ1 6ARY+/dUH0DDEOmg3OrpvZIdqVmTfQBtDFgzeRevlrZL91i99pnHTMu6lLaTXH1d2b75l3 p6UuR+K6kQsV88Abkfo30Ng28PBB6Fs= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=QHNhI4bo; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf09.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733215106; 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:in-reply-to:references:references:dkim-signature; bh=0fQppTuvH7gihnzA0jS0S7Nrs9VtQXSbfqTsq5GHr48=; b=fbMovOr8Q6pBG0AipmgZDCzafIijknAPUH1Z4ovtOhHgt33M9tOcZ8DkdZl8V1oNN4hy59 hBU5NL9xSLie0ODggkSh93RN5BSlhlrr6YTn+vLTrDYEiYOTlftT18aOixh6Yw9NKgj9ig qdpMMvcJGUXVz3gd0vW0RgHlJRObZxo= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733215112; 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: in-reply-to:in-reply-to:references:references; bh=0fQppTuvH7gihnzA0jS0S7Nrs9VtQXSbfqTsq5GHr48=; b=QHNhI4boIQwyN6GZD0X8tZtTZG21NiHOsYhDPqDQSoC2kdvvLok1ey9+5MlysHHfW1VzMV hJ1reyaelb1Zk5dZ78u0XGvFQiC+Tc+RIINLNTamf4pr9NvoWBfjGNbVtki5D1jqguZnfs 89GL4KrDrfHQnFjCwVjVKoXofSlIDjc= Received: from mx-prod-mc-04.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-649-KHX7Pf0UPF6xnbXl4YXWTA-1; Tue, 03 Dec 2024 03:38:30 -0500 X-MC-Unique: KHX7Pf0UPF6xnbXl4YXWTA-1 X-Mimecast-MFC-AGG-ID: KHX7Pf0UPF6xnbXl4YXWTA Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4588B19560BF; Tue, 3 Dec 2024 08:38:29 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.22.88.109]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EAC8F30000DF; Tue, 3 Dec 2024 08:38:24 +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 v2 5/6] mm/page_alloc: forward the gfp flags from alloc_contig_range() to post_alloc_hook() Date: Tue, 3 Dec 2024 09:37:55 +0100 Message-ID: <20241203083756.112975-6-david@redhat.com> In-Reply-To: <20241203083756.112975-1-david@redhat.com> References: <20241203083756.112975-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: D05DA14000D X-Stat-Signature: zw436t1989tpsq6g6z5nwhimanrd9fo8 X-HE-Tag: 1733215103-900944 X-HE-Meta: U2FsdGVkX1+INTXGnkEjdl8d3KS6yrKNO9BHC37vv6FbC87mL3+p3rI9OdjthU17BDJWpkuxECAE616ZFL8NoBqyrBSuUMAYLnksaSBBPaVwm/QrOKExm597t3xwy0BTdHp8dKx0+Qs3YD5VhmgJbiI73Vb5x33TTqklRM6TtcOMEDO4nFLFk9ID+BXE1Kb/zTA+g05OWhGLIeTyK90pFgiBvaNRQVVcz6SyUigOYjaFXjAF5Ab8CTZ7mx4cKAag3MkYBa6JKC7dJcG0tcUZOVZXocBHIq0xUtLRrthrp7HCKnJOsuG1yPp8yanly2qHyHxWUH9cLDxitzaFMz28ovM0fGaEDlhG7lTSgEO+iuKAOKAlyojTJewslgK/A8a+DX0L99lQX/2qHtwpo7UQeM5ZtC2dyUREBy6xikBAJtyGK7Uxe9WuDD8i1yxEH+0nsMS1dtNiSSu8kjMnJoH2qbZqxuY2S/yksfslDjPyeb9tHCVcN3UfJ0euisRWy7ZLoaRHQMVAnm3cvBOdco+UpFFovqiJxyNlVxMUVHHXZB7mvvZiZnTBv+0eLiW6R6z97OQInDFIe2qlodlfQzCCgSOLtBXpfFtzAZU4xdGTg83NjmnAeDsgcMfyWFUn9TabZmcTu+X7lMxk8yCqe7/UHW39DDlKoSeT0H8iu7fGWzRHeN6RPWDxQPzSUiXn2r/zx752yYwxh+KL3CiI2RQzlC5HDyag1v1oFtCDGuSH+EETLU2J+NRE4Eo+jRbzZDPMzfrxvKib8Cg8qQozMZ2Bv+Qh2wsstZrf0//jNZ0jaZJ1jK8fb90WHcGE0SpzhEH4PiWHjRxYXGkQvbYm7Ehnki3XmdOCz6XvxdR7JK4rAhGWTA4zd7NUSthgAk7AezkxDC98Sl1/+7vM1VoSgOJ6I4iCnrWOzwkhcSpyRswqapY1IMLDdRWGYJup1om/KMx6l0F4zxrpghCt1CTc2Z6 q+azESlu Ef4h4fGwtljhX/Pkram7OTPhSvBIpT9vTCH0OFMPonwkO4lT3o+cZSKfZgYTG6XDDQ1zFnR80FY065Spt9uZq3QpzVrHA/xg0vXPIsoMIaTWKQJfsBDbrG01wt1yoKE1j+1vNv2OWRR0Pc04r47VY/UOd/krzVChqx0LAX2RucJ3l7Zy6Hs/1KVolm+FG+nlusPOSoXfIuvMcZfITtIrN7mXCSEdOclQTL4FTsfZQ4QBzXcsDOMKAWe5ZKowtQkDNwUUYa76jzyu7GxGoWPUk9IoH+z+vCa3NRS55ARp5vVmKP0HNGosCnqyav/3+ing51MYSc1oPNUJDIyJO4HatpThPDxwYtZJp7YylJ8CirrukbWgXq6GxraRIgF6W4pCiuLAr3VYSs1plm/iEgOazA/vZ+w== 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: In the __GFP_COMP case, we already pass the gfp_flags to prep_new_page()->post_alloc_hook(). However, in the !__GFP_COMP case, we essentially pass only hardcoded __GFP_MOVABLE to post_alloc_hook(), preventing some action modifiers from being effective.. Let's pass our now properly adjusted gfp flags there as well. This way, we can now support __GFP_ZERO for alloc_contig_*(). As a side effect, we now also support __GFP_SKIP_ZERO and__GFP_ZEROTAGS; but we'll keep the more special stuff (KASAN, NOLOCKDEP) disabled for now. It's worth noting that with __GFP_ZERO, we might unnecessarily zero pages when we have to release part of our range using free_contig_range() again. This can be optimized in the future, if ever required; the caller we'll be converting (powernv/memtrace) next won't trigger this. Signed-off-by: David Hildenbrand --- mm/page_alloc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 54594cc4f650..71d70bc0ad79 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6364,7 +6364,7 @@ static int __alloc_contig_migrate_range(struct compact_control *cc, return (ret < 0) ? ret : 0; } -static void split_free_pages(struct list_head *list) +static void split_free_pages(struct list_head *list, gfp_t gfp_mask) { int order; @@ -6375,7 +6375,7 @@ static void split_free_pages(struct list_head *list) list_for_each_entry_safe(page, next, &list[order], lru) { int i; - post_alloc_hook(page, order, __GFP_MOVABLE); + post_alloc_hook(page, order, gfp_mask); set_page_refcounted(page); if (!order) continue; @@ -6393,7 +6393,8 @@ static void split_free_pages(struct list_head *list) static int __alloc_contig_verify_gfp_mask(gfp_t gfp_mask, gfp_t *gfp_cc_mask) { const gfp_t reclaim_mask = __GFP_IO | __GFP_FS | __GFP_RECLAIM; - const gfp_t action_mask = __GFP_COMP | __GFP_RETRY_MAYFAIL | __GFP_NOWARN; + const gfp_t action_mask = __GFP_COMP | __GFP_RETRY_MAYFAIL | __GFP_NOWARN | + __GFP_ZERO | __GFP_ZEROTAGS | __GFP_SKIP_ZERO; const gfp_t cc_action_mask = __GFP_RETRY_MAYFAIL | __GFP_NOWARN; /* @@ -6541,7 +6542,7 @@ int alloc_contig_range_noprof(unsigned long start, unsigned long end, } if (!(gfp_mask & __GFP_COMP)) { - split_free_pages(cc.freepages); + split_free_pages(cc.freepages, gfp_mask); /* Free head and tail (if any) */ if (start != outer_start) From patchwork Tue Dec 3 08:37:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13895602 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 13FCEE7716D for ; Thu, 5 Dec 2024 15:35:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1B9AF6B0124; Thu, 5 Dec 2024 10:19:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AAFC66B0135; Thu, 5 Dec 2024 10:19:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7C6926B0100; Thu, 5 Dec 2024 10:19:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id D0BB96B007B for ; Tue, 3 Dec 2024 03:38:42 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 96762C07B5 for ; Tue, 3 Dec 2024 08:38:42 +0000 (UTC) X-FDA: 82852995960.17.8B526CB Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf17.hostedemail.com (Postfix) with ESMTP id 165D140009 for ; Tue, 3 Dec 2024 08:38:30 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=XCQjTvqk; spf=pass (imf17.hostedemail.com: domain of david@redhat.com designates 170.10.129.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=1733215107; 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:in-reply-to:references:references:dkim-signature; bh=xX/Q3/3Rp0ILyMXyKGOcZrJDDur/TZdwfSuBal5fAnM=; b=F2Q1rlmay1UOIOICp6htnT+VXFJImtwZ9LwGEmJwC8BMFeRzUc+LDQIU5vb91/4YqbJ6kU gJ21u/ovqHHqL1R8EhO67ZGbxvQhBpA33U/dz5Yo77Zw9U0ILzm20b5yR+Q9MnQI2GvlNb 3+aqGPPLu7Jv4UL6Lltcm2FOtCpNElY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733215107; a=rsa-sha256; cv=none; b=HVTAVU6MddDsXoYkOT3TQOUQeYWunSpob7ArKIgmbxVeUQhb+U5NvMWgR/4JdqmevX4R3H +ebld55pgxsWa2VDEfKY+aehVf29V3niVf9dqrvKqZHExi/EZWb5DLjdizdDN8BbAI1rKZ 1mQbjIpW+Q1ORrDmvwKzmM5gOPSaHDw= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=XCQjTvqk; spf=pass (imf17.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733215120; 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: in-reply-to:in-reply-to:references:references; bh=xX/Q3/3Rp0ILyMXyKGOcZrJDDur/TZdwfSuBal5fAnM=; b=XCQjTvqkD9a3X3Ru7yAQnczRkY6ogGvmnWa+O/WnbWQtEtBefziQuOIGrwvCSi7YykxY/e gN9S+iSwPY/1sN6vntpHyktdeeLaLZEZhnpgsFNY9Jjv41sdnmL3WZMPnoonzCaCM7Sqns hHrAOqyxeV5PKjK5c5q/tIcxgOrwRd4= 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-519-KIBg8WfaPjq4ggDyQfJJqQ-1; Tue, 03 Dec 2024 03:38:35 -0500 X-MC-Unique: KIBg8WfaPjq4ggDyQfJJqQ-1 X-Mimecast-MFC-AGG-ID: KIBg8WfaPjq4ggDyQfJJqQ Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 1B9DE1956058; Tue, 3 Dec 2024 08:38:34 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.22.88.109]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D4C0930001A0; Tue, 3 Dec 2024 08:38:29 +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 v2 6/6] powernv/memtrace: use __GFP_ZERO with alloc_contig_pages() Date: Tue, 3 Dec 2024 09:37:56 +0100 Message-ID: <20241203083756.112975-7-david@redhat.com> In-Reply-To: <20241203083756.112975-1-david@redhat.com> References: <20241203083756.112975-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Rspamd-Queue-Id: 165D140009 X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: 8rqahms5xnnnn9mmbz7nep7869zi4uxq X-HE-Tag: 1733215110-125372 X-HE-Meta: U2FsdGVkX19+SxiILKc94b9DQlCLo/0HryOjVN3dS3BeObZMmUXkYikF2D1093L11eXX03p5L/g2gaHJrwEsY2R2CyjQOxrfVZrRtIY6mQfciSxf9LpI+tHDLCyIbe/j/mr8xDMVHEXRl6MENWr4Ywxeao6yzkm1vzxEq0C0L+L4Tkt+6lBbaAhhEqGoGRJejZCPtjEN5JpYWBJ2XVVzv7djCNUQ4ANt3EUNiQ48lDPnUOOQ5i2RsrcSrGqk9crr9k6+KxqJvM3lvlwZ8CKxX1jCCTp19h6RHmovbFXchpM7f1OSmJiIDbyiC34s39qu9FngrvCrZhO12JTKw4AwmD6vsdXz3BRhK9dVnVGHoYqi8GP8NBPGTmgB1fp84eQ+ffpNDHyoMhQtuOhActmrRXDvwFo+KgTFIBQNxngNVpPaFOhaUV0v8My2dVrpZ1blPiSDAn24jD39JZq98mTcYuhnDi+6oHcIi05v604pkGh1CxBaPYEipjkBLCIv2QAx6z1PLEvms8xUCzMk2DjpmFFuR1h07HTfQEs0sMyqM7bAQSe3/hmoh+/jamLqFleQSXT3uWHySNo1o6ZGMWm1YY2CPGiZD/evVsHSTFV6ZyEaEBMtPBKu/95BNWXCJyEdlW3yS/uw+ZQ7Ws8XOKi8engnZ+3cR6p096NEbjK4yBHpHNbNKzFa9tXcjB9aQ/GhLnQubESadvjTB3LJEtGi61gWxzkf9J6wPvT732LWQBVjVHY4YVmTGbEdfYU6f7FhQ5IeZgmnleYNC+ercYorHf0tSIcpDyjjTMtVpgtp2DfyXvV+3VNZGra0XxJP2/alHXddad5jrHb9NaDkrMFR0YfWI5l1mRyfQMrUY1SfH/RYe38vJsLMw5TwCiJxt2xPtgu9rdcww/Sqzm2FkvO0dmxtKU42fbRfYLOM48a8nwFHw74h4JEWSj5NW5RzKIt58yOU9kzyVg+Q6FiiGC7 Sa/8efER duY36c/ZL/FqEj+45+hlCSmojbo+axd2tS/WBp7+MR9PJVCzZ6rVFlbzKIP+k96zeDrC9qIoEkrzIIVfT9BO9JqKINpMrQtcEeP/Zt0Gl0/I2hBL9se4QXzQPdA/pEegXHJfbjKMkvOcTWM6bliOxb3Lfcdffh1PIYcvTP9AxBO2REUUudZROI4cR7uj4AJS77dTUAc3GNfWs7aIvT8+9rhYpwdfp0JeTezDhT5ruWbcJTp8lHDp+ABTy7rrhGBH2uUjT/n52jqvSU3UGJhNsdXyvrTic1e8j0h426WjJ90104du6+hpo9+zBBk+XcBYGhQtXyxR7B0owX30WG1u/d5DOq33dTxg21uPygZOe+qXiie0AQOd+Adl0il9pFAu44WVfi5apd7/C40kukkNRAStmfA== 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: alloc_contig_pages()->alloc_contig_range() now supports __GFP_ZERO, so let's use that instead to resolve our TODO. Signed-off-by: David Hildenbrand --- arch/powerpc/platforms/powernv/memtrace.c | 31 +++++------------------ 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/arch/powerpc/platforms/powernv/memtrace.c b/arch/powerpc/platforms/powernv/memtrace.c index 877720c64515..4ac9808e55a4 100644 --- a/arch/powerpc/platforms/powernv/memtrace.c +++ b/arch/powerpc/platforms/powernv/memtrace.c @@ -88,26 +88,6 @@ static void flush_dcache_range_chunked(unsigned long start, unsigned long stop, } } -static void memtrace_clear_range(unsigned long start_pfn, - unsigned long nr_pages) -{ - unsigned long pfn; - - /* As HIGHMEM does not apply, use clear_page() directly. */ - for (pfn = start_pfn; pfn < start_pfn + nr_pages; pfn++) { - if (IS_ALIGNED(pfn, PAGES_PER_SECTION)) - cond_resched(); - clear_page(__va(PFN_PHYS(pfn))); - } - /* - * Before we go ahead and use this range as cache inhibited range - * flush the cache. - */ - flush_dcache_range_chunked((unsigned long)pfn_to_kaddr(start_pfn), - (unsigned long)pfn_to_kaddr(start_pfn + nr_pages), - FLUSH_CHUNK_SIZE); -} - static u64 memtrace_alloc_node(u32 nid, u64 size) { const unsigned long nr_pages = PHYS_PFN(size); @@ -119,17 +99,18 @@ static u64 memtrace_alloc_node(u32 nid, u64 size) * by alloc_contig_pages(). */ page = alloc_contig_pages(nr_pages, GFP_KERNEL | __GFP_THISNODE | - __GFP_NOWARN, nid, NULL); + __GFP_NOWARN | __GFP_ZERO, nid, NULL); if (!page) return 0; start_pfn = page_to_pfn(page); /* - * Clear the range while we still have a linear mapping. - * - * TODO: use __GFP_ZERO with alloc_contig_pages() once supported. + * Before we go ahead and use this range as cache inhibited range + * flush the cache. */ - memtrace_clear_range(start_pfn, nr_pages); + flush_dcache_range_chunked((unsigned long)pfn_to_kaddr(start_pfn), + (unsigned long)pfn_to_kaddr(start_pfn + nr_pages), + FLUSH_CHUNK_SIZE); /* * Set pages PageOffline(), to indicate that nobody (e.g., hibernation,