lkml.org 
[lkml]   [2021]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/5] sched: make struct task_struct::state 32-bit
On Sat, Feb 06, 2021 at 06:18:32PM +0300, Alexey Dobriyan wrote:
> 32-bit accesses are shorter than 64-bit accesses on x86_64.
> Nothing uses 64-bitness of struct task_struct::state.
>
> Propagate 32-bitness to other variables and functions.

You're saving a handful of bytes, why?

> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -655,7 +655,7 @@ struct task_struct {
> struct thread_info thread_info;
> #endif
> /* -1 unrunnable, 0 runnable, >0 stopped: */
> - volatile long state;
> + volatile int state;

A much larger, but probably more useful cleanup would be to get rid of
that volatile.

\
 
 \ /
  Last update: 2021-02-08 11:52    [W:0.114 / U:0.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site