From patchwork Tue Dec 10 02:41:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalesh Singh X-Patchwork-Id: 13900754 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DB538E7717D for ; Tue, 10 Dec 2024 02:42:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:Cc:To:From: Subject:Message-ID:Mime-Version:Date:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=bf22iGP6jf2y7qifILZ5XtpYUOy94hbxgtZW13umpxY=; b=qN9k6/ogQ+NSPGF0MsYlPEwzlI fHBYzGuuPm2pzSsiUxAkh86HoxqCaxKVdxJ4smxACW1oOLJbgNOpsn4eYojpuLe37PVJQVDbxd9/e /+28ashglfoJiZNYaeur06mvkCQ6RK29RwXcYk55Svxvrm+fB5wfkoafYr5pl083klkH9zEyPMQ55 jnsXLT5qGD5ed1ZTQDCRlmYILim3hOyAUn7sBq6eTybjA2ah9mQd5tH+V90i20jC+at5VjUAarGYq uMRsCOsDAVvU8HZJjGiDIgbuvmFPsZk2JS5j3VB2MNmr1M0OS+f0zPfnFFJKVBBBF3KsWOUhifn6G GmgwjdVQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tKqCl-0000000A0Cr-14px; Tue, 10 Dec 2024 02:42:31 +0000 Received: from mail-pl1-x64a.google.com ([2607:f8b0:4864:20::64a]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tKqBh-00000009zVc-0lfw for linux-arm-kernel@lists.infradead.org; Tue, 10 Dec 2024 02:41:26 +0000 Received: by mail-pl1-x64a.google.com with SMTP id d9443c01a7336-2161d185f04so25303895ad.3 for ; Mon, 09 Dec 2024 18:41:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1733798484; x=1734403284; darn=lists.infradead.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=bf22iGP6jf2y7qifILZ5XtpYUOy94hbxgtZW13umpxY=; b=bPCGUrR3H8KZjq4pF0XdCKbpkO8rLjr/yY2d0H16r1jukS2azlfY8HF7aUPvWMI1OR b5HJU9CyBfXWEBzDe7A1kqZ0AwDGVSKhpqVLpEWYFbonZ4Tq0vFDwpwYHeBSBXc4nYz9 7aWhs/dT+tKVvdd18/CQR6PQI8m314rDK+r0PFighrF9AwmgeJOoZfaye+k42SDfi6px +lB/upxZsBvCMNo5x3hFV4WlPRT0lhjc4Uq4WK4PNcVKJyCNUjCWen8DvVzfs9HNYIay g4LYKD90eTacmJb+Jnb13a8gfo8NxuIXT+wt77+qjPFTznnASvOssri0Ak8VhfdQ7eKp S6tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733798484; x=1734403284; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=bf22iGP6jf2y7qifILZ5XtpYUOy94hbxgtZW13umpxY=; b=dYyx/K4q8fZXktIbuoVNup+vToRtZIzOYT35UhgmEUrWAaNiqu2pBYe07KtAFuMu1H OUFrhmBmCfkoEMxx1MVGOSWqoWqZ8BZqsi6GENzvgbL+6V1/4bFFarNvcR1awjwYI6s5 TBZz1WgCCTPQWJusfthD0VsYYAi1Jk1qbddR8YM+w6noV8b/qGAFbvpzF2O+dfiW0ain 0b4lPtufpPoL5K4V9kLTQldm/2aX0J+4RsvpffXocIu20zOVbYe7SfBCZq71LPoRFZU9 3QJQ/nvqP0UiyqhorSl7J09FIG7PxM/e5mhSt7Vn9DqSGy/xqa3v8CGcFzl7geYvBcyN jX7A== X-Forwarded-Encrypted: i=1; AJvYcCVsU6eWCq80fd6T8XeCC2DoTDMKnPeo+7TDK9RWJ5Av1MJdwYtDyb21lbo8NYwV1EdqkiUNCpsKP9NCCOad11oB@lists.infradead.org X-Gm-Message-State: AOJu0Yx+yu7+8u2w19LD50LjkyWfKXreeILrvxVQCkSnNZMhGNXMVuKj RLsWj3bAo0e9jtarreTlbxXkTA8JAcPMFAj0uA2owdHPjghoD5Dz0ZG7T4QsD4d+NrohsGUChUf zqRIEtdPjn8OuCnjPEjqlLg== X-Google-Smtp-Source: AGHT+IGmbMdmRSsqJri2ZoaLC+TQ8CWMLTK/EMvjfytSTGvuy8K5dpGza4XliOvDgrJOHh+vT9vCZPym9dpOQZfD/Q== X-Received: from plbmk12.prod.google.com ([2002:a17:903:2bcc:b0:215:5607:bc71]) (user=kaleshsingh job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:f64a:b0:216:2b14:b625 with SMTP id d9443c01a7336-2166a01e172mr48609585ad.31.1733798483773; Mon, 09 Dec 2024 18:41:23 -0800 (PST) Date: Mon, 9 Dec 2024 18:41:02 -0800 Mime-Version: 1.0 X-Mailer: git-send-email 2.47.0.338.g60cca15819-goog Message-ID: <20241210024119.2488608-1-kaleshsingh@google.com> Subject: [PATCH mm-unstable 00/17] mm: Introduce arch_mmap_hint() From: Kalesh Singh To: akpm@linux-foundation.org, vbabka@suse.cz, yang@os.amperecomputing.com, riel@surriel.com, david@redhat.com Cc: linux@armlinux.org.uk, tsbogend@alpha.franken.de, James.Bottomley@HansenPartnership.com, ysato@users.sourceforge.jp, dalias@libc.org, glaubitz@physik.fu-berlin.de, davem@davemloft.net, andreas@gaisler.com, tglx@linutronix.de, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, chris@zankel.net, jcmvbkbc@gmail.com, bhelgaas@google.com, jason.andryuk@amd.com, leitao@debian.org, linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-mm@kvack.org, kernel-team@android.com, android-mm@google.com, Kalesh Singh X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241209_184125_223502_2A5716F0 X-CRM114-Status: UNSURE ( 8.93 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi all, This series introduces aarch_mmap_hint() to handle allocating VA space for the hint address. Patches 1-16 introduce this new helper and Patch 17 uses it to fix the issue of mmap hint being ignored in some cases due to THP alignment [1] [1] https://lore.kernel.org/r/20241118214650.3667577-1-kaleshsingh@google.com/ Thanks, Kalesh Kalesh Singh (17): mm: Introduce generic_mmap_hint() mm: x86: Introduce arch_mmap_hint() mm: arm: Introduce arch_mmap_hint() mm: alpha: Introduce arch_mmap_hint() mm: arc: Use generic_mmap_hint() mm: csky: Introduce arch_mmap_hint() mm: loongarch: Introduce arch_mmap_hint() mm: mips: Introduce arch_align_mmap_hint() mm: parisc: Introduce arch_align_mmap_hint() mm: s390: Introduce arch_mmap_hint() mm: sh: Introduce arch_mmap_hint() mm: sparc32: Introduce arch_mmap_hint() mm: sparc64: Introduce arch_mmap_hint() mm: xtensa: Introduce arch_mmap_hint() mm: powerpc: Introduce arch_mmap_hint() mm: Fallback to generic_mmap_hint() mm: Respect mmap hint before THP alignment if allocation is possible arch/alpha/include/asm/pgtable.h | 1 + arch/alpha/kernel/osf_sys.c | 29 ++++++++++-- arch/arc/mm/mmap.c | 12 ++--- arch/arm/include/asm/pgtable.h | 1 + arch/arm/mm/mmap.c | 54 ++++++++++++--------- arch/csky/abiv1/inc/abi/pgtable-bits.h | 1 + arch/csky/abiv1/mmap.c | 38 ++++++++++----- arch/loongarch/include/asm/pgtable.h | 1 + arch/loongarch/mm/mmap.c | 40 ++++++++++------ arch/mips/include/asm/pgtable.h | 1 + arch/mips/mm/mmap.c | 39 +++++++++------ arch/parisc/include/asm/pgtable.h | 1 + arch/parisc/kernel/sys_parisc.c | 37 ++++++++++----- arch/powerpc/include/asm/book3s/64/slice.h | 1 + arch/powerpc/mm/book3s64/slice.c | 31 ++++++++++++ arch/s390/include/asm/pgtable.h | 1 + arch/s390/mm/mmap.c | 32 ++++++------- arch/sh/include/asm/pgtable.h | 1 + arch/sh/mm/mmap.c | 48 ++++++++++--------- arch/sparc/include/asm/pgtable_32.h | 1 + arch/sparc/include/asm/pgtable_64.h | 1 + arch/sparc/kernel/sys_sparc_32.c | 21 +++++++-- arch/sparc/kernel/sys_sparc_64.c | 47 +++++++++++++----- arch/x86/include/asm/pgtable_64.h | 1 + arch/x86/kernel/sys_x86_64.c | 49 ++++++++++--------- arch/xtensa/include/asm/pgtable.h | 1 + arch/xtensa/kernel/syscall.c | 26 +++++++++- include/linux/sched/mm.h | 8 ++++ mm/huge_memory.c | 15 +++--- mm/mmap.c | 55 ++++++++++++++-------- 30 files changed, 401 insertions(+), 193 deletions(-)