Re: [PATCH 2/3] delayacct: convert task->delays to a object

From: Peter Zijlstra
Date: Mon Oct 09 2023 - 10:18:47 EST


On Mon, Oct 09, 2023 at 07:38:58PM +0800, brookxu wrote:

> I found another question when I tried to allocate task_delay_info on demand,
> it is hard for us to
>
> determine whether tsk->delays is NULL due to memory failure or delayacct
> disabled, if due to
>
> memory failure I think we should not try to allocate it again, otherwise we
> may have performance
>
> issues, such as following code. If we limit only try once, the code is very
> trick..

Yeah, I wouldn't worry about that. Not until it's shown to be a real
issue. First do the simple thing, only make it more complicated if
there's a real need.