[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.1.10.0806181743390.2907@woody.linux-foundation.org>
Date: Wed, 18 Jun 2008 17:49:51 -0700 (PDT)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Jeremy Fitzhardinge <jeremy@...p.org>
cc: benh@...nel.crashing.org,
xen-devel <xen-devel@...ts.xensource.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
kvm-devel <kvm-devel@...ts.sourceforge.net>, x86@...nel.org,
LKML <linux-kernel@...r.kernel.org>,
Virtualization Mailing List <virtualization@...ts.osdl.org>,
Hugh Dickins <hugh@...itas.com>, Ingo Molnar <mingo@...e.hu>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction
abstraction
On Wed, 18 Jun 2008, Jeremy Fitzhardinge wrote:
>
> It's not cmpxchg, just xchg.
> In other words, is:
>
> lock btr $_PAGE_BIT_RW, (%rbx)
Well, we can actually do it as
lock andl $~_PAGE_RW,(%rbx)
although we haven't bothered (I've wanted several times to make
clear_bit() do that, but have never gotten around to it - mainly because
old gcc versions didn't work with __builtin_constant_p() in inline
functions - so you have to do the macro from hell)
And yes, the "lock andl" should be noticeably faster than the xchgl.
Linus
--
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