Re: tasks getting stuck on mmap_sem?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linus Torvalds
Date: Tuesday, August 17, 2010 - 2:28 pm

Oh, and it strikes me when looking at the sparc rwsem-const.h that it
has some unsigned constants in it. I think

  #define RWSEM_WAITING_BIAS              0xffff0000

is actually unsigned, because it's a hex constant that doesn't fit in
a signed int. So it's of type 'unsigned int' if I recall the C type
rules right.

(That's one of the really _subtle_ C type rules: hex constants
actually act differently from decimal constants).

So now RWSEM_ACTIVE_WRITE_BIAS is unsigned too.

The x86 constants are all explicitly signed.

Btw, Michel sent out an email saying:

  FYI, I just verified that RWSEM_WAITING_BIAS is defined as signed on
  all architectures except for ia64. So, this would be consistent with
  the issue being observed only on ia64.

but I think he missed that subtlety of the C type system. Other architectures do

  #define RWSEM_WAITING_BIAS             (-0x00010000)

which is indeed signed, but Sparc is unsigned despite the lack of a "u".

Of course, maybe I only _think_ I know all the C typing rules. I might
be full of sh*t. It happens..I didn't actually look them up.

             Linus


                  Linus
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
tasks getting stuck on mmap_sem?, David Miller, (Mon Aug 16, 9:12 pm)
Re: tasks getting stuck on mmap_sem?, Linus Torvalds, (Tue Aug 17, 9:14 am)
Re: tasks getting stuck on mmap_sem?, Tony Luck, (Tue Aug 17, 11:24 am)
Re: tasks getting stuck on mmap_sem?, Tony Luck, (Tue Aug 17, 1:46 pm)
Re: tasks getting stuck on mmap_sem?, Linus Torvalds, (Tue Aug 17, 2:08 pm)
Re: tasks getting stuck on mmap_sem?, Tony Luck, (Tue Aug 17, 2:26 pm)
Re: tasks getting stuck on mmap_sem?, Linus Torvalds, (Tue Aug 17, 2:28 pm)
Re: tasks getting stuck on mmap_sem?, David Miller, (Tue Aug 17, 2:44 pm)
Re: tasks getting stuck on mmap_sem?, Michel Lespinasse, (Tue Aug 17, 2:47 pm)
Re: tasks getting stuck on mmap_sem?, David Miller, (Tue Aug 17, 2:59 pm)
Re: tasks getting stuck on mmap_sem?, David Miller, (Tue Aug 17, 4:40 pm)