[lc-checkins] CVS: linux26/mm vmscan.c, 1.12, 1.13 swapfile.c, 1.3, 1.4
Status: Beta
Brought to you by:
nitin_sf
From: Nitin G. <nit...@us...> - 2006-06-11 20:03:53
|
Update of /cvsroot/linuxcompressed/linux26/mm In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27793/mm Modified Files: swapfile.c Added Files: vmscan.c Log Message: anon page work moves fwd :) Index: swapfile.c =================================================================== RCS file: /cvsroot/linuxcompressed/linux26/mm/swapfile.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** swapfile.c 3 Jun 2006 14:05:28 -0000 1.3 --- swapfile.c 11 Jun 2006 20:03:48 -0000 1.4 *************** *** 91,94 **** --- 91,95 ---- int latency_ration = LATENCY_LIMIT; + pr_info("** start scan_swap_map **\n"); /* * We try to cluster swap pages by allocating them sequentially *************** *** 151,154 **** --- 152,156 ---- si->cluster_next = offset + 1; si->flags -= SWP_SCANNING; + pr_info("** scan_map: return in mid **\n"); return offset; } *************** *** 170,173 **** --- 172,176 ---- no_page: si->flags -= SWP_SCANNING; + pr_info("** end scan_swap_map **\n"); return 0; } *************** *** 193,197 **** wrapped++; } ! if (!si->highest_bit) continue; --- 196,202 ---- wrapped++; } ! ! pr_info("get_swap_page loop\n"); ! if (!si->highest_bit) continue; *************** *** 1332,1335 **** --- 1337,1345 ---- seq_puts(swap, "Filename\t\t\t\tType\t\tSize\tUsed\tPriority\n"); + if (ptr->flags & SWP_COMPRESSED) { + pr_info("virt swap to be printed\n"); + return 0; + } + file = ptr->swap_file; len = seq_path(swap, file->f_vfsmnt, file->f_dentry, " \t\n\\"); *************** *** 1375,1378 **** --- 1385,1398 ---- #endif /* CONFIG_PROC_FS */ + int is_page_in_virt_swap(struct page *page) + { + swp_entry_t entry=(swp_entry_t) { page_private(page) }; + unsigned int type=swp_type(entry); + if (swap_info[type].flags & SWP_COMPRESSED) { + pr_info("This is virt swap\n"); + return 1; + } + return 0; + } int set_anon_cc_size(unsigned long num_pages) *************** *** 1384,1388 **** struct swap_extent *new_se; ! printk(KERN_INFO "set_anon_cc_size called\n"); error=0; --- 1404,1408 ---- struct swap_extent *new_se; ! pr_info("set_anon_cc_size called\n"); error=0; *************** *** 1392,1395 **** --- 1412,1422 ---- if (!(p->flags & SWP_USED)) break; + if (type > swp_type(pte_to_swp_entry(swp_entry_to_pte(swp_entry(~0UL,0))))) { + spin_unlock(&swap_lock); + goto out; + } + if (type >= nr_swapfiles) + nr_swapfiles = type+1; + maxpages = num_pages; *************** *** 1404,1408 **** p->inuse_pages = 0; p->max = maxpages; ! p->pages = maxpages; p->cluster_next = 1; p->prio = 100; --- 1431,1435 ---- p->inuse_pages = 0; p->max = maxpages; ! p->pages = maxpages - 1; // -------------- p->cluster_next = 1; p->prio = 100; *************** *** 1436,1441 **** spin_lock(&swap_lock); p->flags = SWP_ACTIVE | SWP_COMPRESSED; ! nr_swap_pages += maxpages; ! total_swap_pages += maxpages; /* insert swap space into swap_list */ --- 1463,1468 ---- spin_lock(&swap_lock); p->flags = SWP_ACTIVE | SWP_COMPRESSED; ! nr_swap_pages += maxpages - 1; // -------------- ! total_swap_pages += maxpages - 1; // ------------------ /* insert swap space into swap_list */ *************** *** 1459,1463 **** out: ! printk(KERN_INFO "Error initializing anon compressed swap.\n"); return error; } --- 1486,1490 ---- out: ! pr_info("Error initializing anon compressed swap.\n"); return error; } *************** *** 1655,1660 **** */ maxpages = swp_offset(pte_to_swp_entry(swp_entry_to_pte(swp_entry(0,~0UL)))) - 1; ! if (maxpages > swap_header->info.last_page) maxpages = swap_header->info.last_page; p->highest_bit = maxpages - 1; --- 1682,1689 ---- */ maxpages = swp_offset(pte_to_swp_entry(swp_entry_to_pte(swp_entry(0,~0UL)))) - 1; ! if (maxpages > swap_header->info.last_page) { maxpages = swap_header->info.last_page; + pr_info("in sys_swapon swap_header->info.last_page: %lu\n", maxpages); + } p->highest_bit = maxpages - 1; *************** *** 1715,1718 **** --- 1744,1748 ---- spin_lock(&swap_lock); p->flags = SWP_ACTIVE; + pr_info("in sys_swapon: nr_good_pages: %u\n", nr_good_pages); nr_swap_pages += nr_good_pages; total_swap_pages += nr_good_pages; *************** *** 1809,1812 **** --- 1839,1847 ---- offset = swp_offset(entry); + pr_info("swp_dup: offset: %lu\n", offset); + pr_info("swp_dup: p->max: %u\n", p->max); + if (offset < p->max) pr_info("swp_dup: p->swap_map[offset]: %d\n", p->swap_map[offset]); + + spin_lock(&swap_lock); if (offset < p->max && p->swap_map[offset]) { |