[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bd5c8187c4034016a22977c9ca54c1b0@AcuMS.aculab.com>
Date: Wed, 2 Mar 2022 09:12:02 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Vitaly Wool' <vitaly.wool@...sulko.com>
CC: Miaohe Lin <linmiaohe@...wei.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>
Subject: RE: [PATCH 6/9] mm/z3fold: move decrement of pool->pages_nr into
__release_z3fold_page()
> > Atomic operations aren't magic.
> > Atomic operations are (at best) one slow locked bus cycle.
> > Acquiring a lock is the same.
> > Releasing a lock might be cheaper, but is probably a locked bus cycle.
> >
> > So if you use state_lock to protect pages_nr then you lose an atomic
> > operation for the decrement and gain one (for the unlock) in the increment.
> > That is even or maybe a slight gain.
> > OTOH a 64bit atomic is a PITA on some 32bit systems.
> > (In fact any atomic is a PITA on sparc32.)
>
> It's actually *stale_lock* and it's very misleading to use it for this.
> I would actually like to keep atomics but I have no problem with
> making it 32-bit for 32-bit systems. Would that work for you guys?
It would be better to rename the lock.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists