Re: [RFC PATCH 2/10] free swap space entries if vm_swap_full()

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

 



On Sat, 3 Nov 2007, Rik van Riel wrote:

> @@ -1142,14 +1145,13 @@ force_reclaim_mapped:
>  		}
>  	}
>  	__mod_zone_page_state(zone, NR_INACTIVE, pgmoved);
> +	spin_unlock_irq(&zone->lru_lock);
>  	pgdeactivate += pgmoved;
> -	if (buffer_heads_over_limit) {
> -		spin_unlock_irq(&zone->lru_lock);
> -		pagevec_strip(&pvec);
> -		spin_lock_irq(&zone->lru_lock);
> -	}
>  
> +	if (buffer_heads_over_limit)
> +		pagevec_strip(&pvec);
>  	pgmoved = 0;
> +	spin_lock_irq(&zone->lru_lock);
>  	while (!list_empty(&l_active)) {
>  		page = lru_to_page(&l_active);
>  		prefetchw_prev_lru_page(page, &l_active, flags);

Why are we dropping the lock here now? There would be less activity
on the lru_lock if we would only drop it if necessary.

> @@ -1163,6 +1165,8 @@ force_reclaim_mapped:
>  			__mod_zone_page_state(zone, NR_ACTIVE, pgmoved);
>  			pgmoved = 0;
>  			spin_unlock_irq(&zone->lru_lock);
> +			if (vm_swap_full())
> +				pagevec_swap_free(&pvec);
>  			__pagevec_release(&pvec);
>  			spin_lock_irq(&zone->lru_lock);
>  		}

Same here. Maybe the spin_unlock and the spin_lock can go into
pagevec_swap_free?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux