if (unlikely(--latency_ration < 0)) { cond_resched(); latency_ration = LATENCY_LIMIT; } 
static inline unsigned long scan_swap_map(struct swap_info_struct *si){	unsigned long offset, last_in_cluster;	/* 	 * We try to cluster swap pages by allocating them sequentially	 * in swap.  Once we've allocated SWAPFILE_CLUSTER pages this	 * way, however, we resort to first-free allocation, starting	 * a new cluster.  This prevents us from scattering swap pages	 * all over the entire swap partition, so that we reduce	 * overall disk seek times between swap pages.  -- sct	 * But we do now try to find an empty cluster.  -Andrea	 */	si->flags += SWP_SCANNING;	if (unlikely(!si->cluster_nr)) {		si->cluster_nr = SWAPFILE_CLUSTER - 1;		if (si->pages - si->inuse_pages < SWAPFILE_CLUSTER)			goto lowest;		swap_device_unlock(si);		offset = si->lowest_bit;		last_in_cluster = offset + SWAPFILE_CLUSTER - 1;		/* Locate the first empty (unaligned) cluster */		for (; last_in_cluster <= si->highest_bit; offset++) {			if (si->swap_map[offset])				last_in_cluster = offset + SWAPFILE_CLUSTER;			else if (offset == last_in_cluster) {				swap_device_lock(si);				si->cluster_next = offset-SWAPFILE_CLUSTER-1;				goto cluster;			}		}		swap_device_lock(si);		goto lowest;	}	si->cluster_nr--;cluster:	offset = si->cluster_next;	if (offset > si->highest_bit)lowest:		offset = si->lowest_bit;checks:	if (!(si->flags & SWP_WRITEOK))		goto no_page;	if (!si->highest_bit)		goto no_page;	if (!si->swap_map[offset]) {		if (offset == si->lowest_bit)			si->lowest_bit++;		if (offset == si->highest_bit)			si->highest_bit--;		si->inuse_pages++;		if (si->inuse_pages == si->pages) {			si->lowest_bit = si->max;			si->highest_bit = 0;		}		si->swap_map[offset] = 1;		si->cluster_next = offset + 1;		si->flags -= SWP_SCANNING;		return offset;	}	swap_device_unlock(si);	while (++offset <= si->highest_bit) {		if (!si->swap_map[offset]) {			swap_device_lock(si);			goto checks;		}	}	swap_device_lock(si);	goto lowest;no_page:	si->flags -= SWP_SCANNING;	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/048c27fd72816b44e096997d1c6901c3abbfd45b/swapfile.c/buggy/mm/swapfile.c