Thread (15 messages) 15 messages, 5 authors, 2006-02-10

Re: [PATCH] mm: Implement Swap Prefetching v22

From: Con Kolivas <hidden>
Date: 2006-02-10 00:09:31
Also in: lkml

On Friday 10 February 2006 05:04, Nikita Danilov wrote:
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.
Maybe.

There isn't actually a non-atomic __test_bit anyway, only a test_bit. The 
non-atomic __test_and_set_bit already exists, but that sets the bit 
regardless of what the bit was as far as I can tell.

Cheers,
Con

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help