From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1E5EC433EF for ; Thu, 11 Nov 2021 11:02:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C0773619BB for ; Thu, 11 Nov 2021 11:02:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232898AbhKKLFj (ORCPT ); Thu, 11 Nov 2021 06:05:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:36788 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229643AbhKKLFi (ORCPT ); Thu, 11 Nov 2021 06:05:38 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 42236610D2; Thu, 11 Nov 2021 11:02:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636628569; bh=oDx5eipT9nr35wDXdRGiSymFWGUPXUqTCMJshmLK7eM=; h=From:To:Cc:Subject:Date:From; b=rmzAqjGZwv+E7BKtpmQJZ3SrWs7kjB2A3pQmJELfV9HMiD7Sg17r2e7adQk556h7z yU/velJL5DN3fIlxSLyCC3AC1rD5EKSY86cPlIe0GDyuEOWZ1D8Pkr41xYLoNOP965 tkLAGj5jNwNr53teOxaacSRNkD13JaPo0+A1aynb/RghVlEvxrTs29xipsw8gfdVJB mVjaftbOtwOBj8b/uKhmF900MHDDh/RU8M/zn84OIma5YCcTapm84qoqmcvG8sFvxx xQdsIMwzfAPCKqGGgrWi3T6baZ4kw5ZHkNQHBFBw61ahru25XoGfwsiRNn1KqmOI92 NYRFgXAn28Jqg== From: Mike Rapoport To: x86@kernel.org Cc: Andy Lutomirski , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Ingo Molnar , Mike Rapoport , Mike Rapoport , Peter Zijlstra , Rick Edgecombe , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: [PATCH 0/4] x86/mm: replace GFP_ATOMIC with GFP_KERNEL for direct map allocations Date: Thu, 11 Nov 2021 13:02:37 +0200 Message-Id: <20211111110241.25968-1-rppt@kernel.org> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mike Rapoport Hi, The direct map pages on x86 that are allocated using alloc_low_pages() and spp_getpage() functions. When these functions take 'after_bootmem' branch, the memory is allocated from buddy with GFP_ATOMIC and I could not find any reason for this. Since most of the kernel page tables are anyway allocated really early, only GART IOMMU initialization and memory hotplug would actually use get_free_pages() to allocate direct map entries and neither of them happen in an atomic context, so it would be fine to use GFP_KERNEL. This will give the page allocator more flexibility when memory hotplug creates the direct map for hot-added memory and won't use precious atomic memory resources. The first three patches are trivial cleanups I've encountered while analysing call paths of alloc_low_pages() and spp_getpage() and the fourth patch actually replaces GFP_ATOMIC with GFP_KERNEL in those functions. Mike Rapoport (4): x86/mm: make init_trampoline_kaslr() __init x86/mm: make kernel_physical_mapping_change() __init x86/mm: init_64: make set_pte_vaddr_p4d static x86/mm: replace GFP_ATOMIC with GFP_KERNEL for direct map allocations arch/x86/include/asm/pgtable_64.h | 1 - arch/x86/mm/init.c | 2 +- arch/x86/mm/init_64.c | 7 ++++--- arch/x86/mm/kaslr.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) base-commit: d2f38a3c6507b2520101f9a3807ed98f1bdc545a -- 2.28.0