Re: sched: make struct task_struct::state 32-bit

2019-09-23 Thread Valentin Schneider
On 23/09/2019 12:43, Julia Lawall wrote: // FIXME: match functions that do something with state_var underneath? // How to do recursive rules? >>> >>> You want to look at the definitions of called functions? Coccinelle >>> doesn't really support that, but there are hackish ways to add

Re: sched: make struct task_struct::state 32-bit

2019-09-23 Thread Valentin Schneider
On 23/09/2019 11:34, Julia Lawall wrote: >> // FIXME: current not recognized as task_struct*, fixhack with regexp >> identifier current =~ "^current$"; > > Please don't do this. Just use the word current. It doesn't have to be a > metavariable. You will though get a warning about it. To

Re: sched: make struct task_struct::state 32-bit

2019-09-23 Thread Valentin Schneider
On 05/09/2019 17:52, Valentin Schneider wrote: > I actually got rid of the task_struct* parameter and now just match > against task_struct.p accesses in the function body, which has the > added bonus of not caring about the order of the parameters. > > Still not there yet but

Re: [PATCH] sched: make struct task_struct::state 32-bit

2019-09-04 Thread Valentin Schneider
On 04/09/2019 13:07, Valentin Schneider wrote: > [...] > Baby steps... There's something regarding coccinelle disjunctions that just can't grasp, and this also fails to recognize "current" as being "struct task_struct*". Once I fix these, it's "just" a matte

Re: [PATCH] sched: make struct task_struct::state 32-bit

2019-09-04 Thread Valentin Schneider
On 03/09/2019 22:51, Valentin Schneider wrote: [...] > I tried something for function parameters, which seems to be feasible > according to [1], but couldn't get it to work (yet). Here's what I have > so far: > [...] So now I have this: --- @funcmatch@ identifier func; identifier p

Re: [PATCH] sched: make struct task_struct::state 32-bit

2019-09-04 Thread Valentin Schneider
On 04/09/2019 10:43, David Laight wrote: > From: Alexey Dobriyan >> Sent: 03 September 2019 19:19 > ... >>> How did you come up with this changeset, did you pickaxe for some regexp? >> >> No, manually, backtracking up to the call chain. >> Maybe I missed a few places. > > Renaming the structure

Re: [PATCH] sched: make struct task_struct::state 32-bit

2019-09-03 Thread Valentin Schneider
On 03/09/2019 19:19, Alexey Dobriyan wrote: > On Tue, Sep 03, 2019 at 06:29:06PM +0100, Valentin Schneider wrote: >> On 02/09/2019 22:05, Alexey Dobriyan wrote: >>> 32-bit accesses are shorter than 64-bit accesses on x86_64. >>> Nothing uses 64-bitness of ->state.

Re: [PATCH] sched: make struct task_struct::state 32-bit

2019-09-03 Thread Valentin Schneider
On 02/09/2019 22:05, Alexey Dobriyan wrote: > 32-bit accesses are shorter than 64-bit accesses on x86_64. > Nothing uses 64-bitness of ->state. > > Space savings are ~2KB on F30 kernel config. > > Signed-off-by: Alexey Dobriyan > --- > > arch/ia64/kernel/perfmon.c |4 ++-- >

Re: [PATCH] sched: make struct task_struct::state 32-bit

2019-09-03 Thread Valentin Schneider
On 03/09/2019 17:23, Alexey Dobriyan wrote: > On Tue, Sep 03, 2019 at 12:02:38AM +0100, Valentin Schneider wrote: >> struct task_struct { >> struct thread_info thread_info; /* 024 */ >> volatile int state;

Re: [PATCH] sched: make struct task_struct::state 32-bit

2019-09-02 Thread Valentin Schneider
Hi, On 02/09/2019 22:05, Alexey Dobriyan wrote: > 32-bit accesses are shorter than 64-bit accesses on x86_64. > Nothing uses 64-bitness of ->state. > > Space savings are ~2KB on F30 kernel config. > > Signed-off-by: Alexey Dobriyan > --- Interestingly this has been volatile long since forever