* [off-list] a path toward killing thread_info
@ 2016-06-17 22:41 Andy Lutomirski
2016-06-17 23:04 ` Al Viro
0 siblings, 1 reply; 6+ messages in thread
From: Andy Lutomirski @ 2016-06-17 22:41 UTC (permalink / raw)
To: Kees Cook, H. Peter Anvin, Peter Zijlstra,
linux-kernel@vger.kernel.org, Ingo Molnar
https://git.kernel.org/cgit/linux/kernel/git/luto/linux.git/commit/?h=x86/vmap_stack&id=50d6cef284e80678c2065813b54bf525d1202d0f
It's fairly straightforward, it's arguably a cleanup, and, with it
applied, there are very few references to 'thread_info' left in the
core kernel at all.
PeterZ, I'm thinking of adding task_ti_flags_ptr to directly find the
ti flags word given a task_struct * so the scheduler can use it. Does
that seem reasonable to you?
Ingo, lockdep tracks mutex owners by thread_info *. Is there any good
reason for this? Can I just use task_struct *? If we do that, I
think thread_info will be *gone* from the core.
--Andy
--
Andy Lutomirski
AMA Capital Management, LLC
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [off-list] a path toward killing thread_info
2016-06-17 22:41 [off-list] a path toward killing thread_info Andy Lutomirski
@ 2016-06-17 23:04 ` Al Viro
2016-06-17 23:10 ` H. Peter Anvin
2016-06-17 23:24 ` Andy Lutomirski
0 siblings, 2 replies; 6+ messages in thread
From: Al Viro @ 2016-06-17 23:04 UTC (permalink / raw)
To: Andy Lutomirski
Cc: Kees Cook, H. Peter Anvin, Peter Zijlstra,
linux-kernel@vger.kernel.org, Ingo Molnar
On Fri, Jun 17, 2016 at 03:41:49PM -0700, Andy Lutomirski wrote:
> PeterZ, I'm thinking of adding task_ti_flags_ptr to directly find the
> ti flags word given a task_struct * so the scheduler can use it. Does
> that seem reasonable to you?
What are you trying to do? Merge task_struct and thread_info?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [off-list] a path toward killing thread_info
2016-06-17 23:04 ` Al Viro
@ 2016-06-17 23:10 ` H. Peter Anvin
2016-06-17 23:23 ` Benjamin Herrenschmidt
2016-06-17 23:24 ` Andy Lutomirski
1 sibling, 1 reply; 6+ messages in thread
From: H. Peter Anvin @ 2016-06-17 23:10 UTC (permalink / raw)
To: Al Viro, Andy Lutomirski
Cc: Kees Cook, Peter Zijlstra, linux-kernel@vger.kernel.org,
Ingo Molnar
On June 17, 2016 4:04:31 PM PDT, Al Viro <viro@ZenIV.linux.org.uk> wrote:
>On Fri, Jun 17, 2016 at 03:41:49PM -0700, Andy Lutomirski wrote:
>
>> PeterZ, I'm thinking of adding task_ti_flags_ptr to directly find the
>> ti flags word given a task_struct * so the scheduler can use it.
>Does
>> that seem reasonable to you?
>
>What are you trying to do? Merge task_struct and thread_info?
Yes.
I did a half-finished patchset to do this once, in that I defined accessor functions which used container_of instead of pointers on architectures where this merge was enabled.
--
Sent from my Android device with K-9 Mail. Please excuse brevity and formatting.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [off-list] a path toward killing thread_info
2016-06-17 23:10 ` H. Peter Anvin
@ 2016-06-17 23:23 ` Benjamin Herrenschmidt
2016-06-18 0:02 ` H. Peter Anvin
0 siblings, 1 reply; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2016-06-17 23:23 UTC (permalink / raw)
To: H. Peter Anvin, Al Viro, Andy Lutomirski
Cc: Kees Cook, Peter Zijlstra, linux-kernel@vger.kernel.org,
Ingo Molnar
On Fri, 2016-06-17 at 16:10 -0700, H. Peter Anvin wrote:
>
> Yes.
>
> I did a half-finished patchset to do this once, in that I defined
> accessor functions which used container_of instead of pointers on
> architectures where this merge was enabled.
How do you get to "current" in that case ? A normal per-cpu ?
Cheers,
Ben.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [off-list] a path toward killing thread_info
2016-06-17 23:23 ` Benjamin Herrenschmidt
@ 2016-06-18 0:02 ` H. Peter Anvin
0 siblings, 0 replies; 6+ messages in thread
From: H. Peter Anvin @ 2016-06-18 0:02 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Al Viro, Andy Lutomirski
Cc: Kees Cook, Peter Zijlstra, linux-kernel@vger.kernel.org,
Ingo Molnar
On June 17, 2016 4:23:19 PM PDT, Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>On Fri, 2016-06-17 at 16:10 -0700, H. Peter Anvin wrote:
>>
>> Yes.
>>
>> I did a half-finished patchset to do this once, in that I defined
>> accessor functions which used container_of instead of pointers on
>> architectures where this merge was enabled.
>
>How do you get to "current" in that case ? A normal per-cpu ?
>
>Cheers,
>Ben.
Yes. We already do that on x86-64 at least.
--
Sent from my Android device with K-9 Mail. Please excuse brevity and formatting.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [off-list] a path toward killing thread_info
2016-06-17 23:04 ` Al Viro
2016-06-17 23:10 ` H. Peter Anvin
@ 2016-06-17 23:24 ` Andy Lutomirski
1 sibling, 0 replies; 6+ messages in thread
From: Andy Lutomirski @ 2016-06-17 23:24 UTC (permalink / raw)
To: Al Viro
Cc: Kees Cook, H. Peter Anvin, Peter Zijlstra,
linux-kernel@vger.kernel.org, Ingo Molnar
On Fri, Jun 17, 2016 at 4:04 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> On Fri, Jun 17, 2016 at 03:41:49PM -0700, Andy Lutomirski wrote:
>
>> PeterZ, I'm thinking of adding task_ti_flags_ptr to directly find the
>> ti flags word given a task_struct * so the scheduler can use it. Does
>> that seem reasonable to you?
>
> What are you trying to do? Merge task_struct and thread_info?
Merge thread_struct and thread_info, actually. The only functional
thing that thread_info provides is a place for arches to stash stuff.
I also want to end the era of stack overflows smashing data structures
at a fixed offset.
If we kill thread_info (on x86, anyway) and enable virtually mapped
stacks (which I just emailed out v2 of), then a stack overflow will
just OOPS cleanly on x86 without clobbering anything.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-06-18 0:02 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-17 22:41 [off-list] a path toward killing thread_info Andy Lutomirski
2016-06-17 23:04 ` Al Viro
2016-06-17 23:10 ` H. Peter Anvin
2016-06-17 23:23 ` Benjamin Herrenschmidt
2016-06-18 0:02 ` H. Peter Anvin
2016-06-17 23:24 ` Andy Lutomirski
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.