On Tue, 08 Jan 2008 15:59:44 -0500
Rik van Riel <[EMAIL PROTECTED]> wrote:

> +     rotate_sum = zone->recent_rotated_file + zone->recent_rotated_anon;
> +
> +     /* Keep a floating average of RECENT references. */
> +     if (unlikely(rotate_sum > min(anon, file))) {
> +             spin_lock_irq(&zone->lru_lock);
> +             zone->recent_rotated_file /= 2;
> +             zone->recent_rotated_anon /= 2;
> +             spin_unlock_irq(&zone->lru_lock);
> +             rotate_sum /= 2;
> +     }
> +
> +     /*
> +      * With swappiness at 100, anonymous and file have the same priority.
> +      * This scanning priority is essentially the inverse of IO cost.
> +      */
> +     anon_prio = sc->swappiness;
> +     file_prio = 200 - sc->swappiness;
> +
> +     /*
> +      *                  anon       recent_rotated_anon
> +      * %anon = 100 * ----------- / ------------------- * IO cost
> +      *               anon + file       rotate_sum
> +      */
> +     ap = (anon_prio * anon) / (anon + file + 1);
> +     ap *= rotate_sum / (zone->recent_rotated_anon + 1);
> +     if (ap == 0)
> +             ap = 1;
> +     else if (ap > 100)
> +             ap = 100;
> +     percent[0] = ap;
> +

Hmm, it seems..

When a program copies large amount of files, recent_rotated_file increases
rapidly and 

    rotate_sum
    ----------
recent_rotated_anon

will be very big.

And %ap will be big regardless of vm_swappiness  if it's not 0.

I think # of recent_successful_pageout(anon/file) should be took into account...

I'm sorry if I miss something.

Thanks,
-Kame

--
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/

Reply via email to