Re: [PATCH 02/30] thread_info: selector for TIF_NEED_RESCHED[_LAZY]

From: Ankur Arora
Date: Tue Feb 20 2024 - 17:52:19 EST



Thomas Gleixner <tglx@xxxxxxxxxxxxx> writes:

> On Mon, Feb 12 2024 at 21:55, Ankur Arora wrote:
>>
>> +#define TIF_NEED_RESCHED_LAZY_OFFSET (TIF_NEED_RESCHED_LAZY - TIF_NEED_RESCHED)
>> +
>> +typedef enum {
>> + NR_now = 0,
>> + NR_lazy = 1,
>
> Just a nitpick. Please don't camel case the constant. Can you please
> write out NEED_RESCHED_* as NR is generally associated with number?

That's a good point. But,

__set_tsk_need_resched(NEED_RESCHED_LAZY/_NOW), or
__tif_need_resched(NEED_RESCHED_LAZY/_NOW) seems a little repetitive.
Plus, there's the risk of confusing it with the TIF_NEED_RESCHED_LAZY
flag.

How about, something like this?

+typedef enum {
+ RESCHED_NOW = 0,
+ RESCHED_LAZY = 1,
+} resched_t;

Still, not ideal. But I think it's an improvement over those two.


Thanks

--
ankur