Re: anonymous pages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



After doing some reading, into old linux kernel documentation, and
Solaris Internals documentation, these are my new-found understanding,
please criticize if u want:

a.   Firstly, as shown in the different slab types in /proc/slabinfo,
 anonymous pages are mainly for userspace memory, whereas the
 non-anonymous memory slabs are reserved for the different kernel
 memory types.   Correct?   And that is why it can be swapped out, as
 kernel memory pages are not swappable.

 b.   Next is the virtual memory space of the process - it is either
 file-backed (file in this context is not swapfile, and it can be
anything that has an inode), or anonymous memory (which is
swap-backed).   Anonymous are for example like
 copy-on-write memory, stack, heap, etc.   File-backed are basically
linked to the inode in the filesystem.   Usage of file-backed memory
are like the read-only segment mappings for ELF image - the ELF's text
segment are readonly, and so no need to map to swap.

(Question:  what if the swapfile is a ext2 file, not a partition, then
can u call that anonymous memory? Or is it not worth arguing, only for
academic purposes.)

The intermediary that linked these two types of memory and the
physical storage is the pagecache (for inode) and swapcache (for
anonymous page).

c.    "Anonymous pages are always created in response to a request for
 memory from a single process (eg, using malloc()); as a result, they
are never shared at
 creation time."   This is quoted from lwn.net, but what if the memory
is allocated with MAP_SHARED?

There are a lot more information in these area here:

http://www.opensolaris.org/os/community/edu/curriculum_development/
==> surprisingly, a lot of the stuff here mapped to what that has been
said in lwn.net, except that lwn.net is much more dispersed and
difficult to find.   (just switch terms and vnode and inode will
help).

http://lwn.net/Articles/75198/
http://linux-mm.org/PageReplacementDesign

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux