Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-25 Thread Ilya Dryomov
On Wed, Jan 25, 2017 at 2:09 PM, Michal Hocko wrote: > On Wed 25-01-17 12:15:59, Vlastimil Babka wrote: >> On 01/24/2017 04:00 PM, Michal Hocko wrote: >> > > > Well, I am not opposed to kvmalloc_array but I would argue that this >> > > > conversion cannot introduce new overflow

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-25 Thread Ilya Dryomov
On Wed, Jan 25, 2017 at 2:09 PM, Michal Hocko wrote: > On Wed 25-01-17 12:15:59, Vlastimil Babka wrote: >> On 01/24/2017 04:00 PM, Michal Hocko wrote: >> > > > Well, I am not opposed to kvmalloc_array but I would argue that this >> > > > conversion cannot introduce new overflow issues. The code

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-25 Thread Michal Hocko
On Wed 25-01-17 12:15:59, Vlastimil Babka wrote: > On 01/24/2017 04:00 PM, Michal Hocko wrote: > > > > Well, I am not opposed to kvmalloc_array but I would argue that this > > > > conversion cannot introduce new overflow issues. The code would have > > > > to be broken already because even though

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-25 Thread Michal Hocko
On Wed 25-01-17 12:15:59, Vlastimil Babka wrote: > On 01/24/2017 04:00 PM, Michal Hocko wrote: > > > > Well, I am not opposed to kvmalloc_array but I would argue that this > > > > conversion cannot introduce new overflow issues. The code would have > > > > to be broken already because even though

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-25 Thread Vlastimil Babka
On 01/24/2017 04:00 PM, Michal Hocko wrote: > Well, I am not opposed to kvmalloc_array but I would argue that this > conversion cannot introduce new overflow issues. The code would have > to be broken already because even though kmalloc_array checks for the > overflow but vmalloc fallback

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-25 Thread Vlastimil Babka
On 01/24/2017 04:00 PM, Michal Hocko wrote: > Well, I am not opposed to kvmalloc_array but I would argue that this > conversion cannot introduce new overflow issues. The code would have > to be broken already because even though kmalloc_array checks for the > overflow but vmalloc fallback

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-24 Thread Michal Hocko
On Fri 20-01-17 14:41:37, Vlastimil Babka wrote: > On 01/12/2017 06:37 PM, Michal Hocko wrote: > > On Thu 12-01-17 09:26:09, Kees Cook wrote: > >> On Thu, Jan 12, 2017 at 7:37 AM, Michal Hocko wrote: > > [...] > >>> diff --git a/arch/s390/kvm/kvm-s390.c

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-24 Thread Michal Hocko
On Fri 20-01-17 14:41:37, Vlastimil Babka wrote: > On 01/12/2017 06:37 PM, Michal Hocko wrote: > > On Thu 12-01-17 09:26:09, Kees Cook wrote: > >> On Thu, Jan 12, 2017 at 7:37 AM, Michal Hocko wrote: > > [...] > >>> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c > >>> index

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-20 Thread Vlastimil Babka
On 01/12/2017 06:37 PM, Michal Hocko wrote: > On Thu 12-01-17 09:26:09, Kees Cook wrote: >> On Thu, Jan 12, 2017 at 7:37 AM, Michal Hocko wrote: > [...] >>> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c >>> index 4f74511015b8..e6bbb33d2956 100644 >>> ---

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-20 Thread Vlastimil Babka
On 01/12/2017 06:37 PM, Michal Hocko wrote: > On Thu 12-01-17 09:26:09, Kees Cook wrote: >> On Thu, Jan 12, 2017 at 7:37 AM, Michal Hocko wrote: > [...] >>> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c >>> index 4f74511015b8..e6bbb33d2956 100644 >>> ---

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-16 Thread Leon Romanovsky
On Mon, Jan 16, 2017 at 08:33:11AM +0100, Michal Hocko wrote: > On Sat 14-01-17 12:56:32, Leon Romanovsky wrote: > [...] > > Hi Michal, > > > > I don't see mlx5_vzalloc in the changed list. Any reason why did you skip > > it? > > > > 881 static inline void *mlx5_vzalloc(unsigned long size) > >

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-16 Thread Leon Romanovsky
On Mon, Jan 16, 2017 at 08:33:11AM +0100, Michal Hocko wrote: > On Sat 14-01-17 12:56:32, Leon Romanovsky wrote: > [...] > > Hi Michal, > > > > I don't see mlx5_vzalloc in the changed list. Any reason why did you skip > > it? > > > > 881 static inline void *mlx5_vzalloc(unsigned long size) > >

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-16 Thread Tariq Toukan
On 12/01/2017 5:37 PM, Michal Hocko wrote: From: Michal Hocko There are many code paths opencoding kvmalloc. Let's use the helper instead. The main difference to kvmalloc is that those users are usually not considering all the aspects of the memory allocator. E.g. allocation

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-16 Thread Tariq Toukan
On 12/01/2017 5:37 PM, Michal Hocko wrote: From: Michal Hocko There are many code paths opencoding kvmalloc. Let's use the helper instead. The main difference to kvmalloc is that those users are usually not considering all the aspects of the memory allocator. E.g. allocation requests < 64kB

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-15 Thread Michal Hocko
On Sat 14-01-17 12:56:32, Leon Romanovsky wrote: [...] > Hi Michal, > > I don't see mlx5_vzalloc in the changed list. Any reason why did you skip it? > > 881 static inline void *mlx5_vzalloc(unsigned long size) > 882 { > 883 void *rtn; > 884 > 885 rtn = kzalloc(size,

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-15 Thread Michal Hocko
On Sat 14-01-17 12:56:32, Leon Romanovsky wrote: [...] > Hi Michal, > > I don't see mlx5_vzalloc in the changed list. Any reason why did you skip it? > > 881 static inline void *mlx5_vzalloc(unsigned long size) > 882 { > 883 void *rtn; > 884 > 885 rtn = kzalloc(size,

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-14 Thread Leon Romanovsky
On Thu, Jan 12, 2017 at 04:37:16PM +0100, Michal Hocko wrote: > From: Michal Hocko > > There are many code paths opencoding kvmalloc. Let's use the helper > instead. The main difference to kvmalloc is that those users are usually > not considering all the aspects of the memory

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-14 Thread Leon Romanovsky
On Thu, Jan 12, 2017 at 04:37:16PM +0100, Michal Hocko wrote: > From: Michal Hocko > > There are many code paths opencoding kvmalloc. Let's use the helper > instead. The main difference to kvmalloc is that those users are usually > not considering all the aspects of the memory allocator. E.g.

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-14 Thread Michal Hocko
On Sat 14-01-17 12:01:50, Tetsuo Handa wrote: > On 2017/01/13 2:29, Michal Hocko wrote: > > Ilya has noticed that I've screwed up some k[zc]alloc conversions and > > didn't use the kvzalloc. This is an updated patch with some acks > > collected on the way > > --- > > From

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-14 Thread Michal Hocko
On Sat 14-01-17 12:01:50, Tetsuo Handa wrote: > On 2017/01/13 2:29, Michal Hocko wrote: > > Ilya has noticed that I've screwed up some k[zc]alloc conversions and > > didn't use the kvzalloc. This is an updated patch with some acks > > collected on the way > > --- > > From

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-13 Thread Tetsuo Handa
On 2017/01/13 2:29, Michal Hocko wrote: > Ilya has noticed that I've screwed up some k[zc]alloc conversions and > didn't use the kvzalloc. This is an updated patch with some acks > collected on the way > --- > From a7b89c6d0a3c685045e37740c8f97b065f37e0a4 Mon Sep 17 00:00:00 2001 > From: Michal

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-13 Thread Tetsuo Handa
On 2017/01/13 2:29, Michal Hocko wrote: > Ilya has noticed that I've screwed up some k[zc]alloc conversions and > didn't use the kvzalloc. This is an updated patch with some acks > collected on the way > --- > From a7b89c6d0a3c685045e37740c8f97b065f37e0a4 Mon Sep 17 00:00:00 2001 > From: Michal

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-12 Thread Dilger, Andreas
> On Jan 12, 2017, at 08:37, Michal Hocko wrote: > > From: Michal Hocko > > There are many code paths opencoding kvmalloc. Let's use the helper > instead. The main difference to kvmalloc is that those users are usually > not considering all the aspects of

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-12 Thread Dilger, Andreas
> On Jan 12, 2017, at 08:37, Michal Hocko wrote: > > From: Michal Hocko > > There are many code paths opencoding kvmalloc. Let's use the helper > instead. The main difference to kvmalloc is that those users are usually > not considering all the aspects of the memory allocator. E.g. allocation

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-12 Thread Boris Ostrovsky
> diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c > index 6890897a6f30..10f1ef582659 100644 > --- a/drivers/xen/evtchn.c > +++ b/drivers/xen/evtchn.c > @@ -87,18 +87,6 @@ struct user_evtchn { > bool enabled; > }; > > -static evtchn_port_t *evtchn_alloc_ring(unsigned int size) >

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-12 Thread Boris Ostrovsky
> diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c > index 6890897a6f30..10f1ef582659 100644 > --- a/drivers/xen/evtchn.c > +++ b/drivers/xen/evtchn.c > @@ -87,18 +87,6 @@ struct user_evtchn { > bool enabled; > }; > > -static evtchn_port_t *evtchn_alloc_ring(unsigned int size) >

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-12 Thread Michal Hocko
On Thu 12-01-17 09:26:09, Kees Cook wrote: > On Thu, Jan 12, 2017 at 7:37 AM, Michal Hocko wrote: [...] > > diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c > > index 4f74511015b8..e6bbb33d2956 100644 > > --- a/arch/s390/kvm/kvm-s390.c > > +++

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-12 Thread Michal Hocko
On Thu 12-01-17 09:26:09, Kees Cook wrote: > On Thu, Jan 12, 2017 at 7:37 AM, Michal Hocko wrote: [...] > > diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c > > index 4f74511015b8..e6bbb33d2956 100644 > > --- a/arch/s390/kvm/kvm-s390.c > > +++ b/arch/s390/kvm/kvm-s390.c > > @@

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-12 Thread Michal Hocko
Ilya has noticed that I've screwed up some k[zc]alloc conversions and didn't use the kvzalloc. This is an updated patch with some acks collected on the way --- >From a7b89c6d0a3c685045e37740c8f97b065f37e0a4 Mon Sep 17 00:00:00 2001 From: Michal Hocko Date: Wed, 4 Jan 2017

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-12 Thread Michal Hocko
Ilya has noticed that I've screwed up some k[zc]alloc conversions and didn't use the kvzalloc. This is an updated patch with some acks collected on the way --- >From a7b89c6d0a3c685045e37740c8f97b065f37e0a4 Mon Sep 17 00:00:00 2001 From: Michal Hocko Date: Wed, 4 Jan 2017 13:30:32 +0100 Subject:

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-12 Thread Kees Cook
On Thu, Jan 12, 2017 at 7:37 AM, Michal Hocko wrote: > From: Michal Hocko > > There are many code paths opencoding kvmalloc. Let's use the helper > instead. The main difference to kvmalloc is that those users are usually > not considering all the aspects of

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-12 Thread Kees Cook
On Thu, Jan 12, 2017 at 7:37 AM, Michal Hocko wrote: > From: Michal Hocko > > There are many code paths opencoding kvmalloc. Let's use the helper > instead. The main difference to kvmalloc is that those users are usually > not considering all the aspects of the memory allocator. E.g. allocation

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-12 Thread Michal Hocko
On Thu 12-01-17 17:54:34, Ilya Dryomov wrote: > On Thu, Jan 12, 2017 at 4:37 PM, Michal Hocko wrote: > > From: Michal Hocko > > > > There are many code paths opencoding kvmalloc. Let's use the helper > > instead. The main difference to kvmalloc is that those

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-12 Thread Michal Hocko
On Thu 12-01-17 17:54:34, Ilya Dryomov wrote: > On Thu, Jan 12, 2017 at 4:37 PM, Michal Hocko wrote: > > From: Michal Hocko > > > > There are many code paths opencoding kvmalloc. Let's use the helper > > instead. The main difference to kvmalloc is that those users are usually > > not considering

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-12 Thread Dan Williams
On Thu, Jan 12, 2017 at 7:37 AM, Michal Hocko wrote: > From: Michal Hocko > > There are many code paths opencoding kvmalloc. Let's use the helper > instead. The main difference to kvmalloc is that those users are usually > not considering all the aspects of

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-12 Thread Dan Williams
On Thu, Jan 12, 2017 at 7:37 AM, Michal Hocko wrote: > From: Michal Hocko > > There are many code paths opencoding kvmalloc. Let's use the helper > instead. The main difference to kvmalloc is that those users are usually > not considering all the aspects of the memory allocator. E.g. allocation

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-12 Thread Ilya Dryomov
On Thu, Jan 12, 2017 at 4:37 PM, Michal Hocko wrote: > From: Michal Hocko > > There are many code paths opencoding kvmalloc. Let's use the helper > instead. The main difference to kvmalloc is that those users are usually > not considering all the aspects of

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-12 Thread Ilya Dryomov
On Thu, Jan 12, 2017 at 4:37 PM, Michal Hocko wrote: > From: Michal Hocko > > There are many code paths opencoding kvmalloc. Let's use the helper > instead. The main difference to kvmalloc is that those users are usually > not considering all the aspects of the memory allocator. E.g. allocation

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-12 Thread Christian Borntraeger
On 01/12/2017 04:37 PM, Michal Hocko wrote: > diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c > index 4f74511015b8..e6bbb33d2956 100644 > --- a/arch/s390/kvm/kvm-s390.c > +++ b/arch/s390/kvm/kvm-s390.c > @@ -1126,10 +1126,7 @@ static long kvm_s390_get_skeys(struct kvm *kvm, struct

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-12 Thread Christian Borntraeger
On 01/12/2017 04:37 PM, Michal Hocko wrote: > diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c > index 4f74511015b8..e6bbb33d2956 100644 > --- a/arch/s390/kvm/kvm-s390.c > +++ b/arch/s390/kvm/kvm-s390.c > @@ -1126,10 +1126,7 @@ static long kvm_s390_get_skeys(struct kvm *kvm, struct

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-12 Thread David Sterba
On Thu, Jan 12, 2017 at 04:37:16PM +0100, Michal Hocko wrote: > From: Michal Hocko > > There are many code paths opencoding kvmalloc. Let's use the helper > instead. The main difference to kvmalloc is that those users are usually > not considering all the aspects of the memory

Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-12 Thread David Sterba
On Thu, Jan 12, 2017 at 04:37:16PM +0100, Michal Hocko wrote: > From: Michal Hocko > > There are many code paths opencoding kvmalloc. Let's use the helper > instead. The main difference to kvmalloc is that those users are usually > not considering all the aspects of the memory allocator. E.g.

[PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-12 Thread Michal Hocko
From: Michal Hocko There are many code paths opencoding kvmalloc. Let's use the helper instead. The main difference to kvmalloc is that those users are usually not considering all the aspects of the memory allocator. E.g. allocation requests < 64kB are basically never failing

[PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants

2017-01-12 Thread Michal Hocko
From: Michal Hocko There are many code paths opencoding kvmalloc. Let's use the helper instead. The main difference to kvmalloc is that those users are usually not considering all the aspects of the memory allocator. E.g. allocation requests < 64kB are basically never failing and invoke OOM