]> git.tuebingen.mpg.de Git - aple.git/commitdiff
Merge topic branch t/misc into pu pu
authorAndre Noll <maan@tuebingen.mpg.de>
Thu, 25 Jan 2024 16:23:04 +0000 (17:23 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Thu, 25 Jan 2024 16:23:04 +0000 (17:23 +0100)
* refs/heads/t/misc:
  Turn exercise about number of path into regular text
  networking: Turn homework on NAT into a subsection.

Filesystems.m4
Unix_Concepts.m4

index 40dedd1aca314193f2748c886aad706533223604..7750dab91c6fdbd2ef701e0d355fbd51b731ebfd 100644 (file)
@@ -829,6 +829,27 @@ it's best to make the LV slightly larger than necessary and then
 enlarge the filesystem to the maximal possible size by running
 <code>resize2fs(8)</code> without specifying the new size. </p>
 
+SUBSECTION(«Fast Commits»)
+
+<p>
+
+Optimization introduced in 2020 (Linux-5.10).
+
+activated at mkfs time
+
+light-weight journaling method
+
+Idea: parts of the metadata written to the log can instead be derived
+from the inode. Leads to more compact format.
+
+Implementation: additional journal for fast commits, i.e., for those
+operations that can be optimized. Contains changes at the *file* level
+
+<li> Check <code>/proc/fs/ext4/dev/fc_info</code> to see whether fast
+commits are supported in the runing kernel. </li>
+
+</p>
+
 EXERCISES()
 
 <ul>
index ab6cdbb0845fd74527fac7357a043fba66c6cff6..5ab40923b04af82d011d8545e98fd1c7ccf1f780 100644 (file)
@@ -1777,8 +1777,7 @@ SUBSECTION(«Pipes and Redirections»)
 
 <p> The <code>pipe(2)</code> system call takes no arguments and
 creates two file descriptors for the calling process which are tied
-together as a unidirectional first in, first out data channel that
-works just like a fifo, but without any files being involved. One
+together as a unidirectional first in, first out data channel. One
 file descriptor is the <em>read end</em> of the pipe, the other is
 the <em>write end</em>. Data written to the write end is buffered by
 the kernel and can be obtained by reading from the read end. </p>
@@ -1790,6 +1789,18 @@ a copy of both pipe file descriptors. Hence the parent process can
 communicate with the child by writing a message to the write end of
 the pipe for the child to read. </p>
 
+<p> This approach depends on file descriptor inheritance across
+<code>fork(2)</code>, so it does not work in the situation
+where neither process is an ancestor of the other. Files of
+type <em>fifo</em> (named pipes) overcome this restriction. To
+establish a connection between two <em>unrelated</em> processes,
+both processes call <code>open(2)</code> to obtain a file
+descriptor which is associated with the fifo. One process passes
+the <code>O_WRONLY</code> flag to open the file for writing while
+the other passes <code>O_RDONLY</code> to open it for reading. The
+two processes may then communicate in the same way as with the
+<code>pipe(2)/fork(2)</code> approach. </p>
+
 <p> The POSIX <code>dup(2)</code> and <code>dup2(2)</code> system
 calls allow a process to manipulate the entries of its file descriptor
 array. In particular the standard file descriptors 0, 1, and 2 can be
@@ -1814,12 +1825,6 @@ with <code>wc(1)</code>. Since <code>ls(1)</code> writes to stdout
 and <code>wc(1)</code> reads from stdin, <code>wc(1)</code> processes
 the output of <code>ls(1)</code>. </p>
 
-<p> Note that this trick does not work to establish a connection
-between two <em>existing</em> processes because it depends on file
-descriptor inheritance across <code>fork(2)</code>. In the general
-case one has to fall back to sockets or fifos to create the data
-channel. </p>
-
 SUBSECTION(«Stdio»)
 
 <p> The POSIX standard requires a compliant Unix system to provide