lkml.org 
[lkml]   [2020]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCH 7/7] sched: Replace rq::wake_list
From
Date
On 6/9/20 3:06 PM, Peter Zijlstra wrote:
> On Tue, Jun 09, 2020 at 02:38:29PM -0700, Eric Biggers wrote:
>> Does the struct actually have to be named? How about:
>>
>> diff --git a/include/linux/sched.h b/include/linux/sched.h
>> index c5d96e3e7fff42..14ca25cda19150 100644
>> --- a/include/linux/sched.h
>> +++ b/include/linux/sched.h
>> @@ -653,8 +653,14 @@ struct task_struct {
>> unsigned int ptrace;
>>
>> #ifdef CONFIG_SMP
>> - struct llist_node wake_entry;
>> - unsigned int wake_entry_type;
>> + /*
>> + * wake_entry_type must follow wake_entry, even when
>> + * CONFIG_GCC_PLUGIN_RANDSTRUCT=y.
>> + */
>> + struct {
>> + struct llist_node wake_entry;
>> + unsigned int wake_entry_type;
>> + };
>> int on_cpu;
>> #ifdef CONFIG_THREAD_INFO_IN_TASK
>> /* Current CPU: */
>>
>>
>> However, it would be preferable to not rely on different structs sharing the
>> same field order, but rather write proper C code that uses the same struct
>> everywhere to encapsulate these 2 fields...
>
> https://lkml.kernel.org/r/20200605093704.GB2948@hirez.programming.kicks-ass.net
>
> And I have more patches on top to clean up some of the anonymous union
> stuff, that that's quite a lot of frobbing.
>

That is why I tried to keep it simple as hackish fixup patch.

Guenter

\
 
 \ /
  Last update: 2020-06-10 01:04    [W:2.416 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site