Re: [External] Re: [PATCH v2] mm: memcontrol: fix kernel stack account

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 3, 2021 at 6:02 AM Michal Hocko <mhocko@xxxxxxxx> wrote:
>
[...]
> > > > +             BUG_ON(vm->nr_pages != THREAD_SIZE / PAGE_SIZE);
> > >
> > > I do not think we need this BUG_ON. What kind of purpose does it serve?
> >
> > vm->nr_pages should be always equal to THREAD_SIZE / PAGE_SIZE
> > if the system is not corrupted.
>
> BUG_ON is not an annotation for "this shouldn't happen". Even if the
> system was corrupted and nr_pages wouldn't match then this is not a
> reason to crash the kernel right away.
>
> In general there should be a very _strong_ reason to add a BUG_ON.
>

I agree with Michal. We should remove this BUG_ON or at least convert
it into VM_BUG_ON.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux