kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* How to avoid or reduce GFP_ATOMIC allocation failed
@ 2019-03-08  5:37 wuzhouhui
  2019-03-08  7:21 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: wuzhouhui @ 2019-03-08  5:37 UTC (permalink / raw)
  To: kernelnewbies

Hi,

I check kernel code and found that GFP_ATOMIC allocation will
use emergency pool and maybe failed if emergency pool is not
enough. And GFP_ATOMIC doesn't trigger reclaim (because of
ATOMIC) even if there are a lot of page caches. So my question
is how to avoid or reduce GFP_ATOMIC allocation failed if there
are enough reclaimable memory? Is there some kernel parameters
can be configured?

Thanks.
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to avoid or reduce GFP_ATOMIC allocation failed
  2019-03-08  5:37 How to avoid or reduce GFP_ATOMIC allocation failed wuzhouhui
@ 2019-03-08  7:21 ` Greg KH
  2019-03-08  7:34   ` wuzhouhui
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2019-03-08  7:21 UTC (permalink / raw)
  To: wuzhouhui; +Cc: kernelnewbies

On Fri, Mar 08, 2019 at 01:37:26PM +0800, wuzhouhui wrote:
> Hi,
> 
> I check kernel code and found that GFP_ATOMIC allocation will
> use emergency pool and maybe failed if emergency pool is not
> enough. And GFP_ATOMIC doesn't trigger reclaim (because of
> ATOMIC) even if there are a lot of page caches. So my question
> is how to avoid or reduce GFP_ATOMIC allocation failed if there
> are enough reclaimable memory? Is there some kernel parameters
> can be configured?

Have you seen the ATOMIC pools be used up and not able to be reclaimed
in real-world usages?  If so, I'm sure the mm developers would love to
hear from you about this as I really do not think that is a situation
that can happen easily, if at all.

And no, I do not think there are any such parameters, the kernel should
be self-tuning for things like this.

thanks,

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Re: How to avoid or reduce GFP_ATOMIC allocation failed
  2019-03-08  7:21 ` Greg KH
@ 2019-03-08  7:34   ` wuzhouhui
  2019-03-08  7:40     ` greg kh
  0 siblings, 1 reply; 4+ messages in thread
From: wuzhouhui @ 2019-03-08  7:34 UTC (permalink / raw)
  To: greg kh; +Cc: kernelnewbies

> -----Original Messages-----
> From: "Greg KH" <greg@kroah.com>
> Sent Time: 2019-03-08 15:21:52 (Friday)
> To: wuzhouhui <wuzhouhui14@mails.ucas.ac.cn>
> Cc: kernelnewbies@kernelnewbies.org
> Subject: Re: How to avoid or reduce GFP_ATOMIC allocation failed
> 
> On Fri, Mar 08, 2019 at 01:37:26PM +0800, wuzhouhui wrote:
> > Hi,
> > 
> > I check kernel code and found that GFP_ATOMIC allocation will
> > use emergency pool and maybe failed if emergency pool is not
> > enough. And GFP_ATOMIC doesn't trigger reclaim (because of
> > ATOMIC) even if there are a lot of page caches. So my question
> > is how to avoid or reduce GFP_ATOMIC allocation failed if there
> > are enough reclaimable memory? Is there some kernel parameters
> > can be configured?
> 
> Have you seen the ATOMIC pools be used up and not able to be reclaimed
> in real-world usages?  If so, I'm sure the mm developers would love to

No, I haven't seen this scenario. But I encountered the similar issue
with [1] (order is 5 in my scenario), and this issue is not resolved for
now.

Thanks.

[1] https://stackoverflow.com/questions/53936183/linux-disk-cache-and-kmalloc-with-gfp-atomic#

> hear from you about this as I really do not think that is a situation
> that can happen easily, if at all.
> 
> And no, I do not think there are any such parameters, the kernel should
> be self-tuning for things like this.
> 
> thanks,
> 
> greg k-h
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Re: How to avoid or reduce GFP_ATOMIC allocation failed
  2019-03-08  7:34   ` wuzhouhui
@ 2019-03-08  7:40     ` greg kh
  0 siblings, 0 replies; 4+ messages in thread
From: greg kh @ 2019-03-08  7:40 UTC (permalink / raw)
  To: wuzhouhui; +Cc: kernelnewbies

On Fri, Mar 08, 2019 at 03:34:18PM +0800, wuzhouhui wrote:
> > -----Original Messages-----
> > From: "Greg KH" <greg@kroah.com>
> > Sent Time: 2019-03-08 15:21:52 (Friday)
> > To: wuzhouhui <wuzhouhui14@mails.ucas.ac.cn>
> > Cc: kernelnewbies@kernelnewbies.org
> > Subject: Re: How to avoid or reduce GFP_ATOMIC allocation failed
> > 
> > On Fri, Mar 08, 2019 at 01:37:26PM +0800, wuzhouhui wrote:
> > > Hi,
> > > 
> > > I check kernel code and found that GFP_ATOMIC allocation will
> > > use emergency pool and maybe failed if emergency pool is not
> > > enough. And GFP_ATOMIC doesn't trigger reclaim (because of
> > > ATOMIC) even if there are a lot of page caches. So my question
> > > is how to avoid or reduce GFP_ATOMIC allocation failed if there
> > > are enough reclaimable memory? Is there some kernel parameters
> > > can be configured?
> > 
> > Have you seen the ATOMIC pools be used up and not able to be reclaimed
> > in real-world usages?  If so, I'm sure the mm developers would love to
> 
> No, I haven't seen this scenario. But I encountered the similar issue
> with [1] (order is 5 in my scenario), and this issue is not resolved for
> now.

Please work with the company that created your out-of-tree kernel
networking code as it sounds like they do not know how to properly
handle this type of problem :)

good luck!

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-03-08  7:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-08  5:37 How to avoid or reduce GFP_ATOMIC allocation failed wuzhouhui
2019-03-08  7:21 ` Greg KH
2019-03-08  7:34   ` wuzhouhui
2019-03-08  7:40     ` greg kh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).