~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/Documentation/arch/powerpc/vmemmap_dedup.rst

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 .. SPDX-License-Identifier: GPL-2.0
  2 
  3 ==========
  4 Device DAX
  5 ==========
  6 
  7 The device-dax interface uses the tail deduplication technique explained in
  8 Documentation/mm/vmemmap_dedup.rst
  9 
 10 On powerpc, vmemmap deduplication is only used with radix MMU translation. Also
 11 with a 64K page size, only the devdax namespace with 1G alignment uses vmemmap
 12 deduplication.
 13 
 14 With 2M PMD level mapping, we require 32 struct pages and a single 64K vmemmap
 15 page can contain 1024 struct pages (64K/sizeof(struct page)). Hence there is no
 16 vmemmap deduplication possible.
 17 
 18 With 1G PUD level mapping, we require 16384 struct pages and a single 64K
 19 vmemmap page can contain 1024 struct pages (64K/sizeof(struct page)). Hence we
 20 require 16 64K pages in vmemmap to map the struct page for 1G PUD level mapping.
 21 
 22 Here's how things look like on device-dax after the sections are populated::
 23  +-----------+ ---virt_to_page---> +-----------+   mapping to   +-----------+
 24  |           |                     |     0     | -------------> |     0     |
 25  |           |                     +-----------+                +-----------+
 26  |           |                     |     1     | -------------> |     1     |
 27  |           |                     +-----------+                +-----------+
 28  |           |                     |     2     | ----------------^ ^ ^ ^ ^ ^
 29  |           |                     +-----------+                   | | | | |
 30  |           |                     |     3     | ------------------+ | | | |
 31  |           |                     +-----------+                     | | | |
 32  |           |                     |     4     | --------------------+ | | |
 33  |    PUD    |                     +-----------+                       | | |
 34  |   level   |                     |     .     | ----------------------+ | |
 35  |  mapping  |                     +-----------+                         | |
 36  |           |                     |     .     | ------------------------+ |
 37  |           |                     +-----------+                           |
 38  |           |                     |     15    | --------------------------+
 39  |           |                     +-----------+
 40  |           |
 41  |           |
 42  |           |
 43  +-----------+
 44 
 45 
 46 With 4K page size, 2M PMD level mapping requires 512 struct pages and a single
 47 4K vmemmap page contains 64 struct pages(4K/sizeof(struct page)). Hence we
 48 require 8 4K pages in vmemmap to map the struct page for 2M pmd level mapping.
 49 
 50 Here's how things look like on device-dax after the sections are populated::
 51 
 52  +-----------+ ---virt_to_page---> +-----------+   mapping to   +-----------+
 53  |           |                     |     0     | -------------> |     0     |
 54  |           |                     +-----------+                +-----------+
 55  |           |                     |     1     | -------------> |     1     |
 56  |           |                     +-----------+                +-----------+
 57  |           |                     |     2     | ----------------^ ^ ^ ^ ^ ^
 58  |           |                     +-----------+                   | | | | |
 59  |           |                     |     3     | ------------------+ | | | |
 60  |           |                     +-----------+                     | | | |
 61  |           |                     |     4     | --------------------+ | | |
 62  |    PMD    |                     +-----------+                       | | |
 63  |   level   |                     |     5     | ----------------------+ | |
 64  |  mapping  |                     +-----------+                         | |
 65  |           |                     |     6     | ------------------------+ |
 66  |           |                     +-----------+                           |
 67  |           |                     |     7     | --------------------------+
 68  |           |                     +-----------+
 69  |           |
 70  |           |
 71  |           |
 72  +-----------+
 73 
 74 With 1G PUD level mapping, we require 262144 struct pages and a single 4K
 75 vmemmap page can contain 64 struct pages (4K/sizeof(struct page)). Hence we
 76 require 4096 4K pages in vmemmap to map the struct pages for 1G PUD level
 77 mapping.
 78 
 79 Here's how things look like on device-dax after the sections are populated::
 80 
 81  +-----------+ ---virt_to_page---> +-----------+   mapping to   +-----------+
 82  |           |                     |     0     | -------------> |     0     |
 83  |           |                     +-----------+                +-----------+
 84  |           |                     |     1     | -------------> |     1     |
 85  |           |                     +-----------+                +-----------+
 86  |           |                     |     2     | ----------------^ ^ ^ ^ ^ ^
 87  |           |                     +-----------+                   | | | | |
 88  |           |                     |     3     | ------------------+ | | | |
 89  |           |                     +-----------+                     | | | |
 90  |           |                     |     4     | --------------------+ | | |
 91  |    PUD    |                     +-----------+                       | | |
 92  |   level   |                     |     .     | ----------------------+ | |
 93  |  mapping  |                     +-----------+                         | |
 94  |           |                     |     .     | ------------------------+ |
 95  |           |                     +-----------+                           |
 96  |           |                     |   4095    | --------------------------+
 97  |           |                     +-----------+
 98  |           |
 99  |           |
100  |           |
101  +-----------+

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php