Re: Duplicate data in Page Cache

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

 



Adil Mujeeb wrote:
Hi list,

I was going through the chapter 15: The Page Cache of "Understanding the Linux Kernel".

It was written under "The address_space Object" section:

Quite surprisingly, the page cache may happily contain multiple copies of the same disk data. For instance, the same 4-KB block of data of a regular file can be accessed in the following ways:

- Reading the file; hence, the data is included in a page owned by the regular file's inode.

- Reading the block from the device file (disk partition) that hosts the file; hence, the data is included in a page owned by the master inode of the block device file.

I did not understand this part. How the duplicate pages will be present in the Page cache. Anybody could please elaborate it further.

One page will have page->mapping point to the file's
address_space and have page->index set to offset of
this page into the file.

The other page has page->mapping point to the block
device's address_space and have page->index set to
this page's offset into the block device.

--
Politics is the struggle between those who want to make their country
the best in the world, and those who believe it already is.  Each group
calls the other unpatriotic.

--
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