Re: [PATCH] mm/smaps_rollup: return empty file for kthreads instead of ESRCH

From: Andrew Morton
Date: Wed Apr 27 2022 - 16:34:43 EST


On Thu, 14 Apr 2022 09:38:14 +0200 Vlastimil Babka <vbabka@xxxxxxx> wrote:

> > Returning ESRCH is better so that programs don't waste time reading and
> > closing empty files and instantiating useless inodes.
>
> Hm, unfortunately I don't remember why I put return -ESRCH for this case in
> addition to get_proc_task() failing. I doubt it was a conscious decision to
> treat kthreads differently - I think I would have preferred consistency with
> maps/smaps.
>
> Can the awk use case be fixed with some flag to make it ignore the errors?

This is all too hard. I think I'll drop the patch for now.