1.1 --- a/docs/wiki/Paging Sun Dec 11 00:53:17 2022 +0100
1.2 +++ b/docs/wiki/Paging Sun Dec 11 01:22:29 2022 +0100
1.3 @@ -2,8 +2,13 @@
1.4
1.5 Within filesystem servers, a number of abstractions are combined to support
1.6 [[FilesystemAccess|access to filesystem content]] through paging: the delivery
1.7 -of content to clients in mapped memory. The general mechanism used to support
1.8 -paging is depicted below.
1.9 +of content to clients in mapped memory.
1.10 +
1.11 +<<TableOfContents(2,3)>>
1.12 +
1.13 +== Overview ==
1.14 +
1.15 +The general mechanism used to support paging is depicted below.
1.16
1.17 ######## A graph showing the general paging mechanism
1.18
1.19 @@ -97,6 +102,98 @@
1.20 available or are no longer valid. It also requests the population of such
1.21 pages through use of the associated `Accessor` for the file concerned.
1.22
1.23 +== Pagers and Files ==
1.24 +
1.25 +Each `PageMapper` is responsible for a particular file, and where multiple
1.26 +`Pager` objects provide access to a file for different clients, these will all
1.27 +share the same `PageMapper` and thus the same `AccessMap` and `Accessor`. The
1.28 +`PageMapper` is initialised when a [[Server Library#Providers|`Provider`]]
1.29 +object is created to represent a file.
1.30 +
1.31 +######## A graph showing the relationships between pagers and files
1.32 +
1.33 +{{{#!graphviz
1.34 +#format svg
1.35 +#transform notugly
1.36 +digraph pagers_and_files {
1.37 + node [fontsize="12.0",fontname="sans-serif",shape=box];
1.38 + edge [fontsize="12.0",fontname="sans-serif"];
1.39 + rankdir=LR;
1.40 +
1.41 + subgraph {
1.42 + rank=same;
1.43 +
1.44 + Pager_note12 [shape=note,style=filled,fillcolor=gold,
1.45 + label="Provides\nfilesystem\ncontent\nfor file #1"];
1.46 +
1.47 + Pager1 [label="Pager"];
1.48 + Pager2 [label="Pager"];
1.49 + Pager3 [label="Pager"];
1.50 +
1.51 + Pager_note3 [shape=note,style=filled,fillcolor=gold,
1.52 + label="Provides\nfilesystem\ncontent\nfor file #2"];
1.53 +
1.54 + Pager_note12 -> Pager1 -> Pager2 [dir=none,style=dotted];
1.55 + Pager3 -> Pager_note3 [dir=none,style=dotted];
1.56 + }
1.57 +
1.58 + subgraph {
1.59 + rank=same;
1.60 +
1.61 + PageMapper1_note [shape=note,style=filled,fillcolor=gold,
1.62 + label="Provides\npopulated\nfile pages\nfor file #1"];
1.63 +
1.64 + PageMapper1 [label="PageMapper"];
1.65 + PageMapper2 [label="PageMapper"];
1.66 +
1.67 + PageMapper2_note [shape=note,style=filled,fillcolor=gold,
1.68 + label="Provides\npopulated\nfile pages\nfor file #2"];
1.69 +
1.70 + PageMapper1_note -> PageMapper1 [dir=none,style=dotted];
1.71 + PageMapper2 -> PageMapper2_note [dir=none,style=dotted];
1.72 + }
1.73 +
1.74 + subgraph {
1.75 + rank=same;
1.76 +
1.77 + AccessMap1_note [shape=note,style=filled,fillcolor=gold,
1.78 + label="Manages\nfile pages\nfor file #1"];
1.79 +
1.80 + AccessMap1 [label="AccessMap"];
1.81 + AccessMap2 [label="AccessMap"];
1.82 +
1.83 + AccessMap2_note [shape=note,style=filled,fillcolor=gold,
1.84 + label="Manages\nfile pages\nfor file #2"];
1.85 +
1.86 + AccessMap1_note -> AccessMap1 [dir=none,style=dotted];
1.87 + AccessMap2 -> AccessMap2_note [dir=none,style=dotted];
1.88 + }
1.89 +
1.90 + subgraph {
1.91 + rank=same;
1.92 +
1.93 + Accessor_note [shape=note,style=filled,fillcolor=gold,label="Populates\nfile pages"];
1.94 + Accessor;
1.95 +
1.96 + Accessor_note -> Accessor [dir=none,style=dotted];
1.97 + }
1.98 +
1.99 + /* Relationships. */
1.100 +
1.101 + Pager1 -> PageMapper1;
1.102 + Pager2 -> PageMapper1;
1.103 + Pager3 -> PageMapper2;
1.104 +
1.105 + PageMapper1 -> AccessMap1;
1.106 + PageMapper2 -> AccessMap2;
1.107 +
1.108 + PageMapper1 -> Accessor;
1.109 + PageMapper2 -> Accessor;
1.110 +}
1.111 +}}}
1.112 +
1.113 +########
1.114 +
1.115 == Obtaining and Queuing Pages ==
1.116
1.117 The `Pages` object may either obtain new memory pages from a `Memory` object