xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] use mask operations instead of test_bit()
@ 2015-10-02  4:40 Juergen Gross
  2015-10-02  4:40 ` [PATCH 1/5] xen: use masking operation instead of test_bit for RTDS bits Juergen Gross
                   ` (7 more replies)
  0 siblings, 8 replies; 23+ messages in thread
From: Juergen Gross @ 2015-10-02  4:40 UTC (permalink / raw)
  To: keir, jbeulich, andrew.cooper3, dario.faggioli, george.dunlap,
	xen-devel
  Cc: Juergen Gross

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

 xen/arch/x86/domain.c           | 12 ++++++------
 xen/arch/x86/domctl.c           |  2 +-
 xen/arch/x86/hvm/hvm.c          |  4 ++--
 xen/arch/x86/hvm/vpt.c          |  2 +-
 xen/arch/x86/x86_64/compat/mm.c |  4 ++--
 xen/common/domain.c             |  4 ++--
 xen/common/domctl.c             |  8 ++++----
 xen/common/multicall.c          |  2 +-
 xen/common/sched_credit2.c      | 16 ++++++++--------
 xen/common/sched_rt.c           |  4 ++--
 xen/common/schedule.c           | 16 ++++++++--------
 11 files changed, 37 insertions(+), 37 deletions(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2015-10-05 14:31 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-02  4:40 [PATCH 0/5] use mask operations instead of test_bit() Juergen Gross
2015-10-02  4:40 ` [PATCH 1/5] xen: use masking operation instead of test_bit for RTDS bits Juergen Gross
2015-10-02 10:21   ` Dario Faggioli
2015-10-05 13:30   ` George Dunlap
2015-10-02  4:40 ` [PATCH 2/5] xen: use masking operation instead of test_bit for CSFLAG bits Juergen Gross
2015-10-02 10:45   ` Dario Faggioli
2015-10-05 13:30   ` George Dunlap
2015-10-02  4:40 ` [PATCH 3/5] xen: use masking operation instead of test_bit for VGCF bits Juergen Gross
2015-10-02  4:40 ` [PATCH 4/5] xen: use masking operation instead of test_bit for VPF bits Juergen Gross
2015-10-05 13:18   ` George Dunlap
2015-10-05 13:36     ` Jan Beulich
2015-10-05 13:45       ` George Dunlap
2015-10-05 14:05         ` Jan Beulich
2015-10-05 14:31           ` George Dunlap
2015-10-05 13:39     ` Juergen Gross
2015-10-05 13:24   ` George Dunlap
2015-10-05 13:40     ` Jan Beulich
2015-10-02  4:40 ` [PATCH 5/5] xen: use masking operation instead of test_bit for MCSF bits Juergen Gross
2015-10-02  9:03 ` [PATCH 0/5] use mask operations instead of test_bit() Dario Faggioli
2015-10-02  9:10   ` Juergen Gross
2015-10-02  9:33     ` Dario Faggioli
2015-10-02  9:44 ` Jan Beulich
2015-10-02  9:47 ` Andrew Cooper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).