aboutsummaryrefslogtreecommitdiffstats
path: root/man/man2/mremap.2
AgeCommit message (Collapse)AuthorFilesLines
7 daysman/man2/mremap.2: Fix incorrect reference to VM_MIXEDMAPLorenzo Stoakes1-1/+1
We actually disallow VM_DONTEXPAND and VM_PFNMAP for MREMAP_DONTUNMAP, the manpage incorrectly references VM_MIXEDMAP. Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Message-ID: <20251121081609.52462-1-lorenzo.stoakes@oracle.com> Cc: <linux-mm@kvack.org> Cc: <linux-kernel@vger.kernel.org> Cc: "Liam R. Howlett" <Liam.Howlett@oracle.com> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Jann Horn <jannh@google.com> Cc: Pedro Falcato <pfalcato@suse.de> Cc: Rik van Riel <riel@surriel.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-21man/: Use semantic newlinesAlejandro Colomar1-4/+6
And fix related issues while at it. Silence false positives with \&. Reported-by: `make lint-man-semnl` Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-08-20man/man2/mremap.2: Describe previously undocumented shrink behaviourLorenzo Stoakes1-2/+31
There is pre-existing logic that appears to be undocumented for an mremap() shrink operation, where it turns out that the usual 'input range must span a single mapping' requirement no longer applies. In fact, it turns out that the input range specified by [old_address, old_address + old_size) may span any number of mappings. If shrinking in-place (that is, neither the MREMAP_FIXED nor MREMAP_DONTUNMAP flags are specified), then the new span may also span any number of VMAs - [old_address, old_address + new_size). If shrinking and moving, the range specified by [old_address, old_address + new_size) must span a single VMA. There must be at least one VMA contained within the [old_address, old_address + old_size) range, and old_address must be within the range of a VMA. Explicitly document this. Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Message-ID: <ab2264d8c29d103d400c028f0417cada002ffc11.1754924278.git.lorenzo.stoakes@oracle.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-08-19man/man2/mremap.2: Describe multiple-mapping moveLorenzo Stoakes1-11/+57
Document the new behaviour introduced in Linux 6.17 whereby it is now possible to move multiple mappings in a single operation, as long as the operation is purely a move, that is, old_size == new_size and MREMAP_FIXED is specified. This change also explains the limitations of this method and the possibility of partial failure. Finally, we pluralise language where it makes sense to so the documentation does not contradict either this new capability nor the pre-existing edge case. Example code is enclosed below demonstrating the behaviour which is now possible: #define _GNU_SOURCE #include <err.h> #include <stddef.h> #include <stdlib.h> #include <sys/mman.h> #include <unistd.h> int main(void) { void *ptr, *tgt_ptr; size_t page_size; page_size = sysconf(_SC_PAGESIZE); ptr = mmap(NULL, 10 * page_size, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0); if (ptr == MAP_FAILED) err(EXIT_FAILURE, "mmap"); tgt_ptr = mmap(NULL, 10 * page_size, PROT_NONE, MAP_ANON | MAP_PRIVATE, -1, 0); if (tgt_ptr == MAP_FAILED) err(EXIT_FAILURE, "mmap"); /* Unmap every other page. */ for (int i = 1; i < 10; i += 2) munmap(ptr + i * page_size, page_size); /* Now move all 5 distinct mappings to tgt_ptr. */ ptr = mremap(ptr, 10 * page_size, 10 * page_size, MREMAP_MAYMOVE | MREMAP_FIXED, tgt_ptr); if (ptr == MAP_FAILED) err(EXIT_FAILURE, "mremap"); exit(EXIT_SUCCESS); } Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Message-ID: <4e0c992a6374e417367475e3b3bbbc9d43380f4c.1754924278.git.lorenzo.stoakes@oracle.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-08-19man/man2/mremap.2: Explicitly document the simple move operationLorenzo Stoakes1-0/+14
In preparation for discussing newly introduced mremap() behaviour to permit the move of multiple mappings at once, add a section to the this manual page to describe these operations in general. Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Message-ID: <0a5d0d6e9f75e8e2de05506f73c41b069d77de36.1754924278.git.lorenzo.stoakes@oracle.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-06-28man/: SYNOPSIS: Don't highlight forward declarations of function parametersAlejandro Colomar1-1/+1
Previously, many people confused these for actual parameters, since it's hard to distinguish a ',' from ';'. By removing bold/italics from these, it will be easier to distinguish them. The cases have been found with a script: $ find -type f \ | xargs grep -l '^\.TH ' \ | sort \ | xargs mansect SYNOPSIS \ | man /dev/stdin \ | grep -e '^[^ ]' -e '[^ ]( [^ )].*[^)];' \ | less; Reported-by: Mark Naughton <mnaughto@redhat.com> Suggested-by: Mark Harris <mark.hsj@gmail.com> Acked-by: Mark Naughton <mnaughto@redhat.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-05-17*: grfixAlejandro Colomar1-1/+1
Scripted change: $ grep -rl 'The authors of the Linux man-pages' \ | xargs sed -i '/Copyright, The authors of the Linux man-pages project/s/The/the/'; Reported-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-05-10*, AUTHORS: Consistently refer to authorsAlejandro Colomar1-1/+1
- Rename the file CREDITS => AUTHORS - Say 'authors' in the copyright notice. Scripted change: $ grep -rn 'The contributors to the Linux man-pages' -l \ | xargs sed -i '/Copyright, The contributors to the Linux man-pages project/s/contributors to/authors of/' Suggested-by: Dave Martin <Dave.Martin@arm.com> Acked-by: "G. Branden Robinson" <branden@debian.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-05-06*, CREDITS: Unify copyright noticesAlejandro Colomar1-1/+1
Link: <https://lore.kernel.org/linux-man/jpin2dbnp5vpitnh7l4qmvkamzq3h3xljzsznrudgioox3nn72@57uybxbe3h4p/T/#u> Link: <https://www.linuxfoundation.org/blog/blog/copyright-notices-in-open-source-software-projects> Cc: "G. Branden Robinson" <branden@debian.org> Cc: Carlos O'Donell <carlos@redhat.com> Cc: Eugene Syromyatnikov <evgsyr@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-05-06man/, CREDITS: Move in-source contribution records to CREDITSAlejandro Colomar1-6/+0
This information is better placed in the git logs, not in the source code itself. For people interested in the old history of pages, before we used git, they will probably look at old versions of these pages, like for example man-pages-1.70, or the 'prehistory' branch, and there they'll find these notes. Keep the names and emails of contributors in a new CREDITS file. Link: <https://lore.kernel.org/linux-man/jpin2dbnp5vpitnh7l4qmvkamzq3h3xljzsznrudgioox3nn72@57uybxbe3h4p/T/#u> Link: <https://www.linuxfoundation.org/blog/blog/copyright-notices-in-open-source-software-projects> Cc: "G. Branden Robinson" <branden@debian.org> Cc: Carlos O'Donell <carlos@redhat.com> Cc: Eugene Syromyatnikov <evgsyr@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-03-30man/: srcfix (\fX => \f[X])Alejandro Colomar1-21/+51
While doing this global change, fix other minor issues found nearby. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-03-14man/: SYNOPSIS: Use GNU forward-declarations of parameters for sizes of ↵Alejandro Colomar1-1/+2
array parameters This syntax has been proposed for standardization in N3433. Link: <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3433.pdf> Cc: Christopher Bazley <chris.bazley.wg14@gmail.com> Cc: Martin Uecker <uecker@tugraz.at> Cc: Joseph Myers <josmyers@redhat.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-11-13mremap.2: Update information about MREMAP_DONTUNMAP restrictionsAlex Henrie1-1/+7
Link: <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a4609387859f0281951f5e476d9f76d7fb9ab321> Cc: Brian Geffon <bgeffon@google.com> Cc: <linux-mm@kvack.org> Signed-off-by: Alex Henrie <alexhenrie24@gmail.com> Message-ID: <20241111061139.206404-1-alexhenrie24@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-07-23man/: ffixAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-05-02man/, share/mk/: Move man*/ to man/Alejandro Colomar1-0/+357
This is a scripted change: $ mkdir man/; $ mv man* man/; $ ln -st . man/man*; $ find share/mk/ -type f \ | xargs grep -l '^MANDIR *:=' \ | xargs sed -i '/^MANDIR *:=/s,$,/man,'; $ find share/mk/dist/ -type f \ | xargs grep -l man \ | xargs sed -i 's,man%,man/%,g'; Link: <https://lore.kernel.org/linux-man/YxcV4h+Xn7cd6+q2@pevik/T/> Cc: Petr Vorel <pvorel@suse.cz> Cc: Jakub Wilk <jwilk@jwilk.net> Cc: Stefan Puiu <stefan.puiu@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-09-09Revert "src.mk, All pages: Move man* to man/"Alejandro Colomar1-352/+0
This reverts commit 70ac1c4785fc1e158ab2349a962dba2526bf4fbc. Link: <https://lore.kernel.org/linux-man/YxcV4h+Xn7cd6+q2@pevik/T/> Reported-by: Petr Vorel <pvorel@suse.cz> Reported-by: Jakub Wilk <jwilk@jwilk.net> Cc: Stefan Puiu <stefan.puiu@gmail.com> Signed-off-by: Alex Colomar <alx.manpages@gmail.com>
2022-09-05src.mk, All pages: Move man* to man/Alejandro Colomar1-0/+352
The root of the repository is becoming a bit overpopulated and unorganized, due to the recent addition of more mandirs, and more informative and configuration files too. Let's create a specific mandir <man/> that contains the mandirs <man[1-8]*>. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>