I stopped reading when it starts explaining what's memory management.
In contrast I found the explanation written by the original author an engaging read: https://dirtypipe.cm4all.com/
I never knew that the standard command pipe is an “anonymous pipe”, but now “named pipes” make more sense.
I guess hardware RWX permissions on disks would be useful for this sort of thing.
> pipe flag “PIPE_BUF_FLAG_CAN_MERGE”, which signifies that the data buffer inside the pipe can be merged, i.e, this flag notifies the kernel that the changes which are written to the page cache pointed to by the pipe shall be written back to the file
That's not what this flag does. No pipe flag can ever cause writing dirty pages back to disk, because pipes have by definition nothing to do with files.
The CAN_MERGE flag tells the kernel that the next write() to the pipe can append data to this pipe buffer until it's full, instead of creating a new pipe buffer for every write().