Re: [PATCH] nohz: Change tick_dep_mask from 'unsigned long' to 'unsigned int'

From: Linus Torvalds
Date: Tue Mar 15 2016 - 13:36:29 EST


On Tue, Mar 15, 2016 at 10:28 AM, Frederic Weisbecker
<fweisbec@xxxxxxxxx> wrote:
>>
>> And wouldn't it be so nice if "thread_info->flags" would just be
>> atomic_t too. Right now we use a mixture of bit-ops and ACCESS_ONCE()
>> (and many codepaths then doing neither, and just accessing it
>> directly, ignoring any races.
>>
>> Oh well.
>
> I can try that too while at it :-)

The real problem with thread_info->flags is that it's
per-architecture, and people access that thing from assembly code.

So changing that is potentially really *very* painful. The patch
itself is not likely too bad, but having confidence that everything
was caught?

Nasty. It would probably be a very good cleanup, but I'm not sure how
worthwhile it is considering the pain.

(The only good news is that any problem is likely to be *very*
obvious. Switching the field to a 32-bit type on a big-endian machine
and not catching some case will mean that people will check or modify
the wrong flags, and you'd likely get breakage quite quickly)

Linus