2018-08-23 17:01:12 -07: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 08:47:47 -06:00
.. kernel-doc :: mm/gup.c
2018-08-23 17:01:12 -07:00
:functions: get_user_pages_fast
2018-09-14 12:27:57 +03:00
.. _mm-api-gfp-flags:
2018-08-23 17:01:19 -07:00
Memory Allocation Controls
==========================
2022-07-06 08:52:24 -07:00
.. kernel-doc :: include/linux/gfp_types.h
2018-08-23 17:01:19 -07:00
:doc: Page mobility and placement hints
2022-07-06 08:52:24 -07:00
.. kernel-doc :: include/linux/gfp_types.h
2018-08-23 17:01:19 -07:00
:doc: Watermark modifiers
2022-07-06 08:52:24 -07:00
.. kernel-doc :: include/linux/gfp_types.h
2018-08-23 17:01:19 -07:00
:doc: Reclaim modifiers
2022-07-06 08:52:24 -07:00
.. kernel-doc :: include/linux/gfp_types.h
2019-01-14 20:32:58 +02:00
:doc: Useful GFP flag combinations
2018-08-23 17:01:19 -07:00
2018-08-23 17:01:12 -07:00
The Slab Cache
==============
.. kernel-doc :: include/linux/slab.h
:internal:
.. kernel-doc :: mm/slab.c
:export:
2018-12-06 23:13:01 +02:00
.. kernel-doc :: mm/slab_common.c
:export:
2018-08-23 17:01:12 -07:00
.. kernel-doc :: mm/util.c
:functions: kfree_const kvmalloc_node kvfree
2018-11-28 16:45:44 +02:00
Virtually Contiguous Mappings
=============================
.. kernel-doc :: mm/vmalloc.c
:export:
File Mapping and Page Cache
===========================
2018-08-23 17:01:12 -07:00
2022-03-22 14:38:51 -07:00
Filemap
-------
2018-08-23 17:01:12 -07:00
.. kernel-doc :: mm/filemap.c
:export:
2022-03-22 14:38:51 -07:00
Readahead
---------
.. kernel-doc :: mm/readahead.c
:doc: Readahead Overview
.. kernel-doc :: mm/readahead.c
:export:
Writeback
---------
2018-11-28 16:45:44 +02:00
.. kernel-doc :: mm/page-writeback.c
2018-08-23 17:01:12 -07:00
:export:
2022-03-22 14:38:51 -07:00
Truncate
--------
2018-11-28 16:45:44 +02:00
.. kernel-doc :: mm/truncate.c
2018-08-23 17:01:12 -07:00
:export:
2020-04-01 21:07:55 -07:00
.. kernel-doc :: include/linux/pagemap.h
:internal:
2018-11-28 16:45:44 +02:00
Memory pools
============
2018-08-23 17:01:12 -07:00
.. kernel-doc :: mm/mempool.c
:export:
2018-11-28 16:45:44 +02:00
DMA pools
=========
2018-08-23 17:01:12 -07:00
.. kernel-doc :: mm/dmapool.c
:export:
2018-11-28 16:45:44 +02:00
More Memory Management Functions
================================
2018-08-23 17:01:12 -07:00
2018-11-28 16:45:44 +02:00
.. kernel-doc :: mm/memory.c
2018-08-23 17:01:12 -07:00
:export:
2018-11-28 16:45:44 +02:00
.. kernel-doc :: mm/page_alloc.c
2021-04-29 23:01:27 -07:00
.. kernel-doc :: mm/mempolicy.c
2021-04-29 22:59:34 -07:00
.. kernel-doc :: include/linux/mm_types.h
:internal:
2021-02-25 09:47:41 -05:00
.. kernel-doc :: include/linux/mm_inline.h
2020-12-06 22:22:48 -05:00
.. kernel-doc :: include/linux/page-flags.h
2021-04-29 22:59:34 -07:00
.. kernel-doc :: include/linux/mm.h
:internal:
2021-03-31 10:39:55 -04:00
.. kernel-doc :: include/linux/page_ref.h
2021-04-29 23:02:16 -07: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 10:55:05 -05:00
.. kernel-doc :: mm/util.c
:functions: folio_mapping