Message ID | 20240827-patches-below_hint_mmap-v1-1-46ff2eb9022d@rivosinc.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 607C8C5472D for <linux-mm@archiver.kernel.org>; Wed, 28 Aug 2024 05:49:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B43626B0085; Wed, 28 Aug 2024 01:49:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AF2A06B0088; Wed, 28 Aug 2024 01:49:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 945EA6B0089; Wed, 28 Aug 2024 01:49:33 -0400 (EDT) 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 743186B0085 for <linux-mm@kvack.org>; Wed, 28 Aug 2024 01:49:33 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id E4A56161CAF for <linux-mm@kvack.org>; Wed, 28 Aug 2024 05:49:32 +0000 (UTC) X-FDA: 82500576984.22.98B80C0 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by imf16.hostedemail.com (Postfix) with ESMTP id D5D61180007 for <linux-mm@kvack.org>; Wed, 28 Aug 2024 05:49:30 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=AAHmADj4; spf=pass (imf16.hostedemail.com: domain of charlie@rivosinc.com designates 209.85.214.172 as permitted sender) smtp.mailfrom=charlie@rivosinc.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724824083; 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=s842qMNTVJPdnaHjTgUH53HGzrqC8L35w1DIbWpmxjE=; b=y9qXoUCyfnXHtIEgbc6VrAwqW+IVpreh3ELHtccEwIA2tMgnblBewi/fdEQk/ehaBZhiQV nZaRyj7LoVu1NxzZWrJOpcFTxOY84linF9oieKTQOTEWi8O6+RngP47XanR0YriFghXQAt /CzRkaU1Xj24h+da7HHqUw8F628MdoE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724824083; a=rsa-sha256; cv=none; b=coLZMycSzRr5JYDE7DLtCFQcWuABHpQ8IC3jrdWF8rbD3/LqHe1J6fuzbuoSaQ8I9Pqj+S bln9L2bwpfH0D1n7orThiQOjSs5BKA0pjj32J4G5rP6hFdo4aoHoAyQ3x7mepKcAxloLYw oPHuCj/daAaB4VDPAJIDQR6lWoEKT60= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=AAHmADj4; spf=pass (imf16.hostedemail.com: domain of charlie@rivosinc.com designates 209.85.214.172 as permitted sender) smtp.mailfrom=charlie@rivosinc.com; dmarc=none Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-201fae21398so44795045ad.1 for <linux-mm@kvack.org>; Tue, 27 Aug 2024 22:49:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1724824169; x=1725428969; darn=kvack.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=s842qMNTVJPdnaHjTgUH53HGzrqC8L35w1DIbWpmxjE=; b=AAHmADj4lmFcLEMMjr8kV3b+f5EgFZ9KjXz7vC3AqSeSOugK+l3wo/GRj58iir7JpB u+L4k8fsFnfSMxk6XuynfhYoRYo3fHF70F0kzyhkM8V6WO/V+Ds4fOXrhR/N/yBchA9v PQXjg+/IS5gE8UcfBuW4Slkp9R6WsNyqRUcB9L9Op9+L2SNzfyvOG9A8O9JFGnGxlopf JBTz2oLIYcwzgP4M120gybd786F0/zlU8co6W9ve51jUy1H+Kzx8KRQqvUSyiub8u0X0 /AyqOTGy1smDIatWdC4kyGGFf4Q7e3MlaJfgPlbj2deWWVFZAeDKRRIOuno5JOwGPIld cPSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724824169; x=1725428969; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s842qMNTVJPdnaHjTgUH53HGzrqC8L35w1DIbWpmxjE=; b=S+4iSqaOcZT50FmeK0GQd9Qzn5KHEZEzQd3Fln3zT08FqsagCv6mz1mRRlaHn/9DzG /R2bzOE/frwkIS0/MxnQzutEf9iWDotNoclWld8Y8L7T1ZFmJxu32nZAyZZCI7U4wy/M rnAjItD1MD3G+JTu+C+RvphDmDUbT3kGLCMGTLx87blMVWq5SERlHUw4L5rJBAV3cGqi OEqvNese+0d355jQEj4YoVrNLtreJ7gnwjecgkuPG5RFECHEi2Y/nwWAaU6+GcOsPVen 5FRpI6XVGeZ+gQzehF1ALaDCvXkPOVjUhpJJiJmH2mrnKsARqyONWl8BEHTdXm+g+ZYg 3U3w== X-Forwarded-Encrypted: i=1; AJvYcCWOtOdsbGFKgoxtp5YTMWhe6ekv2U2hG+5nfHwCgFRF/ygJ/OvfKw+1VeUbge6L0TkqGBavR4mOiA==@kvack.org X-Gm-Message-State: AOJu0Yy2JPzaUSZRo+pBwvNV88aIw5P4hHlHwtqRsZbCEOsIIZlMFXZk EUPQ52K0jn2MUtOz/bGBq5d5kHco4cm5ctielu9eMsjFqQogAkjL4t03281NFTE= X-Google-Smtp-Source: AGHT+IE7iBIF/ncsUM+UTT7p6QlENkfnsLUglL71vzMDiTXQo3W/0gxhDidIM3IPRiHs8W/EU5lCPQ== X-Received: by 2002:a17:902:ce83:b0:1fd:92a7:6ccc with SMTP id d9443c01a7336-204f9ba22b4mr11347335ad.30.1724824169192; Tue, 27 Aug 2024 22:49:29 -0700 (PDT) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-203855df0c4sm92092495ad.157.2024.08.27.22.49.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Aug 2024 22:49:28 -0700 (PDT) From: Charlie Jenkins <charlie@rivosinc.com> Date: Tue, 27 Aug 2024 22:49:07 -0700 Subject: [PATCH 01/16] mm: Add MAP_BELOW_HINT MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240827-patches-below_hint_mmap-v1-1-46ff2eb9022d@rivosinc.com> References: <20240827-patches-below_hint_mmap-v1-0-46ff2eb9022d@rivosinc.com> In-Reply-To: <20240827-patches-below_hint_mmap-v1-0-46ff2eb9022d@rivosinc.com> To: Arnd Bergmann <arnd@arndb.de>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>, Christophe Leroy <christophe.leroy@csgroup.eu>, Naveen N Rao <naveen@kernel.org>, Muchun Song <muchun.song@linux.dev>, Andrew Morton <akpm@linux-foundation.org>, "Liam R. Howlett" <Liam.Howlett@oracle.com>, Vlastimil Babka <vbabka@suse.cz>, Lorenzo Stoakes <lorenzo.stoakes@oracle.com>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>, Huacai Chen <chenhuacai@kernel.org>, WANG Xuerui <kernel@xen0n.name>, Russell King <linux@armlinux.org.uk>, Thomas Bogendoerfer <tsbogend@alpha.franken.de>, "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>, Helge Deller <deller@gmx.de>, Alexander Gordeev <agordeev@linux.ibm.com>, Gerald Schaefer <gerald.schaefer@linux.ibm.com>, Heiko Carstens <hca@linux.ibm.com>, Vasily Gorbik <gor@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Sven Schnelle <svens@linux.ibm.com>, Yoshinori Sato <ysato@users.sourceforge.jp>, Rich Felker <dalias@libc.org>, John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>, "David S. Miller" <davem@davemloft.net>, Andreas Larsson <andreas@gaisler.com>, Shuah Khan <shuah@kernel.org>, Alexandre Ghiti <alexghiti@rivosinc.com> Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Palmer Dabbelt <palmer@rivosinc.com>, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, Charlie Jenkins <charlie@rivosinc.com> X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1656; i=charlie@rivosinc.com; h=from:subject:message-id; bh=tmMz4K99F0U2eFjTmXZPsRyQ5BJlKhVYtlPfqgJsjxI=; b=owGbwMvMwCHWx5hUnlvL8Y3xtFoSQ9q5XbFSzP1yPpXBlYea467kRPvaspyLaj1+ty58k+rfy b+vtHB1lLIwiHEwyIopsvBca2BuvaNfdlS0bALMHFYmkCEMXJwCMBGZFoa/UreElT5ecG2dxnH1 4+SJG05OW30u9uBl4X2J5vXXMs59v8LIcOvZs96dRZxGwS//rJlxOfEru+W5B7X39RYcjRI4YV7 3gA8A X-Developer-Key: i=charlie@rivosinc.com; a=openpgp; fpr=7D834FF11B1D8387E61C776FFB10D1F27D6B1354 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: D5D61180007 X-Stat-Signature: fnemwqtcdimb3p9tnso88ay6k9sucjdd X-HE-Tag: 1724824170-21897 X-HE-Meta: U2FsdGVkX18gXkNxMrTP7a9wTaCtY5FDwOzhTd7BtIh2HqsKUg3f7R/tTA8GfRU5wRlJawX/7bPDX3srrKOaKWWgNlzxoBppCEFoapPSEMcYhkYA/NcgieBhrUZk02nkpwwmt2O60uklS25GopiWEd3Dt+Pcj5C4EJLZLkg0fiH5+xYfLL205MQw7XQRIpen6d8gbqadxOOZT/nGzXjeMfi97R5U5NoImhWg24EtoHh/yyHATBoZCpsBPQxJ5L9tJiGaUa/77Ozp2hMVQBocw46I2juqJn6zIvbcETjeGNl2BmzaPuR2s97lBmKi8anuzAEfGPwiOArEhWC0Dpl7JctXlo//e9ci8FPeMafR+pWKfGnLEwoxqmDM6GK52EfPuh5IG3an01CM3HkvTibPDCnGbpA/sjJofNwoGjdHo4nJNoDhu0Hjax+nZtd2FpBmK1WFx74FWgGpkhMnAlK6xHg4gO50c0a+BOsByFYiCEL4BBeImkWxRA5B36An0ZfmrBo4C4sHyvffQpmqFrCn5dQDTyrx0IIH9fGq3hXLH3bwm/KIsVwCiN3A3iEO7LE9Crf2Zuq984mb5FJhXHYbM51BQcWE12ZPKvxLBAi/Gt6RByke4xLm2ZNPHNYqrOyTceyHVk/TkhMBOa/uIrMKFBAMECVMml9sbP5Bq32O+zjQ27mxdUZrq9l36qlIa+ulPk279S/mosPzGncmUp+s1VawyQDVjg7fpLTsoeheEoMPnU2MbohDR1BIRv9w5ZWws+w3wqsST7SiRZLmUUQiIIQlTQ+O7cgJbJqlDRSOdYU3jJVxuPsIz/vbAIwylV4CACG1jjC+WgB0PJAUqu6A/sppDfuMAzKFNlBKNcbfBI9zAu8fpxLBdlxHfCGwEmyutI23IoLh6KjWO0s7tJwslma3+e2BZJ8maZIEfIxeGYKTboCmVdx2tAaa7pG9LPTEX0TCVC1L450GPMC2k58 O9jbHaKP P/j6Vg5BMClyeSLvOBKeuUxc+8mlO1H5bQk55IXYdpU4sYeXOTYgjffC00+SWyVt9bmHfyO+jK6x0ypAma2uANSpq8DwhkD4E+jOn9DnSBChUTDLh4zNnUA+CUo7Ouq3y8bnW48BNe1Dl8y8mEypc/3HatG/ttSWB5TqcSqHsyxXH0ytInIim6jDKvEfjq6c8oULSjiSNgSAUDkKcSpVR2QudBz5p3PpHLoNAXP3XtpwHpOSCancJlUN7pzyYcv818ulxLtzjuLOAO6O/rTatct+0DITV7ks9H3HdETvpgv6QikVT0LC8Cli1whWHtbMdUo2oVNLRwtt3QkL+LNkUacDTAD4C/MNOJmiNtT9YYj3xrpPjdao+BR7jZe1F8HoDXAWOnrZwXWBobqI2Cdb0+BZcU+/nnuqtneCxBIKI5s+I0pH7J6XeHPhhWg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000037, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
mm: Introduce MAP_BELOW_HINT
|
expand
|
diff --git a/include/uapi/asm-generic/mman-common.h b/include/uapi/asm-generic/mman-common.h index 6ce1f1ceb432..03ac13d9aa37 100644 --- a/include/uapi/asm-generic/mman-common.h +++ b/include/uapi/asm-generic/mman-common.h @@ -32,6 +32,7 @@ #define MAP_UNINITIALIZED 0x4000000 /* For anonymous mmap, memory could be * uninitialized */ +#define MAP_BELOW_HINT 0x8000000 /* give out address that is below (inclusive) hint address */ /* * Flags for mlock diff --git a/tools/include/uapi/asm-generic/mman-common.h b/tools/include/uapi/asm-generic/mman-common.h index 6ce1f1ceb432..03ac13d9aa37 100644 --- a/tools/include/uapi/asm-generic/mman-common.h +++ b/tools/include/uapi/asm-generic/mman-common.h @@ -32,6 +32,7 @@ #define MAP_UNINITIALIZED 0x4000000 /* For anonymous mmap, memory could be * uninitialized */ +#define MAP_BELOW_HINT 0x8000000 /* give out address that is below (inclusive) hint address */ /* * Flags for mlock
Some applications rely on placing data in free bits addresses allocated by mmap. Various architectures (eg. x86, arm64, powerpc) restrict the address returned by mmap to be less than the maximum address space, unless the hint address is greater than this value. To make this behavior explicit and more versatile across all architectures, define a mmap flag that allows users to define an arbitrary upper limit on addresses returned by mmap. Signed-off-by: Charlie Jenkins <charlie@rivosinc.com> --- include/uapi/asm-generic/mman-common.h | 1 + tools/include/uapi/asm-generic/mman-common.h | 1 + 2 files changed, 2 insertions(+)