<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/dma/pool.c, branch v5.9</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.9</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2020-08-27T07:22:56Z</updated>
<entry>
<title>dma-pool: Fix an uninitialized variable bug in atomic_pool_expand()</title>
<updated>2020-08-27T07:22:56Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2020-08-26T11:33:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=892fc9f6835ecf075efac20789b012c5c9997fcc'/>
<id>urn:sha1:892fc9f6835ecf075efac20789b012c5c9997fcc</id>
<content type='text'>
The "page" pointer can be used with out being initialized.

Fixes: d7e673ec2c8e ("dma-pool: Only allocate from CMA when in same memory zone")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>dma-pool: Only allocate from CMA when in same memory zone</title>
<updated>2020-08-14T14:27:05Z</updated>
<author>
<name>Nicolas Saenz Julienne</name>
<email>nsaenzjulienne@suse.de</email>
</author>
<published>2020-08-14T10:26:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d7e673ec2c8e0ea39c4c70fc490d67d7fbda869d'/>
<id>urn:sha1:d7e673ec2c8e0ea39c4c70fc490d67d7fbda869d</id>
<content type='text'>
There is no guarantee to CMA's placement, so allocating a zone specific
atomic pool from CMA might return memory from a completely different
memory zone. To get around this double check CMA's placement before
allocating from it.

Signed-off-by: Nicolas Saenz Julienne &lt;nsaenzjulienne@suse.de&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>dma-pool: fix coherent pool allocations for IOMMU mappings</title>
<updated>2020-08-14T14:27:00Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2020-08-14T10:26:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9420139f516d7fbc248ce17f35275cb005ed98ea'/>
<id>urn:sha1:9420139f516d7fbc248ce17f35275cb005ed98ea</id>
<content type='text'>
When allocating coherent pool memory for an IOMMU mapping we don't care
about the DMA mask.  Move the guess for the initial GFP mask into the
dma_direct_alloc_pages and pass dma_coherent_ok as a function pointer
argument so that it doesn't get applied to the IOMMU case.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Tested-by: Amit Pundir &lt;amit.pundir@linaro.org&gt;
</content>
</entry>
<entry>
<title>dma-pool: do not allocate pool memory from CMA</title>
<updated>2020-07-14T13:46:32Z</updated>
<author>
<name>Nicolas Saenz Julienne</name>
<email>nsaenzjulienne@suse.de</email>
</author>
<published>2020-07-08T16:49:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d9765e41d8e9ea2251bf73735a2895c8bad546fc'/>
<id>urn:sha1:d9765e41d8e9ea2251bf73735a2895c8bad546fc</id>
<content type='text'>
There is no guarantee to CMA's placement, so allocating a zone specific
atomic pool from CMA might return memory from a completely different
memory zone. So stop using it.

Fixes: c84dc6e68a1d ("dma-pool: add additional coherent pools to map to gfp mask")
Reported-by: Jeremy Linton &lt;jeremy.linton@arm.com&gt;
Signed-off-by: Nicolas Saenz Julienne &lt;nsaenzjulienne@suse.de&gt;
Tested-by: Jeremy Linton &lt;jeremy.linton@arm.com&gt;
Acked-by: David Rientjes &lt;rientjes@google.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>dma-pool: make sure atomic pool suits device</title>
<updated>2020-07-14T13:42:33Z</updated>
<author>
<name>Nicolas Saenz Julienne</name>
<email>nsaenzjulienne@suse.de</email>
</author>
<published>2020-07-14T12:39:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=81e9d894e03f9a279102c7aac62ea7cbf9949f4b'/>
<id>urn:sha1:81e9d894e03f9a279102c7aac62ea7cbf9949f4b</id>
<content type='text'>
When allocating DMA memory from a pool, the core can only guess which
atomic pool will fit a device's constraints. If it doesn't, get a safer
atomic pool and try again.

Fixes: c84dc6e68a1d ("dma-pool: add additional coherent pools to map to gfp mask")
Reported-by: Jeremy Linton &lt;jeremy.linton@arm.com&gt;
Suggested-by: Robin Murphy &lt;robin.murphy@arm.com&gt;
Signed-off-by: Nicolas Saenz Julienne &lt;nsaenzjulienne@suse.de&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>dma-pool: introduce dma_guess_pool()</title>
<updated>2020-07-14T13:42:30Z</updated>
<author>
<name>Nicolas Saenz Julienne</name>
<email>nsaenzjulienne@suse.de</email>
</author>
<published>2020-07-14T12:39:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=48b6703858dd5526c82d8ff2dbac59acab3a9dda'/>
<id>urn:sha1:48b6703858dd5526c82d8ff2dbac59acab3a9dda</id>
<content type='text'>
dma-pool's dev_to_pool() creates the false impression that there is a
way to grantee a mapping between a device's DMA constraints and an
atomic pool. It tuns out it's just a guess, and the device might need to
use an atomic pool containing memory from a 'safer' (or lower) memory
zone.

To help mitigate this, introduce dma_guess_pool() which can be fed a
device's DMA constraints and atomic pools already known to be faulty, in
order for it to provide an better guess on which pool to use.

Signed-off-by: Nicolas Saenz Julienne &lt;nsaenzjulienne@suse.de&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>dma-pool: get rid of dma_in_atomic_pool()</title>
<updated>2020-07-14T13:42:27Z</updated>
<author>
<name>Nicolas Saenz Julienne</name>
<email>nsaenzjulienne@suse.de</email>
</author>
<published>2020-07-14T12:39:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=23e469be6239d9cf3d921fc3e38545491df56534'/>
<id>urn:sha1:23e469be6239d9cf3d921fc3e38545491df56534</id>
<content type='text'>
The function is only used once and can be simplified to a one-liner.

Signed-off-by: Nicolas Saenz Julienne &lt;nsaenzjulienne@suse.de&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>dma-mapping: warn when coherent pool is depleted</title>
<updated>2020-06-29T08:05:21Z</updated>
<author>
<name>David Rientjes</name>
<email>rientjes@google.com</email>
</author>
<published>2020-06-21T20:43:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=71cdec4fab76667dabdbb2ca232b039004ebd40f'/>
<id>urn:sha1:71cdec4fab76667dabdbb2ca232b039004ebd40f</id>
<content type='text'>
When a DMA coherent pool is depleted, allocation failures may or may not
get reported in the kernel log depending on the allocator.

The admin does have a workaround, however, by using coherent_pool= on the
kernel command line.

Provide some guidance on the failure and a recommended minimum size for
the pools (double the size).

Signed-off-by: David Rientjes &lt;rientjes@google.com&gt;
Tested-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>dma-pool: fix too large DMA pools on medium memory size systems</title>
<updated>2020-06-09T13:25:52Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert@linux-m68k.org</email>
</author>
<published>2020-06-08T13:22:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3ee06a6d532f75f20528ff4d2c473cda36c484fe'/>
<id>urn:sha1:3ee06a6d532f75f20528ff4d2c473cda36c484fe</id>
<content type='text'>
On systems with at least 32 MiB, but less than 32 GiB of RAM, the DMA
memory pools are much larger than intended (e.g. 2 MiB instead of 128
KiB on a 256 MiB system).

Fix this by correcting the calculation of the number of GiBs of RAM in
the system.  Invert the order of the min/max operations, to keep on
calculating in pages until the last step, which aids readability.

Fixes: 1d659236fb43c4d2 ("dma-pool: scale the default DMA coherent pool size with memory capacity")
Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Acked-by: David Rientjes &lt;rientjes@google.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>dma-pool: scale the default DMA coherent pool size with memory capacity</title>
<updated>2020-04-25T11:17:06Z</updated>
<author>
<name>David Rientjes</name>
<email>rientjes@google.com</email>
</author>
<published>2020-04-15T00:05:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1d659236fb43c4d2b37af7a4309681e834e9ec9a'/>
<id>urn:sha1:1d659236fb43c4d2b37af7a4309681e834e9ec9a</id>
<content type='text'>
When AMD memory encryption is enabled, some devices may use more than
256KB/sec from the atomic pools.  It would be more appropriate to scale
the default size based on memory capacity unless the coherent_pool
option is used on the kernel command line.

This provides a slight optimization on initial expansion and is deemed
appropriate due to the increased reliance on the atomic pools.  Note that
the default size of 128KB per pool will normally be larger than the
single coherent pool implementation since there are now up to three
coherent pools (DMA, DMA32, and kernel).

Note that even prior to this patch, coherent_pool= for sizes larger than
1 &lt;&lt; (PAGE_SHIFT + MAX_ORDER-1) can fail.  With new dynamic expansion
support, this would be trivially extensible to allow even larger initial
sizes.

Signed-off-by: David Rientjes &lt;rientjes@google.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
</feed>
