On Wed, Oct 20, 2021 at 4:06 PM Michal Hocko <mhocko@xxxxxxxx> wrote: > > On Wed 20-10-21 15:54:23, Uladzislau Rezki wrote: > > > > > > > > > I think adding kind of schedule() will not make things worse and in corner > > > > cases could prevent a power drain by CPU. It is important for mobile devices. > > > > > > I suspect you mean schedule_timeout here? Or cond_resched? I went with a > > > later for now, I do not have a good idea for how to long to sleep here. > > > I am more than happy to change to to a sleep though. > > > > > cond_resched() reschedules only if TIF_NEED_RESCHED is raised what is not good > > here. Because in our case we know that we definitely would like to > > take a breath. Therefore > > invoking the schedule() is more suitable here. It will give a CPU time > > to another waiting > > process(if exists) in any case putting the "current" one to the tail. > > Yes, but there is no explicit event to wait for currently. > > > As for adding a delay. I am not sure about for how long to delay or i > > would say i do not > > see a good explanation why for example we delay for 10 milliseconds or so. > > As I've said I am OK with either of the two. Do you or anybody have any > preference? Without any explicit event to wake up for neither of the two > is more than just an optimistic retry. > >From power perspective it is better to have a delay, so i tend to say that delay is better. -- Uladzislau Rezki