Re: [PATCH 05/12] mm/oom_kill: add `const` to pointer parameter
From: Max Kellermann
Date: Sat Aug 30 2025 - 02:26:32 EST
On Sat, Aug 30, 2025 at 1:03 AM Vishal Moola (Oracle)
<vishal.moola@xxxxxxxxx> wrote:
> > -extern bool process_shares_mm(struct task_struct *p, struct mm_struct *mm);
> > +extern bool process_shares_mm(struct task_struct *p, const struct mm_struct *mm);
>
> Nowadays we're dropping the extern keyword.
I can do that - is it acceptable to do that in the same patch?
> Also, Is there any reason you didn't also make the task_struct pointer const?
I wasn't sure whether for_each_thread() is const-safe. I think I
looked at the wrong definition; for_each_thread() looks safe, only
for_other_threads() is not because it uses next_thread() which takes a
non-const pointer. I'll amend the patch.