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

shrink_mmap ()?




Hi,

I was going through the source for shrink_mmap.......

The attached code puzzled me..

We are freeing a page with count = 1 (referenced by one process only) but
we are not manipulating any page table entries. Why? Shouldnt we be
manipulating the page table entries or where are the page table entries
getting manipulated?

I know I have missed something terribly obvious over here. Can someone
please help me out. 

Thanks.

-- Chirayu

-----------------------------------------------------------------------
switch (atomic_read(&page->count)) {
	case 1:
		/* is it a swap-cache or page-cache page? */
		if (page->inode) {
			if (test_and_clear_bit(PG_referenced,
                                               &page->flags)) {
				touch_page(page);
				break;
			}
			age_page(page);
			if (page->age)
				break;
			if (PageSwapCache(page)) {
				delete_from_swap_cache(page);
				return 1;
			}
			remove_page_from_hash_queue(page);
			remove_page_from_inode_queue(page);
			__free_page(page);
			return 1;
		}
------------------------------------------------------------------------------