Re: [PATCH v2 04/35] preempt: introduce CONFIG_PREEMPT_AUTO

Ankur Arora
2024-06-04T17:53:17Z

Shrikanth Hegde <sshegde@linux.ibm.com> writes:

> On 5/28/24 6:04 AM, Ankur Arora wrote:

[...]

>> diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h
>> index 9ea0b28068f4..06e13e7acbe2 100644
>> --- a/include/linux/thread_info.h
>> +++ b/include/linux/thread_info.h
>> @@ -59,6 +59,18 @@ enum syscall_work_bit {
>>
>> #include <asm/thread_info.h>
>>
>> +/*
>> + * Fall back to the default need-resched flag when an architecture does not
>> + * define TIF_NEED_RESCHED_LAZY.
>> + *
>> + * Note: with !PREEMPT_AUTO, code should not be setting TIF_NEED_RESCHED_LAZY
>> + * anywhere. Define this here because we will explicitly test for this bit.
>> + */
>
>
> Is this comment still valid?
> I see that flag has been set without any checks in arch file.

Thanks for pointing this out. There is a typo in this comment.
Should have said "with !HAVE_PREEMPT_AUTO" instead of "with
!PREEMPT_AUTO" above.

So, an architecture should define HAVE_PREMPT_AUTO only if it also
defines TIF_NEED_RESCHED_LAZY and whatever else necessary to support
PREEMPT_AUTO.

Ankur

>> +#ifndef TIF_NEED_RESCHED_LAZY
>> +#define TIF_NEED_RESCHED_LAZY TIF_NEED_RESCHED
>> +#define _TIF_NEED_RESCHED_LAZY _TIF_NEED_RESCHED
>> +#endif
>> +
>> #ifdef __KERNEL__
>>
>> #ifndef arch_set_restart_data

--
ankur