From patchwork Tue Dec 3 09:47:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13892059 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 AF890D7833F for ; Tue, 3 Dec 2024 09:47:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4C8FE6B0083; Tue, 3 Dec 2024 04:47:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 474426B0088; Tue, 3 Dec 2024 04:47:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2ED4F6B0089; Tue, 3 Dec 2024 04:47:45 -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 071446B0083 for ; Tue, 3 Dec 2024 04:47:45 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id B4D281C5478 for ; Tue, 3 Dec 2024 09:47:44 +0000 (UTC) X-FDA: 82853170260.19.61DA640 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf01.hostedemail.com (Postfix) with ESMTP id 9FAC04000E for ; Tue, 3 Dec 2024 09:47:32 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=XUNmqTrs; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf01.hostedemail.com: domain of dhildenb@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhildenb@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733219256; a=rsa-sha256; cv=none; b=mZBjtSqflyFg/6+IPh5J0jJRRg3HQrPpTqO8RrprzsvDAGCD255Z94w9N1jpVJhZzXmJ0+ 67WPuhduCGdAp74QhMdjANgOSZRwJ+CD9EVEa8o1OBPWdOFCIF6+hIEj3p2vmxbJpWR9Em GXc8Q2A2Ni4CCTHPPHeGVsyoVm59hNw= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=XUNmqTrs; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf01.hostedemail.com: domain of dhildenb@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhildenb@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733219256; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=adHjUEuwXA+ANkdOzZ/yc4IEWn5pdw/yGiEpqds38YQ=; b=F0A37gy9uJ9J1enne/7DY5IQdLA5SOipWJtpX2DMwj6gNUoL7A31TYFS7YjL0Qs6rpSrGc zsIkTr7BMccIsWOGiy3/iau2bQ82TzbfBVwdZ7lQjKuMJtIYfQu0/Pta6gO8bdOH3DW0a2 ru0KQaX1YUxgfqq/GwGrJc6UwuYww00= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733219261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=adHjUEuwXA+ANkdOzZ/yc4IEWn5pdw/yGiEpqds38YQ=; b=XUNmqTrsi6ukvMK57jg6ANDctacaG9P9v6y7jj/FRpHdcx9D7LPspUV/J/J+Vul5LHodNN rNLBf1xlCJuPaZAL6eWDKnER6sbXPBwPRakiEcxCjqhRFibWf+SQw/9kAyUygBDBqFEiFH 4R20B7epFFWAhnwHhi4r0i1eTu1hkX8= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-232-jyiZkeuBM1mNXeze5puC1w-1; Tue, 03 Dec 2024 04:47:40 -0500 X-MC-Unique: jyiZkeuBM1mNXeze5puC1w-1 X-Mimecast-MFC-AGG-ID: jyiZkeuBM1mNXeze5puC1w Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-43499c1342aso37401125e9.1 for ; Tue, 03 Dec 2024 01:47:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733219259; x=1733824059; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=adHjUEuwXA+ANkdOzZ/yc4IEWn5pdw/yGiEpqds38YQ=; b=jJ5JYgDsUGR6K5jZxgsAT1tM/LzU5PyzNVFS7tXixwpbRjHjmHUCVXuvVlNt3R8mV+ 5WsTtybFnHac4Ma4W3IIRFNb04xKsAhkRXMkwS1YvUX+YlLJFMlnsIVPTyBEQxUHLKgJ Slsm6GQYhZ42sWBoN4mZKcjhLL/eYPB1QLdD6yZtR6e2t2NaacUuXsPLYWZeSTAH1jZD i7dZviDYbEcl+TxaqLHYmToxpG1pyCX6hS0xiBpgSBaAhebQ+QcdIEStQNdNqyIpTSgc 8/n4cStcHivdVtgYgnGBlrF6oDuscn9jezo9RsVqUuMdlpVE32b1nrO8oCvbhivu/fNU cIrA== X-Gm-Message-State: AOJu0YxcCV1AaJlaRr1Hy6KhjFhzgA3ONn5Mkk8e1m2+funenUgG1baN JtJK4sfBSqzozG3Y+9cWXuxIMrYRpJnwbTJtBnKHia7gvk8t4OK5IeOYbLIb3233k/TK2UW8p7r hhUL8v0flcaq0dIgzMah2EI7bPOp2ZCwwVXP+cjn+Gx+f5xE5 X-Gm-Gg: ASbGncuwRn2tl7jfejXZcnVsyYtN1K/Afva66AKgqwt0NSU4KwZLsm+9B++yTyHwF7w S6c57B1jYN4Gy0aczOEuJ33suGg9abcm2xrbmo9btbMtBi2ebQkzP/O5nrmYMoyOfLzvyzfwQ6I nvhuACneZORDR05oJEfBYOMlwrvUoedaK6OMMxOUWujYwzbKoW5V9CXP4ve1Hgh07Tzcaqb96b6 RTWskenSmnqmcHapg6othyDDwwVJ1JKUohqm/4FOP52GqfZCVaGUXZMl/KBtJ9okyrQniXqOgLY NlnBsKbESIQ1Ek76ysZCPrToGX78UFZNEDU= X-Received: by 2002:a05:600c:19d2:b0:434:9dfe:20e6 with SMTP id 5b1f17b1804b1-434d0a03be0mr13411265e9.23.1733219259536; Tue, 03 Dec 2024 01:47:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IGwdCbQ2+x4fQDn4t4+UDQwQ2YQY46+IOELCndGNvUKUKqg7eAlnbIgz+QXoKcPKq7fDw8IyQ== X-Received: by 2002:a05:600c:19d2:b0:434:9dfe:20e6 with SMTP id 5b1f17b1804b1-434d0a03be0mr13411005e9.23.1733219259183; Tue, 03 Dec 2024 01:47:39 -0800 (PST) Received: from localhost (p200300cbc7461b00fd9ec26cc5521de7.dip0.t-ipconnect.de. [2003:cb:c746:1b00:fd9e:c26c:c552:1de7]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-434aa763aaesm213653525e9.14.2024.12.03.01.47.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Dec 2024 01:47:37 -0800 (PST) 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 RESEND v2 1/6] mm/page_isolation: don't pass gfp flags to isolate_single_pageblock() Date: Tue, 3 Dec 2024 10:47:27 +0100 Message-ID: <20241203094732.200195-2-david@redhat.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241203094732.200195-1-david@redhat.com> References: <20241203094732.200195-1-david@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 3-YlmKNT28F_CycQGd67HOL1TQ7ZwsqGwVTLqi9W6mU_1733219259 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 9FAC04000E X-Stat-Signature: z4cuspjztrq9wftdwzxrbn8d4oe4z3kw X-HE-Tag: 1733219252-624827 X-HE-Meta: U2FsdGVkX1/dAisfeD1UZdPnlmBrEkIelkXuyA4O776YthgjC43iRc1/VeObfaElR66NyhZblEDk/lFRbDL04Rycp3oeVp31XOil/QrhFuMv4PAavyqxBts+3z8fTFL9EO08d2XWm2vboNdhHYOD0cCwoaHPTFmyEu+MJMJrYEaDlR558rjV65v8o9/tYKbrUqAg3wIxA7N8Am6jDC2nhcX7Z8Z7I6eUkOmlRrKId/AxL6q5o38dZKGxUskgcCP7r0YyJfouZid5tfEc6374AMYOnBk4R4u/pPoLamYq58/pqI29D20fG2fFgq+XQOuuNOK8ZNtKDBohItetMaOGYozypdVVXN6nvWVOWHmQUg+bIHAkel45aw/PzY/NDAepDeQlhpjOsa4U5ZljO0fZduavvv3qRreMrBSTmOcY1kfRLXPomR2yvPPTM/zP3EocrEUSVpoedcMuTMGAvwsJAL/kwwy4eEvAVw9Pn46LCXm54fIPqkuj2/WX777sz/S5q3YK28c9lu6DrH0MVsyLtwW+FzTakCpRIIsCP0DtSZuazsdcPU6JW9NBgfIqXjCJJ4dzqshTwJWSOCEvBuL0Y6+HSZRrPgq9LIMTVNgiVkOy98COZzWTZ4QWqqqB/cIOWfFRa3/bcsPu5ymEjsjMe3CnNMlNtcHgdeheYTVENvJM4nFfRd92//uUvoF94QTmVQZlRisQEvshrSA3fYgOtrn+c6AvEysgfb1bS2G0SRxcDhHs3lvWL5pSv0m/kMBnhE+IWuhIUn6i9oRDqMWQY1NDUeAi/dh2fZ66R1vphlQtTFnn47APX9B4IzeN4hTEXzHSrAJmb1v3AoAfZE1vHRTeqdkIVfocoD4eOU07wh68R42P2Yt0b5sricDRfHM+wl+iq9wLq/cS7z7YQSs38wCuoNd4YhG41LAAyBrKllHvM/VB3pucrJPlTbWf74rQGUv3k+s7N9fwdRt9kJC TV8mNXQ5 Kc71L7sKIVHgdpDdzFUKm+ygDmeZ1l7zaUVGCjuJeBGkC2IyAsYr8KX9gX8Qh4Jgi/dHAf+9bhRTdRQlfNf5T8lmx+Xi8b7axcbRW5Oz4lhtkA67iuR3hUR4bVPW7/gmpGSRXNg6UyxekcjpL8LepL7D0ct5sh7Gud0EHrEKXUBhBt8bAaFLfSXT7X2WPSmYwK1rl9WPLszfRGf9dj6uQeij0h/VaFRMwsWygOvojp9u1RQPKpHl46TQFIQY2zppGMi2lIKjsrF00vE3uajJwYdlozlwvu3dXWrBZbHoLlME2NkUl4WlT1v9IvwkkwQcAWzCWCTG9l/DNbB65ZLzHdDzZKaM8rL6CPLV6LeR5fzvpjtZTOTNNwq4/C8am+Z42fZGe96v9L2IPZ8AxQgqyhMEFJjadpqH7SbFvAkk9FI5nFv/wMcJy5TM9GaxF3nLX+DVs2TkERGIiFzOCvHef+woLEHCXPxMXPuL6/j/sf0dVQyzjYqM+cgxpmSZu4nD8gfSx 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 Reviewed-by: Vlastimil Babka Reviewed-by: Oscar Salvador Reviewed-by: Vishal Moola (Oracle) --- 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 09:47:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13892060 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 6374EE67493 for ; Tue, 3 Dec 2024 09:47:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EB1206B0089; Tue, 3 Dec 2024 04:47:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E61596B008A; Tue, 3 Dec 2024 04:47:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CD97E6B008C; Tue, 3 Dec 2024 04:47:47 -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 AC68F6B0089 for ; Tue, 3 Dec 2024 04:47:47 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 6022D8080B for ; Tue, 3 Dec 2024 09:47:47 +0000 (UTC) X-FDA: 82853170344.27.D547F29 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf16.hostedemail.com (Postfix) with ESMTP id 0041B180015 for ; Tue, 3 Dec 2024 09:47:31 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=cHEJR49I; spf=pass (imf16.hostedemail.com: domain of dhildenb@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhildenb@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=1733219259; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=WPPCObfnf5xw33aPmiPyCg8m61901qLXiqhqw8UMgIQ=; b=XqTpgcf68a9XxnCxs+VHDhwt0LBO4f36EzUKkEYnNUiTqCnaFqhYLlC2vPnFKLIrao78Zc mo/aJmeAdDeKbLeoF9lfhF8Jsq6jk3d99yvrhl5tTk74emXFn2JFhyrXCzBUfWnqvLgX11 uTnp2KDnCDF3QgP561NnVdlwFCDwYmk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733219259; a=rsa-sha256; cv=none; b=ww8/zIhP2rHV8t2TMa8WdSOO1YnEkMtBBJKcKX0HK80G1ZJnThsj20yLamW9ECZ4eHXkR2 tIg+aagJetLeTV1wudDF7HCFGMZ9saDxpDcppENcFgp6dNfxOpFo0ZlZpMUnre24/ml9MB M7qRJQK7uC/Rhq8l2BLbIVB5rn0tMXw= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=cHEJR49I; spf=pass (imf16.hostedemail.com: domain of dhildenb@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhildenb@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=1733219264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WPPCObfnf5xw33aPmiPyCg8m61901qLXiqhqw8UMgIQ=; b=cHEJR49IR6AOdJxBICHpuQzunEQoI1wqTl9t6u4EQ2tmjr7whKFih1BEvxArYLGB7w+l1r neJcO9lqqy63geLyprSM1fzb5AmSSPA5qJZqUFMxl+98zL2oC2xNOpl+WeoeR/iVieVVJL Nr8mCRKzpCyR1c7Le5zjw766Ti1wycY= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-106-c9BuG_XCOBukWqPQXHwEAQ-1; Tue, 03 Dec 2024 04:47:43 -0500 X-MC-Unique: c9BuG_XCOBukWqPQXHwEAQ-1 X-Mimecast-MFC-AGG-ID: c9BuG_XCOBukWqPQXHwEAQ Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4349d895ef8so49979805e9.0 for ; Tue, 03 Dec 2024 01:47:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733219262; x=1733824062; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WPPCObfnf5xw33aPmiPyCg8m61901qLXiqhqw8UMgIQ=; b=Nm3BSON5DYOM9limW2vS04EeE7uLHDj8x2t5674jr7h1As0R42u2v3l7idYjc9geMY PSL3V7Hzsc4lSPSNAI77UlduXTNfoDIqQYjAtwMK0EsLQZY1tw0Xxnpcnnrd/pBUCUx6 KLRICiQZjzROP5d+t9rXlfH0kJJlqHxlV21eloZm4/HBM15JRC5/VU50NUlihFhVyOW4 eQ5/5Tz6AVzgbnXFOoZDh8eWwbLbZ/LmL5WafgM0xebDCN0nvr6lXai5kd3n8oy6jdMa H+u1lUbZLfvWS0kSOjjGXEiuqTxefM1sL7MqK9KqGNI2BTBr3NhyIKHMkOeK/2bPG1mz AE4Q== X-Gm-Message-State: AOJu0YxpCoMkNjz4P7OYqTlxuXlyILA2CSM86X10XuheXyAxMpHslfRR WkPoKKl6oVERCNiWYResIpfVtkpCZPol0XNaQgopXX71Fg+fYBTw2R8pOctt6q7f4w1CjBFPQmF T4eqSCY2Sn05fC3ToVlBKAJ1unIB/QLTNb523CvdR1Aun9P/p X-Gm-Gg: ASbGncudcdOFvTCTGYzHaDrrEOrUxfjzXvNpSVRtOGlQEwUdDounBi6v/VmoT9m06xA XG68rmgPEy8YKjqwYcVqHPAtQlEwHdkEUQXVjsFbWeuNwTQccu6lGbLJey3phki59/avU/A/8sX +IPSIQpf7FAFrn9l8nIj83VeU5yJT9p3RKiKkebEDUN/SH/gSrJs/Q78UNHIdQJUP7xF0XN5laL k07S9+ihxKZKZuwqqI6OSOmYgodIKVDCxEbDNsgb+hs8fmFE4tZggAXXi2cpu+Quxjcv68hJDN2 DjDZbwemRXP0XnGlY3gVDa6lV5Y9UT70CKE= X-Received: by 2002:a05:600c:5491:b0:431:5c3d:1700 with SMTP id 5b1f17b1804b1-434d0a0e312mr13336195e9.21.1733219262415; Tue, 03 Dec 2024 01:47:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IGNQApWxNUm3SxdrUec7I7codm1+2ABsn7OxpSKkkoTEG3/Y5H+HiqJe5tT8Yop4NW8Dk8lkg== X-Received: by 2002:a05:600c:5491:b0:431:5c3d:1700 with SMTP id 5b1f17b1804b1-434d0a0e312mr13336025e9.21.1733219262074; Tue, 03 Dec 2024 01:47:42 -0800 (PST) Received: from localhost (p200300cbc7461b00fd9ec26cc5521de7.dip0.t-ipconnect.de. [2003:cb:c746:1b00:fd9e:c26c:c552:1de7]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-434b0dbe2e7sm183143505e9.11.2024.12.03.01.47.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Dec 2024 01:47:40 -0800 (PST) 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 RESEND v2 2/6] mm/page_isolation: don't pass gfp flags to start_isolate_page_range() Date: Tue, 3 Dec 2024 10:47:28 +0100 Message-ID: <20241203094732.200195-3-david@redhat.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241203094732.200195-1-david@redhat.com> References: <20241203094732.200195-1-david@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: lT4K-S61hCpOLzMDWt_hgnNBnrlSXgdV4Vs-0D-oTSs_1733219262 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 0041B180015 X-Stat-Signature: iimjohbzs1utf8omsetjmg7rpkjkkpoi X-Rspam-User: X-HE-Tag: 1733219251-836610 X-HE-Meta: U2FsdGVkX1+m/jktUEliIDRwKvy0CuW98cz/mYhOj3TxP2gxRu39f3jre0qAn1XsihAhzDldHuPY+4gI8s4wznYHFJ7q5M7Kf0YjvHKpxvb4lMX2JTUhbtvvP6WPuexZSmo4w1kE/AU5u48QAqiBxAngN2oKU6MsT9vDEIsDRbIkU4sPQpgdLQecUo8OB907ql2hNRCO8BVqAVBCMyAijog9y2PSXtvhvIPc7L0kNOy4Kw5RlcrEKwwZty3QDi/bw8rJWuGK0fDBHestVwcJY5ukZddTPQ/oxPQHuDnts0FJ0C5uPSalHqtYEr5PWANFA19fZiIyIFtznVYheJ/frnTlZ2P38shp76Dw6sSUa5Evck5SfWS/G4ZcVhWm0ahyOXeFSaG57yIgD+FKcyGQatrFPMCXO032DfwNEI4RVZAtxtV0X6AantH28kTj1F/1Zv76CqgFSuFf9vYTtyFbMBMr6q1ZqF7M5y4syj46BoAhEbFnL5xcZim7cRW/MaPnTBIFV2pP9nP8n2muENijM7mwCzlzfqK9aEQKv4trv5NynW6Mmm+oFxLfCOB+E7wfzT2Vaw5ErFEMJ3j/xC3eg3LMZOPxmF2pdKOhqcnpCRyQRdDfhq9SaETvYFfU7C+Bqm4cN44EH3+XiBxUMVL3d+5aGH2kgbUDY6f8Ut6+z1xI25MWAxvdKbiMOP9y+gRCaWhT7tyGFvOScsYkXWITkmqobmNhATDGglfNiShc2SW27S2idNIUJzwKnPhUCfJ4//SOFPcRj79QGOoil7/bYRblcfUYxab2cFaRNP5Bja6e/C6l3ckj9nsamlxpiLS22+gyCOpXnK16OkoYyt8WDG94H/S8TkIVTap977YMtlSo7xNaryiQACxzNrcT+o3IC2KSGKJzu+eBefXgfFM1GtpjiktxfHJ9sbr4PFtKF66oxPKSI04DMvYq35ORnYCA1McKaJyZ5Kp3y1I2KwK OxGIGyfM L54sddHbWJ9DWadoOBLMeVpfC+N2Hjo6o2uBsYVkccAvk7u3bxdX+rbWJELSgCHG5H2M62Zl/gLCrhvtx7kdJnSOuoiuToxsFoqzuN+PV3B9o2OkC0/CNnN8eGLdcOpnfqVtJvlW91vAQumfSmtyt4XGZ4whSybmW4D3yY7UnfC2K6NLdGoVJujbsyeFXZbVDL9UFcJSwC/t6/mIGoNOYsjxGB0e/9qCiCfocbyXn7xT3GWZCUEDMXC725w9TuQ7abO/RpNJl4zsAumhIxzzS1pVpoYBZQ42i+d0Vm/WIep+IExHOPqPtk77UZ+RPmmOyDgBzjYzo+jeJ/SDCknvkjbSa49Jg5mj5HNbobFeuXos6qdA114wYuvm4JBFV40S7ypA88X7K0X04qZ1IN1e4pA5JbJ+SI9vuMAgEnLOv23JMEz8e+rc9hpVmk1SdJvybZPt+7OYeGQ56ElpMtfElyKKA6GRUpNIaPOxDnI5dOeT1NQY61uDfol8DmVZv/oapncVT 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 Reviewed-by: Vlastimil Babka Reviewed-by: Oscar Salvador Reviewed-by: Vishal Moola (Oracle) --- 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 09:47:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13892061 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 B6C12E69E88 for ; Tue, 3 Dec 2024 09:47:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3D9EA6B008C; Tue, 3 Dec 2024 04:47:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 38A8E6B0092; Tue, 3 Dec 2024 04:47:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1B6FE6B0093; Tue, 3 Dec 2024 04:47:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id F04316B008C for ; Tue, 3 Dec 2024 04:47:50 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id B185B1A07C9 for ; Tue, 3 Dec 2024 09:47:50 +0000 (UTC) X-FDA: 82853170680.21.3D77047 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf06.hostedemail.com (Postfix) with ESMTP id 6EA3518000B for ; Tue, 3 Dec 2024 09:47:39 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="Jj/aFMTI"; spf=pass (imf06.hostedemail.com: domain of dhildenb@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhildenb@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=1733219254; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=LU3Y8BABokL9EuVXZz3YTSIe3emDP78aZncO4AsTCRE=; b=ar8KljegjRA3f6SVCq/OlGWpRqAoCMOGuv6vd2mTxNksf66mh0Q5d5dPP/4lzI5c+O5gsa h58b6H4tkbAJ7mnKeqG7Sb7DFtUUm8iFV3B3ameDoxaVFsZ+taMweVlSCE1BhfMH2rVzPZ QdLZhmGPBPMyYKLr3UuzuMkUZbUhuN4= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="Jj/aFMTI"; spf=pass (imf06.hostedemail.com: domain of dhildenb@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhildenb@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733219254; a=rsa-sha256; cv=none; b=Ft9526z/X4qmrZAmyUDIQWqE1vnP/faM4PuZzmvwthhq4EmSec+5D7IGIoMWflzMNTTWhB ATsMkQusoDdDgaX56zLL3qu4kCW1uRrYQ73xOCfs6sWZivmM5V6WgRNYmzX3Psu0KmmJaR BkdP13FEhm2/AaDhIdH4UczGtukGLN8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733219267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LU3Y8BABokL9EuVXZz3YTSIe3emDP78aZncO4AsTCRE=; b=Jj/aFMTI+hjvOX7PsuVwh6r6GjKkYjJcr3qMoJighry7wZtUviI66+d7NPqiC2lzwVA2Cj Du2W3XGJ1/IqQ5ZkZ0lQ64D98XNqk2zd/Aq4HW7BwQWKrlsE9em9JX6A0Aqo9B9D2Pg5iA QRGRMHYbvf2lGdOq8Aq5crOggGbw2ko= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-350-6XD8j_qpOpSV1h0i1eQkVA-1; Tue, 03 Dec 2024 04:47:46 -0500 X-MC-Unique: 6XD8j_qpOpSV1h0i1eQkVA-1 X-Mimecast-MFC-AGG-ID: 6XD8j_qpOpSV1h0i1eQkVA Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-434c214c05aso18468155e9.0 for ; Tue, 03 Dec 2024 01:47:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733219264; x=1733824064; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LU3Y8BABokL9EuVXZz3YTSIe3emDP78aZncO4AsTCRE=; b=TePSYLCbDmvYcqe1GGqhoZ19hhSDdvHvHviKzAUYkoEkQsUIGVoYTP+CHaW2cpF82N U+SCFCPNoidoVDge0F/VnPwN5BVT6dhtnpq0ZxqINtovJaetwiIXbJHeTz/+aEaaTuCu kiIj9J6bmVRoLIWgzD58daJ0FzAHENuRlkyEMqY/Kc3eEkJlw602ufgwZiv5gA+EwgNM cv4n2x6NByRiZ+YpFnlplIS56whwLxKYarQYkLfgD2cfBG/7o45MFIr8GvYjzGo6WUbu kGKMOc/10Al4SNuVOTy16LfABPuxvD3airqn26mda/aCnKlDfHANPYzEqegMITqbd4mR v1RQ== X-Gm-Message-State: AOJu0YwNCz+/2Vr0ClcRcVXe7fL5p9bvZKgyuTGOYeE4UWfHs04B5Z63 2wUUx2/Fv+V97toSxRNzAqgv+3Abo+ix9PHar3f5rq10rFnGyHoCXTFUfdLk1tE0B4X4bY76Yw9 gxDXffZ4OEM9MiDADQOtqaadsDNfKYbAj/0ctCptKis0xvX6P X-Gm-Gg: ASbGncup5PzYBKczmYj+cT1qkBv9NepFgjM6faOEuSDYq2RNRYm59wJJ1QNMBc7cNFM KlpHJYTdzCEv+gbKTWwx5mENeXtowLfO6YirwpiMSuwUEt++AqkT+XHzDCO8+2w5VCDub+VB/D0 3LeCEVYK6TH8T3Y3sDbOYxrL/WyvjQDpdjVxRPAB+f5L1Gst7w+VFwjL6DlQrUr3a8mj4q8Y3UK R/XBTAOGZsoaumN59d9I8XCU748aVoOxilYOS7hgOZaN52zji2yVlotZ+io/KFZ/SB4wEdaficl xLh0ooLHG5PdGSQ1+14wnff9ipSG2fAGxgk= X-Received: by 2002:a05:600c:1ca2:b0:434:9e1d:7626 with SMTP id 5b1f17b1804b1-434d0a03d92mr14496195e9.25.1733219264335; Tue, 03 Dec 2024 01:47:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IF3m9gr407PRBCaVgPUBaqcArqFbwV0w48JRDx7WvhZgMUXfRC/MZaf7nSG/r3cgNlikqmXCw== X-Received: by 2002:a05:600c:1ca2:b0:434:9e1d:7626 with SMTP id 5b1f17b1804b1-434d0a03d92mr14496015e9.25.1733219263982; Tue, 03 Dec 2024 01:47:43 -0800 (PST) Received: from localhost (p200300cbc7461b00fd9ec26cc5521de7.dip0.t-ipconnect.de. [2003:cb:c746:1b00:fd9e:c26c:c552:1de7]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-434aa7e5e59sm218218545e9.44.2024.12.03.01.47.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Dec 2024 01:47:43 -0800 (PST) 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 RESEND v2 3/6] mm/page_alloc: make __alloc_contig_migrate_range() static Date: Tue, 3 Dec 2024 10:47:29 +0100 Message-ID: <20241203094732.200195-4-david@redhat.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241203094732.200195-1-david@redhat.com> References: <20241203094732.200195-1-david@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: qFG2o7hHIOelwGsGQMxurzPqfcvStTVJKNJAlPBcCVQ_1733219264 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 6EA3518000B X-Rspam-User: X-Stat-Signature: 4ikxowg4no7kpceaqwmos8r67ibi5ruo X-HE-Tag: 1733219259-953228 X-HE-Meta: U2FsdGVkX19zzwCjdcHc78cOqGWiJj4TPRGWzudMW96PeNu/y5/k6blpYiqVT28MuKq2NLhdgSTmJyBBNQ/0JXSL9P6fBj3Hi9R29hrTSRgtcfcCDl7lTLhqosqie1kLWw1lXhFpDR0TeYw35Uns2YNQsZ/pbSVWqoIXuYX5YWzaeZvxjRPm/NntAkZAyFyg2MT9lw7lB0AecnNYj0hlWGIh+L+yFDjP7MXCfxVW9DgyCZf0KKqrlD43T3vbiCk8FsyKYHA3J22NwuyyQeiPKVqw9msWBJwqATlHCjq3WzN2JUd5yd2tAqgyrJyqdSoin9v1jrg7h/S5Pj9RkU8COH3q3t1LSSaxlWy6NSe38Rj5vxpRDirj8RU4xNNWMVAdbCx0SNiWSDqmzAd/zqVzz5E9RmdeAkrs/3BoRfSrtJ9sZINs2G4MeSGNm68JdaeiNXxjz41Yetlwqk5XrMpBUFczdlI9U8fdknQjCPh7EF3coMlzxKvI1PjHbIPzlkKCOATo7ombJAqRHSJfNeioUoXoOb1tlvP9NDq9H2tFDuBQQA/RjLrjo/6C2Xw0n4UUGzmioIZ0YqJpP08pPZMBlaQCiEnNRSzU+rq4iPVVz03hfFBW7TTSkWU2mXGLWOnhvRC0oDNUezpW53/IoI2pbvqojjSpETB2BjaUg0ociaqBIM4EtqLm2Lg+u0yXqipoGZwCGCE3YSY3eos70xM0OsPb8HpkSicyId0BpA0zCgDOg5+RoWs8k801LgVL7PMPLYDkgTFM20CNwc2ptk1YG7+EX9d6Lo7VsioQYGOVvE7P6kTuRTcpYTwbQkslWApkPDvkFnZBtBLYTO0GJxoF+eerGKcDc61vO+ljmaT+rS39qCUaE6HYlpNMYSgLlWWK7yG9IIvmdnnScZvuukMUWy+o88uZc3vlf6cN97DYaE9TpV52XF/a1Hg+9DhAvi/ZjTGDENuVvnR2hzBfot+ nSGjOwGV 4TH7or2cG9W8R3xMjf6UZOUfkgq4OMSFtzzG4Lc4DqUOVwDYUoy40y9KTuDfzUR+kilsEexbJ/oje4fEoV+Ln0HAzVMdYeZ5/pHb2DbsPmvZa2cjMfnsNEIOky8UUvNsnR4gLQD/QL0GT+NGk7Us0IMIgIuicATkkrJzIzcwemASE+KqdYAu9nvOsmcBBh0n/SSdpSUyfa6PqmzfuW6xh/ic9qOr2SUS1FP8mfxnOdBX5i2TWSXTn57bQwOLVVrErpg3tjt9a1vcLCrrzjWCNtkI/J8nGj8HGSMY7gN4LdQHXjjBSIXVnOuyn8ahM2SY8wcBM2pF78VNrYS/5a8dQ3m5pIp+s34CvZOdOhzJEml+YyaZ/YH6Lku3vTpappMqrTssL34oPLSrU5VlDYd7ZbKz6Cl9lsflNlAMjoxUWfIVftEgV9F6LAkCl2Wzom0WMp2NjAGf0U/kWHmCwREuQVKm6xaPPCY8p5rW/C5B5PWXY+nOI7KQgfqIJwWet3b8HUGqS 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 Reviewed-by: Vlastimil Babka Reviewed-by: Oscar Salvador Reviewed-by: Vishal Moola (Oracle) --- 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 09:47:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13892062 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 6BD1BD4979A for ; Tue, 3 Dec 2024 09:47:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F265B6B0092; Tue, 3 Dec 2024 04:47:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EFD036B0093; Tue, 3 Dec 2024 04:47:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D9CFA6B0095; Tue, 3 Dec 2024 04:47:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id B549E6B0092 for ; Tue, 3 Dec 2024 04:47:52 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 637F140FA2 for ; Tue, 3 Dec 2024 09:47:52 +0000 (UTC) X-FDA: 82853170680.06.FF0318F Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf23.hostedemail.com (Postfix) with ESMTP id 87C2B14001B for ; Tue, 3 Dec 2024 09:47:41 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=J+8KJXlH; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf23.hostedemail.com: domain of dhildenb@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhildenb@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733219258; a=rsa-sha256; cv=none; b=a8ZArMDqSe4ihyQ3uPXK7xZBT9ecDunP4VqYyz/atC8Nsnp0l9ZXIw/V/CblfcXt0tmb5A yf2dpr0buwJH8HqKP4CB9w7eqjqT/rgX3Znrv56b8lxdYCTnI+EISYZiMPuwhRJiIJa7wc jlrm5ra5OIOD3x3/pohYLfpaEAWLlsQ= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=J+8KJXlH; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf23.hostedemail.com: domain of dhildenb@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhildenb@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733219258; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=cjBW/vjYP3nNfvObrA09IpRDh5cADITJHgvHLWqOgrU=; b=lmqOVYWZ5mTpgQx+63LkUaXKVr3S3NEliNbDjIVr4RHeAfXWZGtnxQrWuC3FUWExNWpVh6 yslWBBFc3vsbTMCEIaR0Njr7+RVv1toROacq2RNmbUlmSMN5crrK9CJFiHnmBjXZh7jz9V H1LCy4JhDvCCsFut/yVDCPeAUilzKuw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733219269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cjBW/vjYP3nNfvObrA09IpRDh5cADITJHgvHLWqOgrU=; b=J+8KJXlHgrm+FfEQg5xMCdL1NTxTbh1oipGvqUPzLwY92UiMNa8BcAQwBXSgBO3JO5CiMD rINDRcwxazX2HBreRdAYqNMEVTE4X32S1nCc9iizwSkwidg/ipUWapAD6FJZmn/Ape65/6 M2Om14b3RSOl9LWYvR8ltabCF0kocJg= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-255-B8_a301OMD6gClRE5DW86g-1; Tue, 03 Dec 2024 04:47:48 -0500 X-MC-Unique: B8_a301OMD6gClRE5DW86g-1 X-Mimecast-MFC-AGG-ID: B8_a301OMD6gClRE5DW86g Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-385e5e3bf60so2048157f8f.1 for ; Tue, 03 Dec 2024 01:47:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733219267; x=1733824067; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cjBW/vjYP3nNfvObrA09IpRDh5cADITJHgvHLWqOgrU=; b=KizoiKFZyCoM2VWz0nCHSb2jUpSwKXj0mKOL60wPXHSx86cFXGBLaD9D9JoNQy7nip j+QjwhJHAC7CT4nHYfgn17tC38N4ZYcxw2yzqWl5y3QJl6E/LOxEZzf/G4T6aGxL1Q8D ya3O4HB5o3Vjv6KDcCcKiyKBkVvVut/tvg9Vodivio0xM74mnLFxYADVu/VTd1mlekVq 4IpcQ+dtFA5Avr4WJlC19F2RaYVajqPHxUhGkYnrm9Hh+LDRcOrPE4+tqTf9dx2Dt4VO gI9d0wSsdKc2/SQWZ9WLI6CZPt2b2B/fysv97kj20J5rhPxlKIlugt0M6P2b/oYPX04q 8rlg== X-Gm-Message-State: AOJu0Yz58D7INPUFH2JPw5KqMhfMnAT0wpHxU2QIAg1bjM+SGPS/Gp2/ TPGn9IaKoZhFLwduP5H+2vuQD+jJIDAiSfeso+1qPzK0hpIA3XZpd8/px7OO9UFZ4X7TgmWlkNF ZXbiFKnRuEZ9JWVFuB9Z23QA8tx9rXnhg8MMS1yIumGvkapS1 X-Gm-Gg: ASbGncsB0BumkRxkyuf8C193cM8WFhH8HVuT+sdAaD058K97MIPUop8SzoZmItZB7DP PBxgcrdTU6Hw9kqnRqLtWbVemqT4ayT0mnA7WH8QB5cQgER4kv/7L3F/tgk6Gi0xtetL8LQKzAK iaWJCTt78jqI3XPRvO7IAv0fn/+niwSXgInD8InCXhvIRNwwRR6h9oCm3/DBX0ExBWbupHe03c4 uUvMxFqHSQ1xkcRs+HoJUKB1/i7XVUGeRbzRFBperkZ4bfyssbPi485Q0aB8YoT9EBaCAnyygFp +Obz5yu+YGMt+E29s84h5xvpZveWUq0s77Y= X-Received: by 2002:a05:6000:70c:b0:385:efc7:932d with SMTP id ffacd0b85a97d-385fd423ae4mr1564033f8f.46.1733219267478; Tue, 03 Dec 2024 01:47:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IGaOJ9gxKaUnP3CbsR1qXN6hxrElYasKjqPVFXIuPLpn506OYh8TYc8ohv1ITpz8dyfapfkFg== X-Received: by 2002:a05:6000:70c:b0:385:efc7:932d with SMTP id ffacd0b85a97d-385fd423ae4mr1564014f8f.46.1733219267074; Tue, 03 Dec 2024 01:47:47 -0800 (PST) Received: from localhost (p200300cbc7461b00fd9ec26cc5521de7.dip0.t-ipconnect.de. [2003:cb:c746:1b00:fd9e:c26c:c552:1de7]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-385e4a54b71sm9361779f8f.79.2024.12.03.01.47.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Dec 2024 01:47:45 -0800 (PST) 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 RESEND v2 4/6] mm/page_alloc: sort out the alloc_contig_range() gfp flags mess Date: Tue, 3 Dec 2024 10:47:30 +0100 Message-ID: <20241203094732.200195-5-david@redhat.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241203094732.200195-1-david@redhat.com> References: <20241203094732.200195-1-david@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: suyUrLHaw2q9mO66x-wuSByDlwuTjsI0_jzuZ4uEV0E_1733219267 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true X-Stat-Signature: 9cpouqyb99cbsh1s1o39ue3h8topc3g7 X-Rspam-User: X-Rspamd-Queue-Id: 87C2B14001B X-Rspamd-Server: rspam08 X-HE-Tag: 1733219261-62779 X-HE-Meta: U2FsdGVkX1+TXG6zFTfDO9B/9vte1LVaXFqHVSY63/R/Zb7RIaj0AsJFQD9dRORATw1mgpcUeivR/P3uyP3dgnLwlmRkLyHkHt8Lsg0NwWus1yee+Ttfmwi+xdJ2FBEG7c1XzsQHjbRPlDzJtBQ341HzUIc7zBcneLR1zrL3UsQmespGKWXsvVf8vGT1lh7aluTpEqP6fLE250MIpuPM8Huy3+sAwv2vafxEnCI0UevTnBb1cn1weDC21p/9j9QuWTmnIlfPj4nfJ0+ut0Ow/MLOh4/CPnjmwMDxtEA5bdNJUH3SpTtFsuOL+i6F9PfXNExqh+3sUTI4S2VSlW/ziJ8kxF7JOgh/yNBLktG0QnrMZt4I5/37Ipm7HKuIaeBAVszPayaPC6ZfXW7YNqCiAQEnv6Q5bOustrnQgzka7zKg98rcWFQixhJs/iu7qDqdzRvDQm/Ko2bhSBKoNRCSqoht0KW9Mhyy7LuHFdiytpDIB1fpelf5SJpD1dBA5hqxvyIuBqXS77vds733+FcD8qyXSOjnG3vkicLFUpTQoWzwQJLngJzqeEw65xpEb3bsp1afCBmylJU1O+j2xJDj6qzIgt7jgImmQXBVnVUB7jSYfmzTVe1iMH2fcck0DzYo2od1v9b3vsExKD2MVqenr2CtQ/NycsM1AstiOojL3Dugmu+AsZ04YqWvf4ZLvPLaG34c0VKpy1cLlPL0uPNPWAyDW9Tdx/xfQSQn1nXQgVSSEvq9KDHe9ktgG7j1FZ8/KpsFAa2cJ+pQ5MwR/8nEVProzdnuQkBoCyZF6rDmp/NMq1KLfhWCQCk2wkh0KvrMR1Vr3DIPjrb/xhT/auagePcFDCe/WtCE249r8GQLvFLG4zgB7SyOTtEezWVYrssTM8fqtvOa8pvcVCQbu4t1YskoI3WHO8POy5oLb3B4D8DUcZO0TEdx0vzIe5jC5BTQAzdxfRLmU6WgGBVRhXo e/EfgMtn j6OYGvcWy8NHdGsUOB5GSSeRYD7k9vgGCwhdxaDve6HIWQ+O2XArj7dPD+JXj0jALhsYTijueBicmc8I7mODQ8FTQElxGO1zTQAShLFj+/T8+HBwbzOJP0tTDZcEqv5G4iNwA6VHCoFUJZx0TEMBa71hqoH8MhiN7++Nmb6BvSTyqtkjaZn6LYTFKU74MnIWdGAdyMSJsvzR1txQWA2grforND7IqClYg8fiADTWEZgncjLVyh2N0jh+nH0FRX//2jmA1/2Kq4EC7mO/A9paSpgLUifDwvS2qAUcBMFd94EjnA36iP1aeL1Oouq+UwKRMK97rgsjzJmCOGMaOAoVGic0KOd/okMSvGtQq4/m/6xGy6d13zEZdxsnCXk7cOcJc0lhgYnthYvb2yUL5o6GNYndhbmyoEDpHJJPwnQqMxyNCVGe30NYxU0lhjJYOhWq6ymOMVSo+GhD7qWj8GRtQ2KXNOf7/5Bn8n9/ZEBK07cHHKCYUq87adHHjWUCYf1zCQ0kX 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 Reviewed-by: Vlastimil Babka Reviewed-by: Oscar Salvador --- 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 09:47:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13892063 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 729DAD7833F for ; Tue, 3 Dec 2024 09:47:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 00AA56B0095; Tue, 3 Dec 2024 04:47:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EFB456B0096; Tue, 3 Dec 2024 04:47:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D52166B0098; Tue, 3 Dec 2024 04:47:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id A2B606B0095 for ; Tue, 3 Dec 2024 04:47:55 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 5E845120805 for ; Tue, 3 Dec 2024 09:47:55 +0000 (UTC) X-FDA: 82853170680.27.ADD0BBD Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf15.hostedemail.com (Postfix) with ESMTP id E7CE0A0004 for ; Tue, 3 Dec 2024 09:47:39 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="PsXufix/"; spf=pass (imf15.hostedemail.com: domain of dhildenb@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhildenb@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=1733219267; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=0fQppTuvH7gihnzA0jS0S7Nrs9VtQXSbfqTsq5GHr48=; b=7MsvrkElVRIFGK/iLYNkqpSE4JRF4kp0rKXT086UMpXk3DvcpNnmTn+KKl7+lQhP5O8q52 elohm9sHqY5STVvMKdCXDFMyDZ3j1sgYb2SLD8QAz1HeAx+udEsj/Ddp+A2KIAKeIPt5Dq t/mX53pExK4/fNU1uloExTVaBiyXxfA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733219267; a=rsa-sha256; cv=none; b=d3k9hWCjCl3tcdXtLMcPg6CcUzeEBSq9h1+iTSmZcpchlWkHZBYNWuE889vouH5vVgQZww AKU2MXtRB6dow0IGuHK+KHZdOIJJEPxfDLoS6yveOr60kCojlDlxoXAefYp9H275aYecSX akdOrV81ZLBURSrKDYZH/yxfLtcLoFc= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="PsXufix/"; spf=pass (imf15.hostedemail.com: domain of dhildenb@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhildenb@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=1733219272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0fQppTuvH7gihnzA0jS0S7Nrs9VtQXSbfqTsq5GHr48=; b=PsXufix/wJaO+Ojtf74uBYDzb8BNmWelq4knTbNu8zxEjzo9syCLKmqd12zi6R5yee+hAH PAx5LkLWGuf9Dmgi1KmEz16w7ETmlZ2XwVeyQyqlP1cGyQ2OBhZQJm9j+kJApkYS9CQoXE 1QWZd47fsFNM863J5youXYz1CJ7130s= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-312-IVMm5i90NnaFUD-eey6sng-1; Tue, 03 Dec 2024 04:47:51 -0500 X-MC-Unique: IVMm5i90NnaFUD-eey6sng-1 X-Mimecast-MFC-AGG-ID: IVMm5i90NnaFUD-eey6sng Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-434a27c9044so30033615e9.0 for ; Tue, 03 Dec 2024 01:47:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733219270; x=1733824070; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0fQppTuvH7gihnzA0jS0S7Nrs9VtQXSbfqTsq5GHr48=; b=vQbBXz+IsvlCG3ZLuAvb11I1TpsKyeSV8lUdxPLM06hBZzomUsITlYqMO+WgyrgD7i lKycG5Hdr4OPzukHe6OFoUvRO558T/krvcltC4CLYEFrp+5S4tRnhaqRjZ0LSqJ5pfVS P4peAsSY1wBAXNAAM3G1qlgsSWXsE2cdU9ZmmtTI8r3sungvOQzoTTrNAEay5rXYQ6Oj X+sFhZn1X7gPNbnSCjfh8JrmuDV2Fvxpuv+HF7BstrsMgs5HH5bZy8PkvurpHnJnGSPU 1lsCOhxKADSJQpDkgd8pa05wzIiQksSp14x4+RodauL2uffI3pLzfW7fM7ad4+w5HsaA j4Rw== X-Gm-Message-State: AOJu0YxD7c+/l9+VSpSZFctXKee3zoeAk8vi3dfFzVAm5K8QdW6xL4vg idi8fHtFmbyFcoAs4w2znEGFiLpYlx/gpJFAEPp/lzNM2FzEl868puJfOshqmN1oqb+tNIEjKcx 7O9tDUoubRYSI3MrjX+zhd4A1/jyjTFMaTRrSDr/rxX1c6W3k X-Gm-Gg: ASbGnctwf81KMNKw+7onbenhwEdr3mkRTYrtDozceF6nfJ+iLEH4OR5RlldFZJUANfX hZ1uam+Rxpbx6cdnNMN4mXj91zIoIp+h7jSvM6B1FF5kP3co/a8omSDs6qfSFZQYU0bVG/yd8rQ toquENID5SLLxtzwmtr/piF6oY/0gWXS0+unlVoNsYSa4kJ8+alNlZV+d1rJPDJSjNyFlMDeV7u zKmRuyv9CRTCcQCNOATVKmDTqXouas4ymJSwcHctVCOfa1VILSKuCkBDfYwwXzVp8CA+bGQBLVN M1Ub4S5y8fGIDoeYjdX1sdj2Hjiub8YxpC4= X-Received: by 2002:a05:600c:4fc9:b0:431:6153:a258 with SMTP id 5b1f17b1804b1-434d09bf4b7mr16320815e9.13.1733219270399; Tue, 03 Dec 2024 01:47:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IGScK9nYDBCgbazhX5KZLpi1/ltXaWURuwLWZA1yYPBlDObPA+UiToZ3Fi0RuyRTQ0aGN5NvQ== X-Received: by 2002:a05:600c:4fc9:b0:431:6153:a258 with SMTP id 5b1f17b1804b1-434d09bf4b7mr16320445e9.13.1733219269891; Tue, 03 Dec 2024 01:47:49 -0800 (PST) Received: from localhost (p200300cbc7461b00fd9ec26cc5521de7.dip0.t-ipconnect.de. [2003:cb:c746:1b00:fd9e:c26c:c552:1de7]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-434b0dbe2e7sm183147395e9.11.2024.12.03.01.47.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Dec 2024 01:47:48 -0800 (PST) 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 RESEND v2 5/6] mm/page_alloc: forward the gfp flags from alloc_contig_range() to post_alloc_hook() Date: Tue, 3 Dec 2024 10:47:31 +0100 Message-ID: <20241203094732.200195-6-david@redhat.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241203094732.200195-1-david@redhat.com> References: <20241203094732.200195-1-david@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: cgQFVnMbYIB9Lw03Bt55RlsEQIWuVdxhgM8U3ZQSoaU_1733219270 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: E7CE0A0004 X-Stat-Signature: w586idqk7rhcbn6pahmymnax5bz4u3j3 X-Rspam-User: X-HE-Tag: 1733219259-401458 X-HE-Meta: U2FsdGVkX1+FvoO9837RNchffp6IFpJQM1Ss8NUj7fx7oD54crmjg/KKXNLtQaIBvomE0cusjL5ArZcrLMcb+rXi0opi2/N4gyG/2qwec1uAewa9C6Q9JXy8psi4faRAuAn3vUMdc6kTsQvu0FVo0OjYJSzKuOyfGO2rJ+qp699+FuFaauOshr6L9CZRwc3prd/3+q3hiL7VAH5YHeLPR2qZ976sCbWs1MMlarq+Ll4KcOpPdgmWFjGgyD6si1dLBf4Rw2uq7SvvdUruIavhPqnIxSkDM/vuMDG27tMEb9pbRkOj9iMGgO2j/cohF+PMSXdfpL+/E9+tFryJyZZK0qRt9kvchj5oSz4Ha0yz5ywCR2g7jWGJiaBgHn5C2/Dp1rRIHIVYl+Ti+PyQS9bGc6fbDM/am5OHjZ36iFjZjTVhoV4xTvoHeCz5cej7tfRicXH7HFngNGKjIp3ZR6vaUug7RiiNwwlLNNS/78+k+cySY3k3U3tItJtC3jBhRope/Ttq0JG/50BDYzG21wS/h6NsVew9VvvaeQTSov2vY7vqeXBBB3ko8UDI1tJE+rZqTN5sFSSdhMKwoCgudy7Es5thR2GAJTUgndf1zUvKMa5s48rrjrzstQ3Fqn7lGIzfhMQ38uN4P0QEBOa0+CmKP22jKyaz60EAIz2MDUQ+dY9yuBNS4CQ+hbiY16O+/Z36ewX+/26PKFFDm1lN9Qch+kxpQQZOWKIt9Of9Bb7IMOtobPmtt4wp7CFVmOXehdFuw8dD3c2T+lus/u2ZFnLbvyPPSF60NEQEQPuqC1iYs+8kLDpHXB0BVB3t5Cu8gD+xAgjxwVY3UFBoUawe0o8J7w4UXST4VB7SNPxFoRsVsgaBF2EmzdCCHCm2uC9/Ybm4SSwpsRqEV1cnmKtcxhXHGZdzSCUmbNlbD55W6fyCdmVb3ypgfNURtARCNF1La3sj/dGJpVeW7lrO3TuAV0w cU2S/kXL ibACyKN3HIlm8zFFKGXK9jDgaAmYqXvIcAlsjQIF+hsEtO28WNzTRme3sETx6y1LqoWJ/TYcJIzCkEirqxMioxAnluoaFyEyecaWtxFa48g9jRmaBc8oDw1mMCAQro3bzL8Hc4DsO2lKeA76elpnt8AcIYZK/2H8AJyS3wAqMLOWkLRv1Kg4K+xZTasHSicGAvOHTDs0ad4bPZcnGkB2pr6dFqRQYWVAWxyInHUa/JkMI0BdrIw50tiH0vW52xrZlMaHHa1jt5Ie4pMCKDWhKWWlJzwbnowsRgKIZVR976jMl4aOHPkEIgrYqfsUSpXvBLyS0SqXHqcUjfaJErN6NCtYTZxJE6qrpy+/aRa9MtMNRTStBe5HY/UMUk3KVqs5URp0DwFlstudOQtCdkr56pe0ijdw8ESjlaiV5QNndPRxPCqYnyUa+w5lhEZ4VeKyld+LGha5MP6KEOFHKfs9nyO6PX0zs0SBaZ65O 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 Reviewed-by: Vlastimil Babka Reviewed-by: Oscar Salvador --- 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 09:47:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13892064 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 EB41BD4979A for ; Tue, 3 Dec 2024 09:47:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 784A76B0099; Tue, 3 Dec 2024 04:47:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 735846B009A; Tue, 3 Dec 2024 04:47:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5AF0C6B009B; Tue, 3 Dec 2024 04:47:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 37E7C6B0099 for ; Tue, 3 Dec 2024 04:47:59 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 1738C40FA4 for ; Tue, 3 Dec 2024 09:47:58 +0000 (UTC) X-FDA: 82853171268.28.070ACE8 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf17.hostedemail.com (Postfix) with ESMTP id 0D2AD40010 for ; Tue, 3 Dec 2024 09:47:45 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=IXulOmKM; spf=pass (imf17.hostedemail.com: domain of dhildenb@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhildenb@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=1733219269; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=xX/Q3/3Rp0ILyMXyKGOcZrJDDur/TZdwfSuBal5fAnM=; b=5xVbUM7zw14PMZEFI8RO1CkkHUS3DCbBtZqVYwYCivLT0MAFUyus0XBDga/IeeIjfCucZ8 hIWA2JZf5MoyvVEgXxLbqevzrbo9zKDsMIprsCPJHQyJZ7j80lnbRxCFuiZ2SPCUiiPcHk 8Efd5kuVC131jOboBoFOyOeCiDgGt50= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733219270; a=rsa-sha256; cv=none; b=EAtjzvJjA5tOZfYh+w0Wh1caCz/VlLqHmfG9Sofu+TGbKlXFaDIoIKb94toqUtW2/2CJlA dsGuwf0S2qdttIMB2/QWIno1GR19Q0iSU8tn/PN+q9+CAEefVPp9Ff3XgW7fzNN5Qg87uj oMi7tmfTVyFoPChAPmV84z+XZVB4oUw= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=IXulOmKM; spf=pass (imf17.hostedemail.com: domain of dhildenb@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhildenb@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=1733219275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xX/Q3/3Rp0ILyMXyKGOcZrJDDur/TZdwfSuBal5fAnM=; b=IXulOmKMu5wxyW43yzFUuxRR4gwP4R0hARlPCbzOlityI0bvSp+D7tf/I7J9fUBNaq6lB0 Q28Kd7839XYC0nquBxV90qHulUm7G2UIurvfNC4X7k/Q90dGXdy3due4KaBz2/4dA6EMbu VjUEEcaD60k2EhXdE3heUxMDtqU4U8k= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-636-1A-UdxHTN16K-x5N7LsJ2g-1; Tue, 03 Dec 2024 04:47:54 -0500 X-MC-Unique: 1A-UdxHTN16K-x5N7LsJ2g-1 X-Mimecast-MFC-AGG-ID: 1A-UdxHTN16K-x5N7LsJ2g Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-434a467e970so37367865e9.2 for ; Tue, 03 Dec 2024 01:47:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733219273; x=1733824073; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xX/Q3/3Rp0ILyMXyKGOcZrJDDur/TZdwfSuBal5fAnM=; b=ACLfcoadoTTeRC1VJEwVxqM4si+UdBZSIqvO/BHCTOv93oBRIpLIm0Fwq7n81fO15L tdWXXZL63hdkq7cfuYn8yqRrICk12tM6h5IsOfGqZS206gi9aIbDqSq1+l1rBrav3HM2 lcd6JE1p2nYJ0cDwhCarijT1CNXhEEI6KGNOM7J14x6BSaKE2Uygxn88vnXb3w9G0hsc 09y/vhaKSYVHVgXAsogcKnsrBXLafwGVr+zr9Ch2zkKMSuZhOVJCEwGAaHBZ1h7nTvg4 FN8UmgkL9lvXwCccFruDF8jo+R8Kz1jAV6RgawGcXy8PBIa0aegdovnhrvbJdc4fozUn AA6g== X-Gm-Message-State: AOJu0YxvGVpl2dPgd8UsXPHr/A5yfHF7Vu1NtxmTo8H2OTYBDdAfBIRy 2bbDSmzEjVfwyoy01ulu46XhH+EGbfWRI0DqVnwrnFhQODRKbqwcnXH+AZ/8mD91d4O5YwaqT7O 071tf+n6CB56xGoDGuWC+3Vo5yhBOyKzxIZDE7uuMu6cioUB8 X-Gm-Gg: ASbGncu4LIX3iX6X84VHPQaqAdr3GCsLBA/L2zma6r1LfRYi6TjTAHT4z2mBOWZiiqi Y20fSKY5/liL257aGa13ppokPiSErO2RQtF0kFJDliL0dE1fDTrc5SFWVjn+2UX9e4Jfu7ZxCOd 24mk5rpLrnCSEn3eH8OsqN55Os+Dv+UP+RAwLXveQLYlprT47zJiAo0jQD1s5GHvVh+ofXQLRy+ RYMyXHP0IoIn4+nylcUheykcYUNToBeHXm0iBoFOz7QX7NnOPlb6ikwnGoHk5Cdq1yjTKSzrYc6 WnSRJudf1YfdkuKXZaA/uTjXZojvUGIZzGo= X-Received: by 2002:a5d:64e8:0:b0:385:d7f9:f15d with SMTP id ffacd0b85a97d-385fd3f2203mr1331586f8f.11.1733219273166; Tue, 03 Dec 2024 01:47:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IGDQ5OaqVY3m0DLSpLsQFBtVdXjpTP6F01guYNPwPEOIqC9M1Xr0t++bvv36PMaxbsj7juBag== X-Received: by 2002:a5d:64e8:0:b0:385:d7f9:f15d with SMTP id ffacd0b85a97d-385fd3f2203mr1331571f8f.11.1733219272794; Tue, 03 Dec 2024 01:47:52 -0800 (PST) Received: from localhost (p200300cbc7461b00fd9ec26cc5521de7.dip0.t-ipconnect.de. [2003:cb:c746:1b00:fd9e:c26c:c552:1de7]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-385ccd68c1bsm15299309f8f.84.2024.12.03.01.47.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Dec 2024 01:47:52 -0800 (PST) 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 RESEND v2 6/6] powernv/memtrace: use __GFP_ZERO with alloc_contig_pages() Date: Tue, 3 Dec 2024 10:47:32 +0100 Message-ID: <20241203094732.200195-7-david@redhat.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241203094732.200195-1-david@redhat.com> References: <20241203094732.200195-1-david@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: va9lACX2PRnzFOETK_x1ulM1AY1LCBIoR0_ku0U1E4I_1733219273 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 0D2AD40010 X-Stat-Signature: aof31bfrw8gwnsg6boj7gxo9fn1j4pd6 X-Rspam-User: X-HE-Tag: 1733219265-636529 X-HE-Meta: U2FsdGVkX1/jlxtHS1poChLU7+rT5Vlhq/e/3g2U/nNN8XLiVtMzLNIDHQ8wMUCxqnCg/FCyjzrevysjusopllSPc37KrwZUBtXCIT6Zf2Oqq08Ecb1JO/Eg2dhCkVk4htyYjeJlCo3396zH14NF/naSI2TlmbKc0a4a93SjrfvanO20q4fRiAw96FTtf6obcUwdAihR40x+R3/5tyV2gERX69gnkI7Pv+AQLRcTqEwZGTfsRXswOyIl+MloLjAsJBEbs6q8LT9PPdYsowzfIQYwvrsdfapfScjFWSjm7cdRMTCf+CSV2Q7bxGSKBu/PUstOrAt++btiPczgmuxU8yRGjp1t15L3LP+DJGIvhZMf4lR8cH1AoE94ijNdaWBsI+Ua4ITR1Gk5C5+3PhI3E82eXW9QQt0iEASQVyGzbeKsUY4P5WoKBGbpjC/5bJFPOHySGi95x9K8bgfRmXmY487a5ha9VWRChbXlTr06C/U/+9Ek7FVYwR8hLM1HzQqfwu7nN7EJmwdQOwyTI6yILFQXGfMcgCpbP/O6PB633ykqT3lmTWIvkInOrDxQRUQZZktk08O/D9B7TT7y9/4qLrOMoJg/Ij9en+WCHVqeZcpThn7JvttySM9Ah2DTzwuTbGboYxTvux4TVoqwgS0yLSfa5tbYU6F7MDaMJkNLqST9zlXuJvnq0ycj6Mf8RknqDtzL/nM7JVxlEIXSYOpKDwtRsYLo1A638VgW0UsEi+zyLCX4paMd5zPtrTfF04JqkvLL9Bterystm+mp4pnkHHUaoJfJVemFVKKWzxoOdqEzi8QubCVNOSk+DyOBZDOhNPlHzF7Q3PAhfBk7Jga9k/xEjUHLfO3zlgt7bfCH3IrrUeItU1Zna2RSuRXK2imNPSOt5HoOux4y7gqYyy8gz4JwUEpRK2qrYwuRPFG1r2d+f0QqwfhFjqotjMKeYJCQvBpO4oTuH8bIh6j8MK3 22DgrGsr SyvoxQGg7sBegp0ygdQt3f90mr6a1Wqu9nI4uDmvlmSeoIi73AneZVCg/7uUVPfti27F46+1HZrbxEw7ycyrp8eBzAYzyugyVbLvwNIwqcrMSs67J0kybsqQ7IUoAEwpLr8vaw94l+aLHrtfdest+W3qUvReX8NxTUws/Z9umeYahTju1yxuOkYCLaCfed146pMz/U7p1J8fy6Y46KUy3RSoDuQ2xFxZh4+G6WO2OARrV9lzls+VSPNOQYidH2X8HAL8ozD7bO0ks99JJZbJaxQUxPIhLEQsM93CygHZ2jO9MxbyK6sY1xzhOxSCpl1THhGCLAtnWwCKAMmoAnVD8QRK8vBIKFK9tnGHWzeF88lLP95jvaiMtiF2UEvKUffHkvarF2MP7huGQHlU4RYV0b0gwweQlSHnjGxELi7IEPcAFMElh+b13ERBVyAmKwtc0lGE19QlekMLMEofJLqVVJv+HuQPWc6O5sYnR 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 Reviewed-by: Vlastimil Babka --- 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,