Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • I thought there was still a "swap cache". I.e. if the page in the swap device is still up to date, then it is possible to simply free the in-memory page, without allocating and writing a new page in the swap device. At least, /proc/vmstat is still showing non-zero nr_swapcached on my system. I think the OP wants to know what happens in this situation (and I have tried to answer accordingly). Commented Apr 23, 2024 at 16:07
  • @sourcejedi Thanks, rereading maybe that's what they were referring to indeed. I'll add a short bit and try to do it without duplicating your answer too much. Commented Apr 23, 2024 at 18:00
  • @ChrisDown Thank you! I did mean cases involving mmap where there is a backing file descriptor, which you cover that in your second paragraph. I appreciate your having covered the other case as well. Commented Jun 2, 2024 at 21:08