From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 0/5] use mask operations instead of test_bit() Date: Fri, 2 Oct 2015 10:47:39 +0100 Message-ID: <560E52BB.1080004@citrix.com> References: <1443760830-29095-1-git-send-email-jgross@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1443760830-29095-1-git-send-email-jgross@suse.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Juergen Gross , keir@xen.org, jbeulich@suse.com, dario.faggioli@citrix.com, george.dunlap@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 02/10/15 05:40, Juergen Gross wrote: > Instead of using test_bit() which is an atomic operation and limits > the compiler's choices to do optimization, use logical ANDs with > bitmasks where possible. > > The possible candidates have been detected by searching definitions > of bitmasks in the form: > > #define MASK 1 << _MASK > > On x86 the resulting code is slightly smaller (about 2 bytes for each > case, checked via disassembly in few examples). > > I'm quite sure I didn't replace a test_bit() call required to be > atomic, but I'd be grateful for a thorough review especially in the > scheduler. > > > Juergen Gross (5): > xen: use masking operation instead of test_bit for RTDS bits > xen: use masking operation instead of test_bit for CSFLAG bits > xen: use masking operation instead of test_bit for VGCF bits > xen: use masking operation instead of test_bit for VPF bits > xen: use masking operation instead of test_bit for MCSF bits Reviewed-by: Andrew Cooper