Are there some potential problems that I should be aware of if I allocate the memory which doesn't have any relation to peripheral hardwares(i.e. DMA, PCI, serial port and etc) by vmalloc() instead of kmalloc()?

Greg KH greg at kroah.com
Sat Jun 27 01:05:46 EDT 2020


On Fri, Jun 26, 2020 at 11:36:05PM +0800, 孙世龙 sunshilong wrote:
> Thank you for your attention to this matter.
> 
> >Why are you having so many issues in allocating memory?
> I often saw the page allocation failure recently. I must resolve this problem.

What code is causing that failure by asking for memory that you do not
have?  Please fix that up, the core kernel should be fine.

> I have no choice other than disabling these options
> (i.e. CONFIG-MIGRATION and CONFIG-COMPACTION)
> since I am using a real-time OS.

As was already stated, the use of "real-time" has nothing to do with
those options, or memory allocation, or anything else here.  Please do
not get confused about the determinisitic operation of
interrupts/scheduling vs. anything else.

> It's easier to encounter such a problem since the said options are disabled.

Then fix your broken driver that is asking for so much memory on a
system that does not have it.  Do you have a pointer to your driver
anywhere so we can review it?

good luck!

greg k-h



More information about the Kernelnewbies mailing list