RE: Subject: [PATCH V7 2/4] mm: frontswap: core code

From: Dan Magenheimer
Date: Mon Aug 29 2011 - 11:49:16 EST


> > My concern was race in counters. Even you allow race in frontswap_succ_puts++,
> >
> > Don't you need some lock for
> > sis->frontswap_pages++
> > sis->frontswap_pages--
>
> Hmmm... OK, you've convinced me. If this counter should be one and
> a race leaves it as zero, I think data corruption could result on
> a swapoff or partial swapoff. And after thinking about it, I
> think I also need to check for locking on frontswap_set/clear
> as I don't think these bitfield modifiers are atomic.
>
> Thanks for pointing this out. Good catch! I will need to
> play with this and test it so probably will not submit V8 until
> next week as today is a vacation day for me.

Silly me: Of course set_bit and clear_bit ARE atomic. I will
post V8 later today with the only changes being frontswap_pages
is now a type atomic_t.

Thanks again for catching this, Kame!

Thanks,
Dan
--
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/