Re: [PATCH] mm: Implement Swap Prefetching v22

From: Nikita Danilov
Date: Thu Feb 09 2006 - 13:02:49 EST


Nick Piggin writes:

[...]

> > +/*
> > + * We check to see no part of the vm is busy. If it is this will interrupt
> > + * trickle_swap and wait another PREFETCH_DELAY. Purposefully racy.
> > + */
> > +inline void delay_swap_prefetch(void)
> > +{
> > + __set_bit(0, &swapped.busy);
> > +}
> > +
>
> Test this first so you don't bounce the cacheline around in page
> reclaim too much.

Shouldn't we have special macros/inlines for this? Like, e.g.,

static inline void __set_bit_weak(int nr, volatile unsigned long * addr)
{
if (!__test_bit(nr, addr))
__set_bit(nr, addr);
}

? These test-then-set sequences start to proliferate throughout the code.

[...]

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