From patchwork Mon Dec 2 12:58:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13895583 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 D5BE9E77170 for ; Thu, 5 Dec 2024 15:32:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 538A86B0127; Thu, 5 Dec 2024 10:19:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D45376B013A; 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 249986B00F3; 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 4194B6B0082 for ; Mon, 2 Dec 2024 07:58:33 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id E6AD31C8346 for ; Mon, 2 Dec 2024 12:58:32 +0000 (UTC) X-FDA: 82850022318.19.A55536A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf04.hostedemail.com (Postfix) with ESMTP id F184E40012 for ; Mon, 2 Dec 2024 12:58:17 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=GZYZ7OU5; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf04.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=1733144300; a=rsa-sha256; cv=none; b=7jgg7Cn6ouN8TGXt7+XXf5ZHQ7d4QWL5+BaxAzsa2Od5sq/2ECqLMt1g3PM00gHdLOPDtg ydQv0c6yj7rMi2tegwuhZl/tbcJ+01PKoNlXpR3Su0hsDVrjC0xx48YYSCckOQseTp2nUf a9yid1AeaejTVB85VaczVafZ53XeBB4= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=GZYZ7OU5; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf04.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=1733144300; 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=KtMsmFE9pgvd9dqP+bKnl486+ttvAdvq1JTdJU/oyis=; b=3NNzqes5ZEkWBxxYcOdIaGbXScybLVpxT8Kg/cYbBiJyIoRTsaqJXukhRszcKZ9otBHiC/ 5TU0rg8HuTUi6VPSZxtLabgW5gOipZfwSYUlzA7hfMT/McjB1qUBZrUIYpeuyjP8YEyS7H oFnQkAcLjYAazaV3kdcY0v+A6Y2CBrQ= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733144310; 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=KtMsmFE9pgvd9dqP+bKnl486+ttvAdvq1JTdJU/oyis=; b=GZYZ7OU5XdNUaz/ZJPCWQ3tbukmUGZtK3B4NaNP4KoWE77UcFNNPwOD2k3aDKBiK7TmfDp chqNjf1md2LjuXoNRdsSKVai5oXlbQdF9x9/pKfHgQolWP7E9xruNApuYDDS5KFOeY3aL4 vm/spPiI/oW3J1CIDng70LIkVsSPBj0= 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-215-W0vdIfGOP66mWzIFy1nl9w-1; Mon, 02 Dec 2024 07:58:27 -0500 X-MC-Unique: W0vdIfGOP66mWzIFy1nl9w-1 X-Mimecast-MFC-AGG-ID: W0vdIfGOP66mWzIFy1nl9w 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 32501195FCDD; Mon, 2 Dec 2024 12:58:24 +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 BF7E1195605A; Mon, 2 Dec 2024 12:58: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 v1 1/6] mm/page_isolation: don't pass gfp flags to isolate_single_pageblock() Date: Mon, 2 Dec 2024 13:58:07 +0100 Message-ID: <20241202125812.561028-2-david@redhat.com> In-Reply-To: <20241202125812.561028-1-david@redhat.com> References: <20241202125812.561028-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Stat-Signature: 9isw5tigbg5mmzprczycwtjzjm598egt X-Rspam-User: X-Rspamd-Queue-Id: F184E40012 X-Rspamd-Server: rspam08 X-HE-Tag: 1733144297-914958 X-HE-Meta: U2FsdGVkX1+xd5Nv2yrna9WUajDlCV0ASf20nzCInSvIr0NKa7jArHZeA9hsickXt59bAC9G/r+xYI9VPnZi5P/Lx+JwL7oadbomuO1GJxjbtiAFY0W+5fvW8NdGmaXRhu/B01FSBim2ThOGhDRVr+fRIBgdgm2vcNTjD7KPaoMOdzAzgNQZCxd1rj8bB7igqZRPx4GM0DfrHZuHTrRp8N8mPi8I1vcJ6TKxoiqzZYiCSYjLzIFRt5e9ATcyMQazK51NuaQaLMNnHwDNKtpt82dfS/uhLphGtEMXIkgTTDzrEls9rCLe++SMBhgsuE9twqQnmCvh2+ya8Tv/s0M+Y2vVjQP0JAnqob/WPhsQcoNyNcm5FM2fAMUoA3ujSepGp502aeJozBSFI4VXqJvW/j8g90yUY2IRxRykICvZ9K/BH3klzOI4L7EPcZ2+LgM71av4UC0LHgdfBRdXP+PWMP8z+GC9rDUzoBfkgcQSUijZHsDB8RDbjhc4CwxTGvOpckLudb2mwxHcp/57MKkmTn7Y996rE/Jh1PLaCXPNBWrvW3fxfmcmvTstr8gMz9DjwJnwDFqsgTUDmPgd1yHUx4ha6xMNKEr5slydPF6WEhP6uXVZVjL56/vlw5huMPjpXXFKWm5oLxjkT1AJAPKVm1zIUfdA53C1BBngxJTGxWVdCxFooSiCrf25/cb3rXYcqwctmvvFtohhwOTH4tCNDgOaUcUgOy8uUeJbGkXJVpNF6CaHxIDyDMRJ44PHMi1EXZd8kinnyni1HrZhn+FUqmN4tR3y6yhW6G95xL/3yQcY/yj7/vk8sCzKqMWnSMP+/Ys0TIPBNe8QUk/V3C9oyolISp73ySljZgEcE25qFavXFhV/MkQXEaE2qJuVA3l5bJT8c5S8BOB/H6D9AI5Su4TjvX9lcs0D9bZlwXcIqbTYwoNf5UXgixCnKdJ8z9CmwNqqGbpR/F90IKO8I+R PgJrEdfk XmkbDC+GwzqGCYVCmns0tr6stpyS01ZW24gp9ET/uVq1aih1s7n8L+RLetvnFNd1Nyl3SORystjbI6K1BFHSKb8iqDxdMw8cPJPVFsrZo91Gb9cB6DXU7Xh9o+8OW2UBVdbyvvQZELYDh4rPTUdfALYZDp9X2YRTPAPeQiRPUReAxRKhECs0D+Txju6fnTQGiJWHdcWZCqAlT0UxaZWE1Y8GROqBLZAe6nee8Fj7jR1oiCwBjh39jt+TNcLBE5G50WX2uMs+7whw3VwkxfPCrHVxnZoFGIxBBQPhv/UIC0jkkLlHG4zBtpTWxEYj/3EE7k5w4EaKiSJ/BBEemsnVfdvgo+KXUn/X3zOHnWu6LJ8q3oJp6H9hZbbc8GgQOoEpHwk0KVDQ1M4GkXTbIoV8ricgQNw== 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(). 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 Mon Dec 2 12:58:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13895592 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 0CF9CE7716C for ; Thu, 5 Dec 2024 15:34:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7F5C46B00F2; Thu, 5 Dec 2024 10:19:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D21B06B0115; Thu, 5 Dec 2024 10:19:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 88A936B0129; 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 DC2176B0082 for ; Mon, 2 Dec 2024 07:58:36 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 873A41A1AAC for ; Mon, 2 Dec 2024 12:58:36 +0000 (UTC) X-FDA: 82850022570.06.E58D6B7 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf10.hostedemail.com (Postfix) with ESMTP id 87EF6C0011 for ; Mon, 2 Dec 2024 12:58:29 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=dU9OuixG; spf=pass (imf10.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=1733144302; 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=PXUMaNNR7Vq6MIOYC8hJbP2dJElyfdgC2J/3Ji8PmA0=; b=OmpNy4EHU4pwxL8Q9Z7PnOYXKGwm+FmK2HSw8QC2aSp5Oo9qUmuZpoR6SmkSFf6LQEcnu4 apRN7bx1nMSc/kryotLN+P8XjSce2K7LARnR0RFnWoYyK9oWJH6ONGqsuN+z9yJQQAoMn4 nkHZ+BJ5jTa6IbdyAUMB0FRqJ5ElcUY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733144302; a=rsa-sha256; cv=none; b=iOS+WRI5SBZX31aUgnG2xI+3TuKQoNAdiPBPo0pxZBTs/rjW/QngnjO22I721giri3BmGs eEwsYxOLUw4Ifp7dVrI4uBFJwL++8RS2L9PF7dbY+Etzyw+TGzr/n6iCdsIrjhjtI3IFkR vrR5j651MmxezDYsF7A1XpWaI9UIEJA= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=dU9OuixG; spf=pass (imf10.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=1733144314; 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=PXUMaNNR7Vq6MIOYC8hJbP2dJElyfdgC2J/3Ji8PmA0=; b=dU9OuixGlD079rWwehHIc7PpNzYNwsxe+Fi/kQAAjiigTJ1qp7hq5yg4xlrmurqs/5vUll RZf+tbkWtjGcSF4FgvZKwdXypui31dU5MvX/n7l7qUG1WjyBQUsK98ppgbb183H39XnHZ7 smnj/PgI8o0YsrkXL742piT2rky3Y/A= 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-628-OSMYzBRLMp-I564LqkqeBg-1; Mon, 02 Dec 2024 07:58:32 -0500 X-MC-Unique: OSMYzBRLMp-I564LqkqeBg-1 X-Mimecast-MFC-AGG-ID: OSMYzBRLMp-I564LqkqeBg 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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E680A18DA5D1; Mon, 2 Dec 2024 12:58:29 +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 C1BDE195605A; Mon, 2 Dec 2024 12:58: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 v1 2/6] mm/page_isolation: don't pass gfp flags to start_isolate_page_range() Date: Mon, 2 Dec 2024 13:58:08 +0100 Message-ID: <20241202125812.561028-3-david@redhat.com> In-Reply-To: <20241202125812.561028-1-david@redhat.com> References: <20241202125812.561028-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Rspamd-Queue-Id: 87EF6C0011 X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: qc3mwzdx5mo8xq95rgxk9yj7oi1gye4s X-HE-Tag: 1733144309-929432 X-HE-Meta: U2FsdGVkX1+4WqYQQJkQI44eq1e+BkzoTZOIRG6/CJoTu/7BqP+2oL2nPyTkU7nNR+2+BAgfQ5eSj+NLL780JXltkRt+/QuLtTc1pMzd0kd1wITxJpfomA3gLzqxp7ZDTyy7TCd52QHZZw/xxLz8YIqevj1bgWPz+d+TH8UuZiosKesARt+Xn3y6cgZClqYDCJxtvmsyEfDEQJMburu4DVCvSyvXTAGRlXcjOf6S+IushghBuh2jOgBEaHSnrAMm/fXNAnOzsG7MMYMkURXqE9vKZoBU9lEpZPOBvKpzb3XJWnLHIeuzCW8oEKbNptcgwceGeVjweBqL+j5LW8BmjIYvuq0DQuhoHA6K/d126sWpZkIVcEnrYOpReKBoyLrLhNJEUwdCKCyr7pAmoIUidb9i70ThH3xqhQgYiiT91oFscENEhIdNQAL/Toa3+VzaYKuYPiRTQQcUBbKBsiU2XNJS7CoFMTp1cYADrjk5lZRiQiuZ7dYtMhjMCGpGtCHJdqcablchxA2VRLpXYIo2zJBpVexsFn8W2bb5ldOwnKYAWy4gcrbHgBxEQEZxNRBw5VJho9zCz3sKyTUmNdhmHGhzqexix4nb1CaOfdg7HKBcCr914WVxv2UEDlz3NgqeFGsYq12vXzz30DVx3iTae9VyjpW5dczNC3UtftXu7H8K2dfrsukjajl/9H63T2fvovoRWm+ar0XWGhhQ++77zaYOkR28XKmDwb6RM5ftHOLIdnIogtUHNgZ5utULy+iivny9QEB67QW86Vd4gmJ+7AdTsjVE1JRSIn+P+s4LxJFnq/0H7jZzK/kEMBwX8vDrXdsRWjv0PHoLxNLfsUzuUCi+1Voi0bVwjlFY/NPSKTDJGTU34V1FNS31tdN8IbZzqoRdKjw/Xqf/XOFvwKpmA45k3J07tU1HkwyIxmnPLlVUsxZCgrl7HnEo1xvCcFLZo0jUtngCuFA6lnQwlu2 h7qooeTG bD/sKIpiXKC29x6pW0j2Q0nG2TNXyT33No5NM1LL4SmSOuOJD/JxK6Gj2zdMjdxN/lptFiF+7t5YGlQ5mthXRgnEH4mAzzN+iDsvWJTRtGBVejlOtRkcH/opyuf2/DDTcoQyLTn1DXET3jPw2Bl2f4RflYamT95tn45diXhI/F+vxNDKWk85P2L2pxjwDf+j59xkiAU5qxstxT7pShSkcXBWuVElADFvp0bb08coOL22o8g0SepM5rhmu4CXRRBaB7dyewhJIPbAPjIquHAZkFtxk+i5VBizcZ5kfQwD/TAfYFLfgKL2Q1eYn+cwAxY6JKAGvGVN75oGuwisaMDSCq78lzjuNUCk2RI8dD+OPe0vSs3jpuQbQ1IIAqPfytyU3ctxApFsJC78x4g8KmPEM5+6HxQ== 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. 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 Mon Dec 2 12:58:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13895597 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 5A5E0E7716C for ; Thu, 5 Dec 2024 15:35:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6BA6B6B0143; Thu, 5 Dec 2024 10:19:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D6DC06B00F5; 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 99AC36B00CB; 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 4B9906B0082 for ; Mon, 2 Dec 2024 07:58:41 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id DED051C558E for ; Mon, 2 Dec 2024 12:58:40 +0000 (UTC) X-FDA: 82850022822.23.EF19BF9 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf20.hostedemail.com (Postfix) with ESMTP id 17A1C1C0009 for ; Mon, 2 Dec 2024 12:58:25 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=eW62dd4H; spf=pass (imf20.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=1733144311; 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=JUyVMeCRN6dieaM+cMlV+AJS5EnHgADa23V603hh+n4=; b=2hmrk8LyG6eTVinbXg5nhvCYvbhwazKY74zFJpBkW0k6cYPIOyt8pxKa7hh/8ltJ6q4vGM 2m33EcePkbb0ZlXkcRTck4paKFNZWqngR2FJhGZOueO/h7z5+y2a6eaB1k7UWQrtuRwZoT SdFk2leqfugJ11hXu6OaYjLdelqeMyQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733144311; a=rsa-sha256; cv=none; b=vKx5WX+wP6+47t9zGE8HKvIUZmrqHjTkoeza/zTCzJtNCr98v37N4+a6akng3IDfAS0uUh aF8NL3PwF/gW/JT1jxIM7q0VS9Y79zxvAt74oFT+NPpqUJqXb6mFfeb8TBR6aUlEYl519V u0ko4+V9/g++5brvKnFaeICKRtiq+AU= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=eW62dd4H; spf=pass (imf20.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=1733144318; 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=JUyVMeCRN6dieaM+cMlV+AJS5EnHgADa23V603hh+n4=; b=eW62dd4HsP1xxadHeTCnRjjjCXxPgsRKk28Q9FqUd07Ao4QfzDFqslhGwuq7aQr5QW52QC A07I25f9Y3n39xFEywaMZaKwQr27fk5RJY4E4Ub2CFzaFKw5HaMOSkdnYmUV0JrcHEXFkZ ZxLtUqNPqtO3UrH+mJtRuHMDseUaevc= 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-223-IvBmzQ_7PqKMDv2FdB_o2Q-1; Mon, 02 Dec 2024 07:58:37 -0500 X-MC-Unique: IvBmzQ_7PqKMDv2FdB_o2Q-1 X-Mimecast-MFC-AGG-ID: IvBmzQ_7PqKMDv2FdB_o2Q 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 2E6DB1954229; Mon, 2 Dec 2024 12:58:35 +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 82C4E1955EA7; Mon, 2 Dec 2024 12:58:30 +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 3/6] mm/page_alloc: make __alloc_contig_migrate_range() static Date: Mon, 2 Dec 2024 13:58:09 +0100 Message-ID: <20241202125812.561028-4-david@redhat.com> In-Reply-To: <20241202125812.561028-1-david@redhat.com> References: <20241202125812.561028-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 17A1C1C0009 X-Stat-Signature: w7tthz8bo75uzhkdzm65mjr8g15id8t4 X-Rspam-User: X-HE-Tag: 1733144305-860527 X-HE-Meta: U2FsdGVkX18lECxj6qFp9UilaA/X6C7JrfYmttDxcAGMCdnGzcsu1Ea1P7e5XLogChwwO1/2GxGjmp15fx8vwykLG7uXFHviL58Q+5IlMni24hIz4+zTC1wAByV940f24XCE9JIBD3R0Zi67atJqFPbUzVSCUfk20RaelB3fG2uzmvVqEFb+6vxufkQI6CuGvfMaB2ko6xt59gi1YIVmbVxY7AP53Aj90clZI6yyryIv/hFfC6TmaJNjOEqedY5LI46tHPErsPTcjICeRHPcNs4ZFq48rkA42QKLWpB7El7qWpUtSKPA1TNzcpVvSkLXB6dNDJ4i/tOEMytG6YNu2l8zCuGjjy4SjnGnm0JyLmbxOEevLmYo0pwsdREm9sYyZwZvCmq9ZTbKe4O5S8bExTR2pQR6rnaVxVZf+qfQToQtdZNSqQh+a5QnYT2YhxesyJjsrjavVyVi0g6x5X4jKBrMNY3YP+gNjxQL5VzCLafUKCN/eDs6XTGcXgm2vQoEeW2h/nVm06VIwfTsQrJeUoGlPRwiUI+8Xwb6wdZgXEKPV+q61qpf2nqnFJIzQTslKUJcfuanT4SD/DyT0RTIvGpz20El2/uv4DmgVyUX4eToF2x2lYqPeX+FsUyNm8m/eOEZ2i4sZHtSyqrBN3VXaxXzIDi+gSvHMYHhYUQhiJ82SZBoBGrOw9RUFB4IjX3ZfTwruCIy4AWw4s2LjLEiC2CzVYQQROXe/1PAj3Rjh4Mr7dBCT43LjzJ7ccb0wmRzg7ITLZOEcZc8V5jin8wI6SDubFYgq6N7o3l8bIdDVKkfZ+peh3xJpPgd8sDZK9haKyLkMYDrZ/Ist5GwO21s4HHa4IFoHmBqRGgeDpCZocb5DJxjXWvdqvhyGXoPJYAKs18nLg6H6uii9BVhW+DwKJ68bGlY6GEvGmOYmJWuuunFE+iGGeAuCz3Lh6b7VutMT+XX49J0iYx9eLKxBZ/ CTy6sRYl DvP/gYEB7pel2P0zoSmxEm7afB21pQgmK7M6xY9aO8C+uxyRNhyLoufFTprRFD+kEi3u4U+3HfQz5si9oqkxCvBkIppqkxXlX8g+Y4fB+j/fqkvBixbkMuYOQvmHIKTEuHUbisRy7SRk5z/Am5h9gmwCKHbkNFB6CcO+cLNixftNG2qaDXUGR7Ww2xRho8+T6thYU854LgpgKTyLWO/0mVmhfxgr1RD3vdWRRGZaNEqw0A/oODX5fgzIzKebH7t2al763tYgchc+dGj0tkbA+7OHldZFMpn25SrofVaOLUbwrusDGwOG545UhJbXyxQaQ86rdg++kzagRbsadwUhew8he5/QeTbeMqyuwBrzhI94bFFOYy+ZtFTAr/gq/k0PY4yFIoEhYSjWgEdvIFwwKAxqWvA== 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. 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 0d17095c2dee..5656089eea7c 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 Mon Dec 2 12:58:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13895603 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 28D8BE7716C for ; Thu, 5 Dec 2024 15:36:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 572326B0100; Thu, 5 Dec 2024 10:19:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 09C436B0139; 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 8B07F6B00BF; 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 484E16B0082 for ; Mon, 2 Dec 2024 07:58:46 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id C12A981BA3 for ; Mon, 2 Dec 2024 12:58:45 +0000 (UTC) X-FDA: 82850023032.30.F2FA29A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf01.hostedemail.com (Postfix) with ESMTP id EED9C4000E for ; Mon, 2 Dec 2024 12:58:34 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=QL75V15f; spf=pass (imf01.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=1733144315; 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=BDcVjfuXZieBJ7OFGqsXEKMWupL5rjT8Tdv/3NGIh+8=; b=VhGmE6lEMr4XQjXpx4xnJKLQD2QVVwjwcN3OWQclkmL/waDr71xF8FZRCmWnrtzA6swNym O2fQWG2kljzYZ/65ta52mXG92CBZJ0RRXQLyDN95mnOpE0C7qa/iaF9j0yfdsUxBeQaQ4f NPMGFOp+8Sgniq3GfhChkn00Cp4lciI= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=QL75V15f; spf=pass (imf01.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733144315; a=rsa-sha256; cv=none; b=u+CH2NnL4W8HQjol/YA+3xSlCDEXHMMVB/k5MdKkX7EnBgcrDZuQuaXxWjCEvmM5EzHUYu dtJIi76Eq0Diu40JBXeHC8s3+HF1CmlepFjD+Urx7ya0ZlVOOsPkWbcBfbmN6zB61YfBrY cepntCff6xM+xePBsVS6U3VsC2wI8qY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733144323; 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=BDcVjfuXZieBJ7OFGqsXEKMWupL5rjT8Tdv/3NGIh+8=; b=QL75V15fTW3YIyGg6j2gOEGNAd7TtMkXzVhGzrGBKcm/NqDmlYQ2x6lm4O7bAMkIY4cVnU kmEdcL6bplzhAWsra2V6Zq8NpCUWfpIAT3mrSL6wzifS3q0lLtrQYyS9Gt9QLwpbw562nU F0e+z9G4AiRhUgOhvF9DG9gvEDEr3TY= 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-609-guoW4AixOXSxWRl1bTT8Hg-1; Mon, 02 Dec 2024 07:58:42 -0500 X-MC-Unique: guoW4AixOXSxWRl1bTT8Hg-1 X-Mimecast-MFC-AGG-ID: guoW4AixOXSxWRl1bTT8Hg 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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 63C71192538B; Mon, 2 Dec 2024 12:58:40 +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 D1A9E1955E98; Mon, 2 Dec 2024 12:58:35 +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 4/6] mm/page_alloc: sort out the alloc_contig_range() gfp flags mess Date: Mon, 2 Dec 2024 13:58:10 +0100 Message-ID: <20241202125812.561028-5-david@redhat.com> In-Reply-To: <20241202125812.561028-1-david@redhat.com> References: <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: wm4kdakinbssgw9wyxhsfbeccwjaomcd X-Rspamd-Queue-Id: EED9C4000E X-Rspam-User: X-HE-Tag: 1733144314-612058 X-HE-Meta: U2FsdGVkX1/u5JC0kuNYIHnWAw5ytgDZQF8014I3mLATaAFsJoSy11YSMy6IpRr/8gIdrcH7AB4YUvVOpVyaI5gCbB87I8d05QprAMjwSbNouj7mINZcITq0mqzLUUjcKv68GOIqU831wyhgf5Hu0vOrsw1T/7KLIP4IvtaGqKy4DG0cx2EwnjXp/1jjt5Z7uUE4K8ZOATsHgjc3JyYIJF8oFzwuwbFlF1kUutZRuEWP0hJko03w+9iUuG0sp7/G9Vh5RiV+MOP7LqSbtX3d5SzKB62OuT1+Ci0cj8U0nF8i6RwUT8cgNBzDvwyPiMLsMQrOqklXYa9wyZwqmCotHl3gghD5o3DMqSnoEz1aZzZbi+RzcGyNO6bqBhddV6O+Y+qPMTEAqd/0AGY1KY1w3FfIcqH+y0Bx1zBKjkFby93HQnsy8nvmI16716yOgrlxJMpZnUuOfGAINhfaj9JqlmyMAbKh8PGqo6QjN/wILBbIZR8Ag5ULS0v3bRwkinV9Ck2v/ynWdwf+H1x1uRnTwG6XVt2tahOUzuq3UdK46IR4EULK0Y8/yLSZuChx34qVQF9JTyWMDFRMY5MBpxTfgVghmyhbGLhprZL3UUIeSh6TgZQ9flwUm7AgnIwdyM7S0rMfm3F8Mn63LL2OQv7odb2l1yHAFBf6MjeOUgOgW9kvb8SXgEDqne0/Ry5MOHbDnR38yVO+9nhmA1pg9X5vAEWj1AJyNNXZ0F70W3rn2pany32Ra1W+xl71fKbtfGMcqLDlyLsak78TMo/9/VIz0sZXJEK/DSU2eXuEvpduO+unu7v9wMKm/HhzvgochaDqGt82HTsGvflvFQniQLpjO/EXx7iFr1q2EHjg60qLCntw/BGqpuZciDlkgW2YqjYQ5jnwPyHO89KXb3MHNIo0SVhq0j7AcRfAxzkgKWF7iDnfVgJn0nuXjn68CzaDsvQFikE43j1X49A11h9LoHW EdHY7Edt T9Uc3nJu13qo0pNMK5SuSsLn1skTQutWNisw9EQkUMzI7wwigwicbT/fZhE51l9jQpV9x0xzHfBUeNw8UViLU49QkfVGvvVtiDft6T97lzW290i5G1JXFeFJzCAQbM24DmsuF5c+Ienf9EOjuU5tM3XqprUllPd3TllX0Nl3oXIQI+boQaubKF4fhFxpi1djwgWcKnY0VwZIfQ0Vfe8jhlWNOXfzjOlDxycsLembepjL1AbFs37WOjMpZMHSYi+jcRgdN7xleUgvc7N0mqW0Z23Ja1pwx29dPoRSFumKdWqMlUTvKpR+v/WSgCoZh9U2+WO0VevYoETzPU13qLUIcU7S/iq0er8Z3OvWLt/nT4AttJkzU2tjzOdQ15ma8ClXdz4pnPpIqN8t8CYIG7+6syCeSFw== 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(). 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 Mon Dec 2 12:58:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13895600 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 A7609E7716D for ; Thu, 5 Dec 2024 15:35:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BA0A36B0137; Thu, 5 Dec 2024 10:19:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4E15E6B0104; 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 E57096B00F6; 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 083086B0082 for ; Mon, 2 Dec 2024 07:58:56 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id BF8F481C0A for ; Mon, 2 Dec 2024 12:58:55 +0000 (UTC) X-FDA: 82850023284.03.0553A12 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf23.hostedemail.com (Postfix) with ESMTP id 206DE140022 for ; Mon, 2 Dec 2024 12:58:45 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Qxv5fvlg; spf=pass (imf23.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=1733144328; 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=8HP8ABYEm75mn1BmFryMatwFYZ4LLrOWgOCnAtcF7Tc=; b=2IffUZpNiSVGZ5VF87aLw8wOSaY1qgOXorWoVumFn+SmN1NdP+dCufDOMtMdhC80t298Fh pJ1oPa+/4Lvu91RSEMxNp7nfYPjSFaEudt8o3U1rmz/bqa7nUJwrwX9//pUQlxf/KVtniQ E9y9RVC1jMuKIfvfBCOErht1jk3y0dI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733144328; a=rsa-sha256; cv=none; b=DKHcblfH25ETJtpDKOfiFtZLO4EGUCCGu9A+6cmVhiElNCNXk9nZtsUC0q+VYMKVtPQaqu 8qM9Wva0C3WSoFrEu2hzeo3SLEcvJavrM4RhtuAJNziMZWj/gnBwTHh6p1hvpJHYd/6pKX eTNUUN35G4yGtIaOwC6h03TeUBzJdO8= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Qxv5fvlg; spf=pass (imf23.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=1733144333; 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=8HP8ABYEm75mn1BmFryMatwFYZ4LLrOWgOCnAtcF7Tc=; b=Qxv5fvlgSnHZxRCnhcmBQ1W4Nt5cffErITVKKJAZTiUmziPFJoNK8q9huehXfKdQ9z0+aR VrP9LMIyfMWSYIMG3609GIejWTW7+osCXKuFnsYNTVdH33wLCW4xJHjpASSaQWo/peH56Q 3Y4TJ2Oi4/YpLbH3frBAPDv2jE70B90= Received: from mx-prod-mc-05.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-542-2zDHXoRjPpyrImBN_4zy5g-1; Mon, 02 Dec 2024 07:58:47 -0500 X-MC-Unique: 2zDHXoRjPpyrImBN_4zy5g-1 X-Mimecast-MFC-AGG-ID: 2zDHXoRjPpyrImBN_4zy5g 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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3121D1964CCE; Mon, 2 Dec 2024 12:58:45 +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 EFAD6195605A; Mon, 2 Dec 2024 12:58:40 +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 5/6] mm/page_alloc: forward the gfp flags from alloc_contig_range() to post_alloc_hook() Date: Mon, 2 Dec 2024 13:58:11 +0100 Message-ID: <20241202125812.561028-6-david@redhat.com> In-Reply-To: <20241202125812.561028-1-david@redhat.com> References: <20241202125812.561028-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 206DE140022 X-Stat-Signature: iudk78zczhqfeg376e73s6gbm9h4yhar X-Rspam-User: X-HE-Tag: 1733144325-85901 X-HE-Meta: U2FsdGVkX19UuFZ4ZYRS03zFjlbX0pEyp5qxVUwL9nNWT6h96TgFgecxEsNqMNtw/mtjtw91FMDqGn/JN/2uJdhe9LE13HTSCPiFzG293V/+/X8f/3tR3VJc58Cv21abYx1hh9DcHlK3HZKeX3FK3HOnlT23n6xT7q4Mr3XgS5ho5SIvi6c2Jt7RavixG/ZTteM53PEr/dPvAFxtm77zwAFo0oqBub5Zte54r0qCLPGSkhrPqX61ix6EcDqFxNCuJCHGIwMzugbKNG5ZQCLaWyF0bSR4jGY/bFs680rzZIclzdZsc6axnu/zN9IvfzAY3Vn+O+mt+xs8RgQujv4wlASZQ1BCUKuOh1aAs59rdp3ELOACrUUwrrmhqcH63mswJII2nksXcKQxzpNn3uSHm3K7IXGePwjrEUKaJSH9np/l8EeUsd1YjPiJF6/iLbjJYlsB3OqDxF6NVYv4Bn0XBAdJl9I12WkCgtNzHLkEKAtxq/O9vySon+DYm2lEL/6+YP2oYoBA/6asFALZ7297Od/MDt4BzDqNBRY5j/hQWJZqYskL0D9C9gGs/2JLuUWdh9IUlp+KzFn6VoK6Gn4RS6Ku8Klae+TbqZZEkPACodbiHLiZNuYMq261+2PYEbtnkCLLAxk2JyPX/kL4tow/PpTkT317r9WfG5qxYISeqMQxx9fGZN/mERajZvKbzfXZF4wEWkaXtxK7VF3k5mSuNSd6paJgFctHpE2gSaOUp7Ux8mmdxX07DPOpbI8RUbrnpogi0uDYJaRLw9rFHFXLkPn77JZ8UVLxFyQONcyS2j9fl2ufn31NCEQO5ud9fb8SkgpD3VUIzj4OJwqlGBg/4mK/P7Imeiq/9Sy6LBPtQlsJ46J29zWKAQ31HclA9S9rslj5Xwu2Gn/w+pFugBjs4nHM0mM0LwvsQUjEn16S2uxKkvzQS9SFlJ3pg+LhFu2CEAspLalEBeIZotQtk8G zKZv0LPv CkZKW/W/kf1t3gNgtW0Y7AG/WvVhK8T9NeldhZRnUOAEjyApuButZONi4eTFHTu5DCq6IbRJaCKnD/pFDW7zXiRbpGOX9Rz/zag2MbHnnNJmMKyAWQDU9VgFoAD330xLykQ4OLHbUygs3tE4iVSNHPx3uMdJwi3nLQBLXalGmUlbmdIEAdHSJmgN68nsy0//ji4BJ3+ZcL+pB/o9MS9FZdOEN4oi7chcSPUzfz30Fe5RA0TWtE8m1t0mV8nTtLA71Wsib5jX5bjH1WZlPF14cLchAIoS3Niqhoq9uHOBW+3uiVbg97fJMuLRBdNL1cWzieyGhA3bghlMYuHe9tsRWZU0UP1qSYY687oU+iQ+UNrsa/YuPD4qjXYfigp6Ug30u3vfKgEb7CBGbyRxL5UgMx3HznA== 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_CONT case, we already pass the gfp_flags to prep_new_page()->post_alloc_hook(). However, in the !__GFP_CONT 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 nothing 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 Mon Dec 2 12:58:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13895601 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 8F52CE7716D for ; Thu, 5 Dec 2024 15:35:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D528E6B0104; Thu, 5 Dec 2024 10:19:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6B9D06B012C; 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 509626B0102; 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 8840D6B0082 for ; Mon, 2 Dec 2024 07:58:55 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 478E1121142 for ; Mon, 2 Dec 2024 12:58:55 +0000 (UTC) X-FDA: 82850023704.02.D8AD4D9 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf14.hostedemail.com (Postfix) with ESMTP id 6025F100002 for ; Mon, 2 Dec 2024 12:58:40 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=co35R3SJ; spf=pass (imf14.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=1733144320; 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=6CWzP3eHvJg4qSK4uC9kezYJkwGo2XHWp1F80xLZ2+/H3vQsPT395xxPQHzuHpOh5V3Y0c /oS9ZvFE/EadDY6c8iCEQ39U1u4zu6kNyZVB+iNFKjnRl1laOVqoxIzwwVFVmUCEYFZpno PUcYidt5EoBDuTgufymZpZP4cGBWorI= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=co35R3SJ; spf=pass (imf14.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733144320; a=rsa-sha256; cv=none; b=7/muJ/O4u/wDntwD5W8GDcXkMWzJIJIenQbzV5xQ387QeIwdHiQvWA7/Aa9euCRoqAPMZG HtOVPoHHdJ8uwU3+2G08/MUL7AzWVDQM3KANjdtueq8nBHYDpRqCLyIeWH0C0etAlJD0OE H0oqsgvK/J5ZKRtUkXDOFl5HBmC7ASc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733144332; 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=co35R3SJpz/oRKuujuXLEkLCxtsST7xL7HI4CA+9QkVrpiAqSEymQ7svN997/+TP0CANmR wvMfy2G0ctQNhKQNe+B3xjWFufjsvGkDg0KSt7bq1SbVAFloy92s758simfVCSJCUpLu+W cEMLNWKnAUU6v9BF777zssJ9d10Gmgw= Received: from mx-prod-mc-05.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-611-hwR66AWaPNO_VM0dBSx8pQ-1; Mon, 02 Dec 2024 07:58:51 -0500 X-MC-Unique: hwR66AWaPNO_VM0dBSx8pQ-1 X-Mimecast-MFC-AGG-ID: hwR66AWaPNO_VM0dBSx8pQ 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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9324B1964CDA; Mon, 2 Dec 2024 12:58:49 +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 B055C195605A; Mon, 2 Dec 2024 12:58:45 +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 6/6] powernv/memtrace: use __GFP_ZERO with alloc_contig_pages() Date: Mon, 2 Dec 2024 13:58:12 +0100 Message-ID: <20241202125812.561028-7-david@redhat.com> In-Reply-To: <20241202125812.561028-1-david@redhat.com> References: <20241202125812.561028-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 6025F100002 X-Rspam-User: X-Stat-Signature: 8n4k8gei894dq9nhphn4enpbdmm99j11 X-HE-Tag: 1733144320-564179 X-HE-Meta: U2FsdGVkX180YYMxnrJBsrikNYNr+DcPQFHdIKdcGKpkeob89dtFAYczPfvn01zq6L9+nNEwFnJbLvOUqPj7zOHxB4nxsI4ahf4UhRNxs9c+6vBSZRVVT4zrHK33qUdjuNPAg0+wXU7tUnXUjfnaRy7hTvMTcEuzUOrH16S7gcCVHAUNUOzYMVeAciVg4YtekLz0f4J61J0QvrVb6kDu2vNxssA3N6GxzZ7btt74vsXDE3pbGaY/hHRFmIJPBisbkGPs/tRkpmrtRiBjo6aUVwtaw0S0nTYnbZFvQEFqhChcRO2bKkAjp7DIwUqd+l2vDaDXRrIlZa2zITLIdNey9mH+TZGP0HIDGWgxU2o/xA3m35UtiSbfodbuFhcSwlC29rL1bBR0gp+fscK4x6CivhR7uXbvNpJwBYnKCjL6UXgzDeD9oIbs8MvQfnzGXDdr7y6D7rWW7KqHFWROnVlbO5A4asI7DHw2ywdV/g/34IEMSwK2xKWgq9R6DwQNxVk8WVByuwrxlLwiX/zpFI+1gb4iiIiV1P9fQSZzdD+CUckmYZLPSYQirG/nQcojZtOXBHTgaSVBP2SRXoX1lbeqjViLByhbc4moYxiN0oqe3spSEqTDxvWu6uo1tknJ/YNrHnTaEHYXkK7tRoJOhKQmR7kyYZF2ioa07B1uDJxf3wHICyo6kOe0/j0T/mgsKVtYddkHucENnK97ec9x5wQvy77eVlVbSg7EzE6cM2Xdb486BKHvL4IVvEG3rgyiPonwHwxxzoiGAB3dXjqxf78YQ4YKtNT8Z9wSkgda5SyPLZw9kOvRZZ6tncDMA7a9dyzZjPFyOtxn+syURws/Do087CSx3yKaffadbrrMeTyo4CAYrnuxUUFTti3afKZbiRJXQogQzBcH139uP0A8SlJxyyufqfrId7mS1olM6qwdvGawT15YDtPQE7dmRe6yyY3qkqniRqn0cseU1GacL6Y uFgePOUi e6p21qvWenV5cGjVifalbU/4Lem2hyoRnVmH8LohTfFVdXIOTuuIwCIt3fLAVf608i1c/HSo02QBbtdBN8FMeeiVi1esWjpAUpek650Yp7WXwGbonKhnQgGy/wNMa2yOkfJhM0YSpyideB0fVMDMZW9MPCiiLjp54eVaBtgy1W7vogXceJVxpNJXmAV8RpkvC3y0iBHL28UivOnaIenlpVj01xVh2l/o9eTMzM1V/mfft41cWeIvlDjtRjE5fJVQ/JMimuFsCuSivRL4t6RpXRjocH8JLiZAF/qfDmkmHFB9f7eEtatW8G1zhihD5uT4V8zWPZnKNZX+xC7tj+k9uCHEn8sLV9jn+nxoY/UDBzbLDvmAn/s5W3yfIOqOOls1+jlfdcvpMwcq9Ng4YjpMXNqglGw== 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,