2018-08-24 03:01:12 +03:00
======================
Memory Management APIs
======================
User Space Memory Access
========================
.. kernel-doc :: arch/x86/include/asm/uaccess.h
:internal:
.. kernel-doc :: arch/x86/lib/usercopy_32.c
:export:
2019-10-01 17:47:47 +03:00
.. kernel-doc :: mm/gup.c
2018-08-24 03:01:12 +03:00
:functions: get_user_pages_fast
2018-09-14 12:27:57 +03:00
.. _mm-api-gfp-flags:
2018-08-24 03:01:19 +03:00
Memory Allocation Controls
==========================
2022-07-06 18:52:24 +03:00
.. kernel-doc :: include/linux/gfp_types.h
2018-08-24 03:01:19 +03:00
:doc: Page mobility and placement hints
2022-07-06 18:52:24 +03:00
.. kernel-doc :: include/linux/gfp_types.h
2018-08-24 03:01:19 +03:00
:doc: Watermark modifiers
2022-07-06 18:52:24 +03:00
.. kernel-doc :: include/linux/gfp_types.h
2018-08-24 03:01:19 +03:00
:doc: Reclaim modifiers
2022-07-06 18:52:24 +03:00
.. kernel-doc :: include/linux/gfp_types.h
2019-01-14 21:32:58 +03:00
:doc: Useful GFP flag combinations
2018-08-24 03:01:19 +03:00
2018-08-24 03:01:12 +03:00
The Slab Cache
==============
.. kernel-doc :: include/linux/slab.h
:internal:
2023-11-20 19:11:10 +03:00
.. kernel-doc :: mm/slub.c
2018-08-24 03:01:12 +03:00
:export:
2018-12-07 00:13:01 +03:00
.. kernel-doc :: mm/slab_common.c
:export:
2018-08-24 03:01:12 +03:00
.. kernel-doc :: mm/util.c
:functions: kfree_const kvmalloc_node kvfree
2018-11-28 17:45:44 +03:00
Virtually Contiguous Mappings
=============================
.. kernel-doc :: mm/vmalloc.c
:export:
File Mapping and Page Cache
===========================
2018-08-24 03:01:12 +03:00
2022-03-23 00:38:51 +03:00
Filemap
-------
2018-08-24 03:01:12 +03:00
.. kernel-doc :: mm/filemap.c
:export:
2022-03-23 00:38:51 +03:00
Readahead
---------
.. kernel-doc :: mm/readahead.c
:doc: Readahead Overview
.. kernel-doc :: mm/readahead.c
:export:
Writeback
---------
2018-11-28 17:45:44 +03:00
.. kernel-doc :: mm/page-writeback.c
2018-08-24 03:01:12 +03:00
:export:
2022-03-23 00:38:51 +03:00
Truncate
--------
2018-11-28 17:45:44 +03:00
.. kernel-doc :: mm/truncate.c
2018-08-24 03:01:12 +03:00
:export:
2020-04-02 07:07:55 +03:00
.. kernel-doc :: include/linux/pagemap.h
:internal:
2018-11-28 17:45:44 +03:00
Memory pools
============
2018-08-24 03:01:12 +03:00
.. kernel-doc :: mm/mempool.c
:export:
2018-11-28 17:45:44 +03:00
DMA pools
=========
2018-08-24 03:01:12 +03:00
.. kernel-doc :: mm/dmapool.c
:export:
2018-11-28 17:45:44 +03:00
More Memory Management Functions
================================
2018-08-24 03:01:12 +03:00
2018-11-28 17:45:44 +03:00
.. kernel-doc :: mm/memory.c
2018-08-24 03:01:12 +03:00
:export:
2018-11-28 17:45:44 +03:00
.. kernel-doc :: mm/page_alloc.c
2021-04-30 09:01:27 +03:00
.. kernel-doc :: mm/mempolicy.c
2021-04-30 08:59:34 +03:00
.. kernel-doc :: include/linux/mm_types.h
:internal:
2021-02-25 17:47:41 +03:00
.. kernel-doc :: include/linux/mm_inline.h
2020-12-07 06:22:48 +03:00
.. kernel-doc :: include/linux/page-flags.h
2021-04-30 08:59:34 +03:00
.. kernel-doc :: include/linux/mm.h
:internal:
2021-03-31 17:39:55 +03:00
.. kernel-doc :: include/linux/page_ref.h
2021-04-30 09:02:16 +03:00
.. kernel-doc :: include/linux/mmzone.h
mm/util: Add folio_mapping() and folio_file_mapping()
These are the folio equivalent of page_mapping() and page_file_mapping().
Add an out-of-line page_mapping() wrapper around folio_mapping()
in order to prevent the page_folio() call from bloating every caller
of page_mapping(). Adjust page_file_mapping() and page_mapping_file()
to use folios internally. Rename __page_file_mapping() to
swapcache_mapping() and change it to take a folio.
This ends up saving 122 bytes of text overall. folio_mapping() is
45 bytes shorter than page_mapping() was, but the new page_mapping()
wrapper is 30 bytes. The major reduction is a few bytes less in dozens
of nfs functions (which call page_file_mapping()). Most of these appear
to be a slight change in gcc's register allocation decisions, which allow:
48 8b 56 08 mov 0x8(%rsi),%rdx
48 8d 42 ff lea -0x1(%rdx),%rax
83 e2 01 and $0x1,%edx
48 0f 44 c6 cmove %rsi,%rax
to become:
48 8b 46 08 mov 0x8(%rsi),%rax
48 8d 78 ff lea -0x1(%rax),%rdi
a8 01 test $0x1,%al
48 0f 44 fe cmove %rsi,%rdi
for a reduction of a single byte. Once the NFS client is converted to
use folios, this entire sequence will disappear.
Also add folio_mapping() documentation.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Jeff Layton <jlayton@kernel.org>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: William Kucharski <william.kucharski@oracle.com>
Reviewed-by: David Howells <dhowells@redhat.com>
2020-12-10 18:55:05 +03:00
.. kernel-doc :: mm/util.c
:functions: folio_mapping
2023-08-18 23:06:30 +03:00
.. kernel-doc :: mm/rmap.c
.. kernel-doc :: mm/migrate.c
.. kernel-doc :: mm/mmap.c
.. kernel-doc :: mm/kmemleak.c
.. #kernel-doc:: mm/hmm.c (build warnings)
.. kernel-doc :: mm/memremap.c
.. kernel-doc :: mm/hugetlb.c
.. kernel-doc :: mm/swap.c
.. kernel-doc :: mm/zpool.c
.. kernel-doc :: mm/memcontrol.c
.. #kernel-doc:: mm/memory-tiers.c (build warnings)
.. kernel-doc :: mm/shmem.c
.. kernel-doc :: mm/migrate_device.c
.. #kernel-doc:: mm/nommu.c (duplicates kernel-doc from other files)
.. kernel-doc :: mm/mapping_dirty_helpers.c
.. #kernel-doc:: mm/memory-failure.c (build warnings)
.. kernel-doc :: mm/percpu.c
.. kernel-doc :: mm/maccess.c
.. kernel-doc :: mm/vmscan.c
.. kernel-doc :: mm/memory_hotplug.c
.. kernel-doc :: mm/mmu_notifier.c
.. kernel-doc :: mm/balloon_compaction.c
.. kernel-doc :: mm/huge_memory.c
.. kernel-doc :: mm/io-mapping.c