lkml.org 
[lkml]   [2021]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kfence: use TASK_IDLE when awaiting allocation
On Fri, May 21, 2021 at 09:39AM +0000, David Laight wrote:
> From: Marco Elver
> > Sent: 21 May 2021 09:32
> >
> > Since wait_event() uses TASK_UNINTERRUPTIBLE by default, waiting for an
> > allocation counts towards load. However, for KFENCE, this does not make
> > any sense, since there is no busy work we're awaiting.
> >
> > Instead, use TASK_IDLE via wait_event_idle() to not count towards load.
>
> Doesn't that let the process be interruptible by a signal.
> Which is probably not desirable.
>
> There really ought to be a way of sleeping with TASK_UNINTERRUPTIBLE
> without changing the load-average.

That's what TASK_IDLE is:

include/linux/sched.h:#define TASK_IDLE (TASK_UNINTERRUPTIBLE | TASK_NOLOAD)

See https://lore.kernel.org/lkml/alpine.LFD.2.11.1505112154420.1749@ja.home.ssi.bg/T/

Thanks,
-- Marco

> IIRC the load-average is really intended to include processes
> that are waiting for disk - especially for swap.
>
> David
>
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)

\
 
 \ /
  Last update: 2021-05-21 11:48    [W:0.042 / U:0.640 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site