Re: [PATCH 2/2] memcg fix stale swap cache account leak v6

From: Ingo Molnar
Date: Fri May 08 2009 - 07:39:32 EST


x
* KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:

> +struct swapio_check {
> + spinlock_t lock;
> + void *swap_bio_list;
> + struct delayed_work work;
> +} stale_swap_check;

Small nit. It's nice that you lined up the first two fields, but it
would be nice to line up the third one too:

struct swapio_check {
spinlock_t lock;
void *swap_bio_list;
struct delayed_work work;
} stale_swap_check;

> + while (nr--) {
> + cond_resched();
> + spin_lock_irq(&sc->lock);
> + bio = sc->swap_bio_list;

> @@ -66,6 +190,7 @@ static void end_swap_bio_write(struct bi
> (unsigned long long)bio->bi_sector);
> ClearPageReclaim(page);
> }
> + mem_cgroup_swapio_check_again(bio, page);

Hm, this patch adds quite a bit of scanning overhead to
end_swap_bio_write(), to work around artifacts of a global LRU not
working well with a partitioned system's per-partition LRU needs.

Isnt the right solution to have a better LRU that is aware of this,
instead of polling around in the hope of cleaning up stale entries?

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/