Re: [PATCH v3 5/5] mm/slub: do not create dma-kmalloc if no managed pages in DMA zone

2022-01-07 Thread Hyeonggon Yoo
On Wed, Dec 15, 2021 at 08:27:10AM +0100, Christoph Hellwig wrote: > On Wed, Dec 15, 2021 at 07:03:35AM +, Hyeonggon Yoo wrote: > > I'm not sure that allocating from ZONE_DMA32 instead of ZONE_DMA > > for kdump kernel is nice way to solve this problem. > > What is the problem with zones in kdu

Re: [PATCH v3 5/5] mm/slub: do not create dma-kmalloc if no managed pages in DMA zone

2021-12-23 Thread Christoph Hellwig
On Wed, Dec 22, 2021 at 12:37:03PM +, Hyeonggon Yoo wrote: > Oh I misunderstood this. Underlying physical address of vmalloc()-allocated > memory > can be mapped using DMA API, and it needs to be setup as scatterlist because > the allocated memory is not physically continuous. Right? Yes. >

Re: [PATCH v3 5/5] mm/slub: do not create dma-kmalloc if no managed pages in DMA zone

2021-12-22 Thread Hyeonggon Yoo
Hello Christoph. On Tue, Dec 21, 2021 at 09:56:23AM +0100, Christoph Hellwig wrote: > On Fri, Dec 17, 2021 at 11:38:27AM +, Hyeonggon Yoo wrote: > > My understanding is any buffer requested from kmalloc (without > > GFP_DMA/DMA32) can be used by device driver because it allocates > > continuou

Re: [PATCH v3 5/5] mm/slub: do not create dma-kmalloc if no managed pages in DMA zone

2021-12-21 Thread Christoph Hellwig
On Fri, Dec 17, 2021 at 11:38:27AM +, Hyeonggon Yoo wrote: > My understanding is any buffer requested from kmalloc (without > GFP_DMA/DMA32) can be used by device driver because it allocates > continuous physical memory. It doesn't mean that buffer allocated > with kmalloc is free of addressing

Re: [PATCH v3 5/5] mm/slub: do not create dma-kmalloc if no managed pages in DMA zone

2021-12-19 Thread Baoquan He
On 12/17/21 at 11:38am, Hyeonggon Yoo wrote: > On Wed, Dec 15, 2021 at 08:27:10AM +0100, Christoph Hellwig wrote: > > On Wed, Dec 15, 2021 at 07:03:35AM +, Hyeonggon Yoo wrote: > > > I'm not sure that allocating from ZONE_DMA32 instead of ZONE_DMA > > > for kdump kernel is nice way to solve thi

Re: [PATCH v3 5/5] mm/slub: do not create dma-kmalloc if no managed pages in DMA zone

2021-12-17 Thread Hyeonggon Yoo
On Wed, Dec 15, 2021 at 08:27:10AM +0100, Christoph Hellwig wrote: > On Wed, Dec 15, 2021 at 07:03:35AM +, Hyeonggon Yoo wrote: > > I'm not sure that allocating from ZONE_DMA32 instead of ZONE_DMA > > for kdump kernel is nice way to solve this problem. > > What is the problem with zones in kdu

Re: [PATCH v3 5/5] mm/slub: do not create dma-kmalloc if no managed pages in DMA zone

2021-12-17 Thread Hyeonggon Yoo
On Tue, Dec 14, 2021 at 01:32:53PM +0800, Baoquan He wrote: > On 12/13/21 at 01:43pm, Hyeonggon Yoo wrote: > > Hello Baoquan. I have a question on your code. > > > > On Mon, Dec 13, 2021 at 08:27:12PM +0800, Baoquan He wrote: > > > Dma-kmalloc will be created as long as CONFIG_ZONE_DMA is enabled.

Re: [PATCH v3 5/5] mm/slub: do not create dma-kmalloc if no managed pages in DMA zone

2021-12-15 Thread Baoquan He
On 12/15/21 at 07:03am, Hyeonggon Yoo wrote: > On Wed, Dec 15, 2021 at 04:48:26AM +, Hyeonggon Yoo wrote: > > > > Hello Baoquan and Vlastimil. > > > > I'm not sure allowing ZONE_DMA32 for kdump kernel is nice way to solve > > this problem. Devices that requires ZONE_DMA is rare but we still >

Re: [PATCH v3 5/5] mm/slub: do not create dma-kmalloc if no managed pages in DMA zone

2021-12-15 Thread Baoquan He
On 12/15/21 at 11:34am, Vlastimil Babka wrote: > On 12/15/21 08:27, Christoph Hellwig wrote: > > On Wed, Dec 15, 2021 at 07:03:35AM +, Hyeonggon Yoo wrote: > >> I'm not sure that allocating from ZONE_DMA32 instead of ZONE_DMA > >> for kdump kernel is nice way to solve this problem. > > > > Wha

RE: [PATCH v3 5/5] mm/slub: do not create dma-kmalloc if no managed pages in DMA zone

2021-12-15 Thread David Laight
From: Vlastimil Babka > Sent: 15 December 2021 10:34 > > On 12/15/21 08:27, Christoph Hellwig wrote: > > On Wed, Dec 15, 2021 at 07:03:35AM +, Hyeonggon Yoo wrote: > >> I'm not sure that allocating from ZONE_DMA32 instead of ZONE_DMA > >> for kdump kernel is nice way to solve this problem. > >

Re: [PATCH v3 5/5] mm/slub: do not create dma-kmalloc if no managed pages in DMA zone

2021-12-15 Thread Vlastimil Babka
On 12/15/21 08:27, Christoph Hellwig wrote: > On Wed, Dec 15, 2021 at 07:03:35AM +, Hyeonggon Yoo wrote: >> I'm not sure that allocating from ZONE_DMA32 instead of ZONE_DMA >> for kdump kernel is nice way to solve this problem. > > What is the problem with zones in kdump kernels? My understan

Re: [PATCH v3 5/5] mm/slub: do not create dma-kmalloc if no managed pages in DMA zone

2021-12-15 Thread Baoquan He
On 12/14/21 at 11:09am, Vlastimil Babka wrote: > On 12/14/21 06:32, Baoquan He wrote: > > On 12/13/21 at 01:43pm, Hyeonggon Yoo wrote: > >> Hello Baoquan. I have a question on your code. > >> > >> On Mon, Dec 13, 2021 at 08:27:12PM +0800, Baoquan He wrote: > >> > Dma-kmalloc will be created as lon

Re: [PATCH v3 5/5] mm/slub: do not create dma-kmalloc if no managed pages in DMA zone

2021-12-14 Thread Christoph Hellwig
On Tue, Dec 14, 2021 at 11:07:34AM -0600, john.p.donne...@oracle.com wrote: > Is CONFIG_ZONE_DMA even needed anymore in x86_64 ? Yes. There are still plenty of addressing challenged devices, mostly ISA-like but also a few PCI/PCIe ones. ___ kexec mail

Re: [PATCH v3 5/5] mm/slub: do not create dma-kmalloc if no managed pages in DMA zone

2021-12-14 Thread Christoph Hellwig
On Wed, Dec 15, 2021 at 07:03:35AM +, Hyeonggon Yoo wrote: > I'm not sure that allocating from ZONE_DMA32 instead of ZONE_DMA > for kdump kernel is nice way to solve this problem. What is the problem with zones in kdump kernels? > Devices that requires ZONE_DMA memory is rare but we still sup

Re: [PATCH v3 5/5] mm/slub: do not create dma-kmalloc if no managed pages in DMA zone

2021-12-14 Thread Hyeonggon Yoo
On Wed, Dec 15, 2021 at 04:48:26AM +, Hyeonggon Yoo wrote: > > Hello Baoquan and Vlastimil. > > I'm not sure allowing ZONE_DMA32 for kdump kernel is nice way to solve > this problem. Devices that requires ZONE_DMA is rare but we still > support them. > > If we allow ZONE_DMA32 for ZONE_DMA i

Re: [PATCH v3 5/5] mm/slub: do not create dma-kmalloc if no managed pages in DMA zone

2021-12-14 Thread Hyeonggon Yoo
On Tue, Dec 14, 2021 at 11:09:23AM +0100, Vlastimil Babka wrote: > On 12/14/21 06:32, Baoquan He wrote: > > On 12/13/21 at 01:43pm, Hyeonggon Yoo wrote: > >> Hello Baoquan. I have a question on your code. > >> > >> On Mon, Dec 13, 2021 at 08:27:12PM +0800, Baoquan He wrote: > >> > Dma-kmalloc will

Re: [PATCH v3 5/5] mm/slub: do not create dma-kmalloc if no managed pages in DMA zone

2021-12-14 Thread john . p . donnelly
On 12/14/21 10:31 AM, Christoph Hellwig wrote: On Mon, Dec 13, 2021 at 08:27:12PM +0800, Baoquan He wrote: Dma-kmalloc will be created as long as CONFIG_ZONE_DMA is enabled. However, it will fail if DMA zone has no managed pages. The failure can be seen in kdump kernel of x86_64 as below: Plea

Re: [PATCH v3 5/5] mm/slub: do not create dma-kmalloc if no managed pages in DMA zone

2021-12-14 Thread Christoph Hellwig
On Mon, Dec 13, 2021 at 08:27:12PM +0800, Baoquan He wrote: > Dma-kmalloc will be created as long as CONFIG_ZONE_DMA is enabled. > However, it will fail if DMA zone has no managed pages. The failure > can be seen in kdump kernel of x86_64 as below: Please just switch the sr allocation to use GFP_K

Re: [PATCH v3 5/5] mm/slub: do not create dma-kmalloc if no managed pages in DMA zone

2021-12-14 Thread Christoph Lameter
On Tue, 14 Dec 2021, Vlastimil Babka wrote: > If doesn't feel right to me to fix (or rather workaround) this on the level > of kmalloc caches just because the current reports come from there. If we > decide it's acceptable for kdump kernel to return !ZONE_DMA memory for > GFP_DMA requests, then it

Re: [PATCH v3 5/5] mm/slub: do not create dma-kmalloc if no managed pages in DMA zone

2021-12-14 Thread Vlastimil Babka
On 12/14/21 06:32, Baoquan He wrote: > On 12/13/21 at 01:43pm, Hyeonggon Yoo wrote: >> Hello Baoquan. I have a question on your code. >> >> On Mon, Dec 13, 2021 at 08:27:12PM +0800, Baoquan He wrote: >> > Dma-kmalloc will be created as long as CONFIG_ZONE_DMA is enabled. >> > However, it will fail

Re: [PATCH v3 5/5] mm/slub: do not create dma-kmalloc if no managed pages in DMA zone

2021-12-13 Thread Baoquan He
On 12/13/21 at 01:43pm, Hyeonggon Yoo wrote: > Hello Baoquan. I have a question on your code. > > On Mon, Dec 13, 2021 at 08:27:12PM +0800, Baoquan He wrote: > > Dma-kmalloc will be created as long as CONFIG_ZONE_DMA is enabled. > > However, it will fail if DMA zone has no managed pages. The failu

Re: [PATCH v3 5/5] mm/slub: do not create dma-kmalloc if no managed pages in DMA zone

2021-12-13 Thread john . p . donnelly
On 12/13/21 6:27 AM, Baoquan He wrote: Dma-kmalloc will be created as long as CONFIG_ZONE_DMA is enabled. However, it will fail if DMA zone has no managed pages. The failure can be seen in kdump kernel of x86_64 as below: CPU: 0 PID: 65 Comm: kworker/u2:1 Not tainted 5.14.0-rc2+ #9 Hardware

Re: [PATCH v3 5/5] mm/slub: do not create dma-kmalloc if no managed pages in DMA zone

2021-12-13 Thread Hyeonggon Yoo
Hello Baoquan. I have a question on your code. On Mon, Dec 13, 2021 at 08:27:12PM +0800, Baoquan He wrote: > Dma-kmalloc will be created as long as CONFIG_ZONE_DMA is enabled. > However, it will fail if DMA zone has no managed pages. The failure > can be seen in kdump kernel of x86_64 as below: >

[PATCH v3 5/5] mm/slub: do not create dma-kmalloc if no managed pages in DMA zone

2021-12-13 Thread Baoquan He
Dma-kmalloc will be created as long as CONFIG_ZONE_DMA is enabled. However, it will fail if DMA zone has no managed pages. The failure can be seen in kdump kernel of x86_64 as below: CPU: 0 PID: 65 Comm: kworker/u2:1 Not tainted 5.14.0-rc2+ #9 Hardware name: Intel Corporation SandyBridge Platfor