Re: [PATCH RFC] mm: warn potential return NULL for kmalloc_array and kvmalloc_array with __GFP_NOFAIL

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

 



On Fri, Jul 19, 2024 at 8:01 PM Michal Hocko <mhocko@xxxxxxxx> wrote:
>
> On Fri 19-07-24 19:51:06, Barry Song wrote:
> > On Fri, Jul 19, 2024 at 7:42 PM Michal Hocko <mhocko@xxxxxxxx> wrote:
> [...]
> > > It cannot reclaim itself and it cannot sleep to wait for the memory so
> > > NOFAIL semantic is simply impossible. We have put a warning in place to
> >
> > this is still "right" behaviour to retry infinitely at least according
> > to the doc of
> > __GFP_NOFAIL.
>
> I do not agree that implementing busy loop in the kernel is the right
> practice!
>
> > I assume getting new memory by many retries is still
> > possibly some other processes might be reclaiming or freeing memory
> > then providing free memory to this one being stuck.
>
> No, I strongly disagree we should even pretend this is a supported
> allocation strategy. NAK to any attempt to legalize it in some form.

fare enough.
I am not trying to legitimize it, just explaining what the documentation says.
If it is illegal, we should clearly and firmly state that it is
illegal, rather than
pretending it is legal and returning NULL. This is also wrong.

>
> --
> Michal Hocko
> SUSE Labs





[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