Re: [PATCH for-7.5 5/5] memcg: simplify high limit handling after a charge
From: Michal Hocko
Date: Wed Oct 14 2026 - 15:30:27 EST
On Wed 14-10-26 10:43:33, Shakeel Butt wrote:
> On Wed, Oct 14, 2026 at 01:46:23PM +0200, Michal Hocko wrote:
> > On Sat 10-10-26 14:09:57, Shakeel Butt wrote:
> > [...]
> > > - /* Interrupts, kernel threads, and remote chargers stop here. */
> > > - if (use_worker)
> > > + /*
> > > + * Use a worker for interrupts, kernel threads, and tasks whose mm
> > > + * does not match the charged hierarchy.
> > > + */
> > > + if (use_high_work) {
> > > + if (!iter)
> > > + return;
> > > + if (allow_spinning)
> > > + schedule_work(&iter->high_work);
> > > + else
> > > + irq_work_queue(&iter->high_irq_work);
> > > return;
> > > + }
> > > +
> > > + if (iter) {
> >
> > Would it be much simpler to bail out on iter==NULL (i.e. nothing over
> > high limit) right after the loop?
> >
>
> I want this patch to not change any behavior. If we return here when iter is
> NULL, we will skip a potential call to __mem_cgroup_handle_over_high() when
> current->memcg_nr_pages_over_high > MEMCG_CHARGE_BATCH. Though I agree that is
> very subtle and most probably unexpected. If we decide to remove it, we should
> do it in a separate patch.
OK, makes sense.
Acked-by: Michal Hocko <mhocko@xxxxxxxx>
--
Michal Hocko
SUSE Labs