lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 8 Feb 2021 17:33:58 +0300
From:   Alexey Dobriyan <adobriyan@...il.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     mingo@...hat.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/5] sched: make struct task_struct::state 32-bit

On Mon, Feb 08, 2021 at 11:39:25AM +0100, Peter Zijlstra wrote:
> 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?

Eeh? To save handful of bytes.

> > --- 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.

volatile is separate patch. It is independent of ->state type.
I didn't think about this specific volatile at all.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ