[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4be6abb6-7b82-4e64-9e27-cd0fe0c1e1b1@default>
Date: Mon, 29 Aug 2011 08:47:59 -0700 (PDT)
From: Dan Magenheimer <dan.magenheimer@...cle.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org, jeremy@...p.org,
hughd@...gle.com, ngupta@...are.org,
Konrad Wilk <konrad.wilk@...cle.com>, JBeulich@...ell.com,
Kurt Hackel <kurt.hackel@...cle.com>, npiggin@...nel.dk,
akpm@...ux-foundation.org, riel@...hat.com, hannes@...xchg.org,
matthew@....cx, Chris Mason <chris.mason@...cle.com>,
sjenning@...ux.vnet.ibm.com, jackdachef@...il.com,
cyclonusj@...il.com
Subject: RE: Subject: [PATCH V7 2/4] mm: frontswap: core code
> > 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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists