Swap cache

Muthu (MOLAGAPP.IN.ORACLE.COM.ofcmail@in.oracle.com)
14 Dec 98 16:49:08 +0530


Hi,

I took a look at "kernel hackers guide". I have a basic doubt about
"swap
cache".

In "kernel hackers guide" it is specified that use of swap cache is to
"know if a page is already present in swap file or not". It also
specfies
that if a page is accessed for read and then write ,"two page faults will
happen - one for loading the page in read-mode and another to invalidate
swap
cache"

To my knowledge, this can be implemented in page-table entry.

page-table entry contains a "dirty" bit which specifies if the page is
modified or not.
Hence, load the page from swap file in read & write mode. If the page is
modified, then "dirty" bit is set. This means, the page has to be written to
swap file else it is present in swap file already.

So, the purpose of "swap cache" can be solved by looking at "dirty" bit
in
page table entry.

Please correct me if Iam wrong and comment on this.

Regards,

Muthu. O.L.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/