Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-05-03 Thread Mikulas Patocka
On Tue, 1 May 2018, Andrew Morton wrote: > On Tue, 24 Apr 2018 12:33:01 -0400 (EDT) Mikulas Patocka > wrote: > > > > > > > On Tue, 24 Apr 2018, Michal Hocko wrote: > > > > > On Tue 24-04-18 11:30:40, Mikulas Patocka wrote: > > > > > > > > > > > > On Tue, 24 Apr

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-05-01 Thread Andrew Morton
On Tue, 24 Apr 2018 12:33:01 -0400 (EDT) Mikulas Patocka wrote: > > > On Tue, 24 Apr 2018, Michal Hocko wrote: > > > On Tue 24-04-18 11:30:40, Mikulas Patocka wrote: > > > > > > > > > On Tue, 24 Apr 2018, Michal Hocko wrote: > > > > > > > On Mon 23-04-18 20:25:15,

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-24 Thread Mikulas Patocka
On Tue, 24 Apr 2018, Michal Hocko wrote: > On Tue 24-04-18 11:30:40, Mikulas Patocka wrote: > > > > > > On Tue, 24 Apr 2018, Michal Hocko wrote: > > > > > On Mon 23-04-18 20:25:15, Mikulas Patocka wrote: > > > > > > > Fixing __vmalloc code > > > > is easy and it doesn't require cooperation

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-24 Thread Michal Hocko
On Tue 24-04-18 10:12:42, Michal Hocko wrote: > On Tue 24-04-18 11:30:40, Mikulas Patocka wrote: > > > > > > On Tue, 24 Apr 2018, Michal Hocko wrote: > > > > > On Mon 23-04-18 20:25:15, Mikulas Patocka wrote: > > > > > > > Fixing __vmalloc code > > > > is easy and it doesn't require

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-24 Thread Michal Hocko
On Tue 24-04-18 11:30:40, Mikulas Patocka wrote: > > > On Tue, 24 Apr 2018, Michal Hocko wrote: > > > On Mon 23-04-18 20:25:15, Mikulas Patocka wrote: > > > > > Fixing __vmalloc code > > > is easy and it doesn't require cooperation with maintainers. > > > > But it is a hack against the

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-24 Thread Mikulas Patocka
On Tue, 24 Apr 2018, Michal Hocko wrote: > On Mon 23-04-18 20:25:15, Mikulas Patocka wrote: > > > Fixing __vmalloc code > > is easy and it doesn't require cooperation with maintainers. > > But it is a hack against the intention of the scope api. It is not! You can fix __vmalloc now and you

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-24 Thread Michal Hocko
On Mon 23-04-18 20:25:15, Mikulas Patocka wrote: > > > On Mon, 23 Apr 2018, Michal Hocko wrote: > > > On Mon 23-04-18 10:06:08, Mikulas Patocka wrote: > > > > > > > He didn't want to fix vmalloc(GFP_NOIO) > > > > > > > > I don't remember that conversation, so I don't know whether I agree with

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-23 Thread Mikulas Patocka
On Mon, 23 Apr 2018, Michal Hocko wrote: > On Mon 23-04-18 10:06:08, Mikulas Patocka wrote: > > > > > He didn't want to fix vmalloc(GFP_NOIO) > > > > > > I don't remember that conversation, so I don't know whether I agree with > > > his reasoning or not. But we are supposed to be moving away

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-23 Thread Mikulas Patocka
On Mon, 23 Apr 2018, Michal Hocko wrote: > On Mon 23-04-18 10:24:02, Mikulas Patocka wrote: > > > > Really, we have a fault injection framework and this sounds like > > > something to hook in there. > > > > The testing people won't set it up. They install the "kernel-debug" > > package and

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-23 Thread Michael S. Tsirkin
On Fri, Apr 20, 2018 at 08:20:23AM -0400, Mikulas Patocka wrote: > > > On Fri, 20 Apr 2018, Matthew Wilcox wrote: > > > On Thu, Apr 19, 2018 at 12:12:38PM -0400, Mikulas Patocka wrote: > > > Unfortunatelly, some kernel code has bugs - it uses kvmalloc and then > > > uses DMA-API on the returned

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-23 Thread Michal Hocko
On Mon 23-04-18 10:06:08, Mikulas Patocka wrote: > > > On Sat, 21 Apr 2018, Matthew Wilcox wrote: > > > On Fri, Apr 20, 2018 at 05:21:26PM -0400, Mikulas Patocka wrote: > > > On Fri, 20 Apr 2018, Matthew Wilcox wrote: > > > > On Fri, Apr 20, 2018 at 04:54:53PM -0400, Mikulas Patocka wrote: > >

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-23 Thread Michal Hocko
On Mon 23-04-18 10:24:02, Mikulas Patocka wrote: [...] I am not going to comment on your continuous accusations. We can discuss patches but general rants make very limited sense. > > > > I already said that we can change it from CONFIG_DEBUG_VM to > > > > CONFIG_DEBUG_SG - or to whatever other

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-23 Thread Mikulas Patocka
On Sun, 22 Apr 2018, Michal Hocko wrote: > On Sat 21-04-18 07:47:57, Matthew Wilcox wrote: > > > > He didn't want to fix vmalloc(GFP_NOIO) > > > > I don't remember that conversation, so I don't know whether I agree with > > his reasoning or not. But we are supposed to be moving away from

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-23 Thread Mikulas Patocka
On Sat, 21 Apr 2018, Matthew Wilcox wrote: > On Fri, Apr 20, 2018 at 05:21:26PM -0400, Mikulas Patocka wrote: > > On Fri, 20 Apr 2018, Matthew Wilcox wrote: > > > On Fri, Apr 20, 2018 at 04:54:53PM -0400, Mikulas Patocka wrote: > > > > On Fri, 20 Apr 2018, Michal Hocko wrote: > > > > > No way.

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-22 Thread Michal Hocko
On Sat 21-04-18 07:47:57, Matthew Wilcox wrote: > On Fri, Apr 20, 2018 at 05:21:26PM -0400, Mikulas Patocka wrote: > > On Fri, 20 Apr 2018, Matthew Wilcox wrote: > > > On Fri, Apr 20, 2018 at 04:54:53PM -0400, Mikulas Patocka wrote: > > > > On Fri, 20 Apr 2018, Michal Hocko wrote: > > > > > No

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-21 Thread Matthew Wilcox
On Fri, Apr 20, 2018 at 05:21:26PM -0400, Mikulas Patocka wrote: > On Fri, 20 Apr 2018, Matthew Wilcox wrote: > > On Fri, Apr 20, 2018 at 04:54:53PM -0400, Mikulas Patocka wrote: > > > On Fri, 20 Apr 2018, Michal Hocko wrote: > > > > No way. This is just wrong! First of all, you will explode most

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-20 Thread Mikulas Patocka
On Fri, 20 Apr 2018, Matthew Wilcox wrote: > On Fri, Apr 20, 2018 at 04:54:53PM -0400, Mikulas Patocka wrote: > > On Fri, 20 Apr 2018, Michal Hocko wrote: > > > No way. This is just wrong! First of all, you will explode most likely > > > on many allocations of small sizes. Second,

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-20 Thread Matthew Wilcox
On Fri, Apr 20, 2018 at 04:54:53PM -0400, Mikulas Patocka wrote: > On Fri, 20 Apr 2018, Michal Hocko wrote: > > No way. This is just wrong! First of all, you will explode most likely > > on many allocations of small sizes. Second, CONFIG_DEBUG_VM tends to be > > enabled quite often. > > You're an

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-20 Thread Mikulas Patocka
On Fri, 20 Apr 2018, Michal Hocko wrote: > On Fri 20-04-18 06:41:36, Matthew Wilcox wrote: > > On Fri, Apr 20, 2018 at 03:08:52PM +0200, Michal Hocko wrote: > > > > In order to detect these bugs reliably I submit this patch that changes > > > > kvmalloc to always use vmalloc if CONFIG_DEBUG_VM

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-20 Thread Mikulas Patocka
On Fri, 20 Apr 2018, Michal Hocko wrote: > On Thu 19-04-18 12:12:38, Mikulas Patocka wrote: > [...] > > From: Mikulas Patocka <mpato...@redhat.com> > > Subject: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM > > > > The kvmalloc function tries to u

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-20 Thread Michal Hocko
On Fri 20-04-18 06:41:36, Matthew Wilcox wrote: > On Fri, Apr 20, 2018 at 03:08:52PM +0200, Michal Hocko 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. > > > > No way. This is just wrong!

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-20 Thread Matthew Wilcox
On Fri, Apr 20, 2018 at 03:08:52PM +0200, Michal Hocko 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. > > No way. This is just wrong! First of all, you will explode most likely > on many

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-20 Thread Michal Hocko
On Thu 19-04-18 12:12:38, Mikulas Patocka wrote: [...] > From: Mikulas Patocka <mpato...@redhat.com> > Subject: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM > > The kvmalloc function tries to use kmalloc and falls back to vmalloc if > kmalloc fails. > >

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-20 Thread Mikulas Patocka
On Fri, 20 Apr 2018, Matthew Wilcox wrote: > On Thu, Apr 19, 2018 at 12:12:38PM -0400, Mikulas Patocka wrote: > > Unfortunatelly, some kernel code has bugs - it uses kvmalloc and then > > uses DMA-API on the returned memory or frees it with kfree. Such bugs were > > found in the virtio-net

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-20 Thread Mikulas Patocka
On Thu, 19 Apr 2018, Andrew Morton wrote: > 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. > > > >

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-20 Thread Matthew Wilcox
On Thu, Apr 19, 2018 at 12:12:38PM -0400, Mikulas Patocka wrote: > Unfortunatelly, some kernel code has bugs - it uses kvmalloc and then > uses DMA-API on the returned memory or frees it with kfree. Such bugs were > found in the virtio-net driver, dm-integrity or RHEL7 powerpc-specific > code.

Re: [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

Re: [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

Re: [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

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-19 Thread Vlastimil Babka
On 04/19/2018 06:12 PM, Mikulas Patocka wrote: > From: Mikulas Patocka <mpato...@redhat.com> > Subject: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM > > The kvmalloc function tries to use kmalloc and falls back to vmalloc if > kmalloc fails. > > Unfortuna

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-19 Thread Michael S. Tsirkin
returns DMA-able area, but it > > may return non-DMA area rarely, if the memory is too fragmented. So, we > > are in a situation, where some networking drivers will randomly fail. Go > > and find them. > > > > Mikulas > > Her I submit a patch that makes kvmall

Re: [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

Re: [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() ...

[PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-19 Thread Mikulas Patocka
y fail. Go > and find them. > > Mikulas Her I submit a patch that makes kvmalloc always use vmalloc if CONFIG_DEBUG_VM is defined. From: Mikulas Patocka <mpato...@redhat.com> Subject: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM The kvmalloc function tries to