3

How do I get the value of PAGE_CACHE_SIZE that is mentioned in man mount?

man mount:

Mount options for tmpfs

size=nbytes Override default maximum size of the filesystem. The size is given in bytes, and rounded up to entire pages. The default is half of the memory. The size parameter also accepts a suffix % to limit this tmpfs instance to that percentage of your physical RAM: the default, when neither size nor nr_blocks is specified, is size=50%.

nr_blocks= The same as size, but in blocks of PAGE_CACHE_SIZE

1 Answer 1

3

Page cache - is the place in RAM where files are stored before writing to disk or after reading from disk. It's reduces delays for I/O operations to/from SSD, HDD, CD ...

tmpfs is the filesystem that lives in RAM permanently so tmpfs lives in page cache.

So page cache lives in RAM and consists of pages.

Page - is the minimum chunk of memory which OS can handle and it size depend on hardware (MMU(memory management unit) in CPU). All operations with memory usually rounded to page size.

Get page size (one of the way):

$ getconf PAGESIZE 4096 

PAGE_CACHE_SIZE in mount command means count of pages. It's easy to check:

# mkdir /mnt/trash # mount -t tmpfs -o nr_blocks=1 tmpfs /mnt/trash/ $ mount | grep trash tmpfs on /mnt/trash type tmpfs (rw,relatime,size=4k) $ df -h|grep trash tmpfs 4.0K 0 4.0K 0% /mnt/trash 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.