Re: [dm-devel] [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-19 Thread Andrew Morton
On Thu, 19 Apr 2018 17:19:20 -0400 (EDT) Mikulas Patocka wrote: > > > In order to detect these bugs reliably I submit this patch that changes > > > kvmalloc to always use vmalloc if CONFIG_DEBUG_VM is turned on. > > > > > > ... > > > > > > --- linux-2.6.orig/mm/util.c 2018-04-18 15:46:23.0

[dm-devel] [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_SG

2018-04-19 Thread Mikulas Patocka
On Thu, 19 Apr 2018, Michael S. Tsirkin wrote: > Maybe make it conditional on CONFIG_DEBUG_SG too? > Otherwise I think you just trigger a hard to debug memory corruption. OK, here I resend the patch with CONFIG_DEBUG_SG. With CONFIG_DEBUG_SG, the DMA API will print a stacktrace where the misus

Re: [dm-devel] [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-19 Thread Mikulas Patocka
On Thu, 19 Apr 2018, Andrew Morton wrote: > On Thu, 19 Apr 2018 12:12:38 -0400 (EDT) Mikulas Patocka > wrote: > > > The kvmalloc function tries to use kmalloc and falls back to vmalloc if > > kmalloc fails. > > > > Unfortunatelly, some kernel code has bugs - it uses kvmalloc and then > > use

Re: [dm-devel] [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-19 Thread Andrew Morton
On Thu, 19 Apr 2018 12:12:38 -0400 (EDT) Mikulas Patocka wrote: > The kvmalloc function tries to use kmalloc and falls back to vmalloc if > kmalloc fails. > > Unfortunatelly, some kernel code has bugs - it uses kvmalloc and then > uses DMA-API on the returned memory or frees it with kfree. Such

[dm-devel] [LSF/MM TOPIC] Extended copy

2018-04-19 Thread Bart Van Assche
During a recent discussion about peer-to-peer PCIe transfers it was brought up that it would be desirable to invoke this functionality from user space. One possible approach is to add support for an "extended copy" operation to the block layer and to make it possible to use that functionality from

Re: [dm-devel] [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-19 Thread Mikulas Patocka
On Thu, 19 Apr 2018, Eric Dumazet wrote: > > > On 04/19/2018 09:12 AM, Mikulas Patocka wrote: > > > > > > These bugs are hard to reproduce because vmalloc falls back to kmalloc > > only if memory is fragmented. > > > > This sentence is wrong. > > because kvmalloc() falls back to vmal

Re: [dm-devel] [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-19 Thread Eric Dumazet
On 04/19/2018 09:12 AM, Mikulas Patocka wrote: > > > These bugs are hard to reproduce because vmalloc falls back to kmalloc > only if memory is fragmented. > This sentence is wrong. because kvmalloc() falls back to vmalloc() ... -- dm-devel mailing list dm-devel@redhat.com https://www.

[dm-devel] [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-19 Thread Mikulas Patocka
On Wed, 18 Apr 2018, Mikulas Patocka wrote: > > > On Wed, 18 Apr 2018, David Miller wrote: > > > From: Mikulas Patocka > > Date: Wed, 18 Apr 2018 12:44:25 -0400 (EDT) > > > > > The structure net_device is followed by arbitrary driver-specific data > > > (accessible with the function netdev

[dm-devel] [PATCH] dm bufio: fix buffer alignment

2018-04-19 Thread Mikulas Patocka
The patch 6b5e718cc138 ("dm bufio: relax alignment constraint on slab cache") relaxed alignment on dm-bufio cache, however it may break dm-crypt or dm-integrity. dm-crypt and dm-integrity require that the size of bio vector entries (bv_len) is aligned on its sector size. bv_offset doesn't have to

Re: [dm-devel] [PATCH] SLUB: Do not fallback to mininum order if __GFP_NORETRY is set

2018-04-19 Thread Michal Hocko
On Wed 18-04-18 09:45:39, Cristopher Lameter wrote: > Mikulas Patoka wants to ensure that no fallback to lower order happens. I > think __GFP_NORETRY should work correctly in that case too and not fall > back. Overriding __GFP_NORETRY is just a bad idea. It will make the semantic of the flag just