From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750955AbdALUPd convert rfc822-to-8bit (ORCPT ); Thu, 12 Jan 2017 15:15:33 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:41510 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750746AbdALUPb (ORCPT ); Thu, 12 Jan 2017 15:15:31 -0500 Subject: Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants To: Michal Hocko , Andrew Morton References: <20170112153717.28943-1-mhocko@kernel.org> <20170112153717.28943-6-mhocko@kernel.org> Cc: Vlastimil Babka , David Rientjes , Mel Gorman , Johannes Weiner , Al Viro , linux-mm@kvack.org, LKML , Michal Hocko , Martin Schwidefsky , Heiko Carstens , Herbert Xu , Anton Vorontsov , Colin Cross , Kees Cook , Tony Luck , "Rafael J. Wysocki" , Ben Skeggs , Kent Overstreet , Santosh Raspatur , Hariprasad S , Tariq Toukan , Yishai Hadas , Dan Williams , Oleg Drokin , Andreas Dilger , David Sterba , "Yan, Zheng" , Ilya Dryomov , Alexei Starovoitov , Eric Dumazet , netdev@vger.kernel.org From: Boris Ostrovsky Message-ID: <09bbc480-1490-da27-732c-046e0ebfa89f@oracle.com> Date: Thu, 12 Jan 2017 15:14:54 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20170112153717.28943-6-mhocko@kernel.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8BIT X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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) > -{ > - evtchn_port_t *ring; > - size_t s = size * sizeof(*ring); > - > - ring = kmalloc(s, GFP_KERNEL); > - if (!ring) > - ring = vmalloc(s); > - > - return ring; > -} > - > static void evtchn_free_ring(evtchn_port_t *ring) > { > kvfree(ring); > @@ -334,7 +322,7 @@ static int evtchn_resize_ring(struct per_user_data *u) > else > new_size = 2 * u->ring_size; > > - new_ring = evtchn_alloc_ring(new_size); > + new_ring = kvmalloc(new_size * sizeof(*new_ring), GFP_KERNEL); > if (!new_ring) > return -ENOMEM; > Xen bits: Reviewed-by: Boris Ostrovsky From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants Date: Thu, 12 Jan 2017 15:14:54 -0500 Message-ID: <09bbc480-1490-da27-732c-046e0ebfa89f@oracle.com> References: <20170112153717.28943-1-mhocko@kernel.org> <20170112153717.28943-6-mhocko@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Cc: Vlastimil Babka , David Rientjes , Mel Gorman , Johannes Weiner , Al Viro , linux-mm@kvack.org, LKML , Michal Hocko , Martin Schwidefsky , Heiko Carstens , Herbert Xu , Anton Vorontsov , Colin Cross , Kees Cook , Tony Luck , "Rafael J. Wysocki" , Ben Skeggs , Kent Overstreet , Santosh Raspatur , Hariprasad S , Tariq Toukan , Yishai To: Michal Hocko , Andrew Morton Return-path: In-Reply-To: <20170112153717.28943-6-mhocko@kernel.org> Sender: owner-linux-mm@kvack.org List-Id: netdev.vger.kernel.org > 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; > }; > =20 > -static evtchn_port_t *evtchn_alloc_ring(unsigned int size) > -{ > - evtchn_port_t *ring; > - size_t s =3D size * sizeof(*ring); > - > - ring =3D kmalloc(s, GFP_KERNEL); > - if (!ring) > - ring =3D vmalloc(s); > - > - return ring; > -} > - > static void evtchn_free_ring(evtchn_port_t *ring) > { > kvfree(ring); > @@ -334,7 +322,7 @@ static int evtchn_resize_ring(struct per_user_data = *u) > else > new_size =3D 2 * u->ring_size; > =20 > - new_ring =3D evtchn_alloc_ring(new_size); > + new_ring =3D kvmalloc(new_size * sizeof(*new_ring), GFP_KERNEL); > if (!new_ring) > return -ENOMEM; > =20 Xen bits: Reviewed-by: Boris Ostrovsky -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb0-f197.google.com (mail-yb0-f197.google.com [209.85.213.197]) by kanga.kvack.org (Postfix) with ESMTP id 8014B6B0253 for ; Thu, 12 Jan 2017 15:15:14 -0500 (EST) Received: by mail-yb0-f197.google.com with SMTP id w194so37603189ybe.2 for ; Thu, 12 Jan 2017 12:15:14 -0800 (PST) Received: from userp1040.oracle.com (userp1040.oracle.com. [156.151.31.81]) by mx.google.com with ESMTPS id s22si2975729ybs.151.2017.01.12.12.15.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Jan 2017 12:15:13 -0800 (PST) Subject: Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants References: <20170112153717.28943-1-mhocko@kernel.org> <20170112153717.28943-6-mhocko@kernel.org> From: Boris Ostrovsky Message-ID: <09bbc480-1490-da27-732c-046e0ebfa89f@oracle.com> Date: Thu, 12 Jan 2017 15:14:54 -0500 MIME-Version: 1.0 In-Reply-To: <20170112153717.28943-6-mhocko@kernel.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko , Andrew Morton Cc: Vlastimil Babka , David Rientjes , Mel Gorman , Johannes Weiner , Al Viro , linux-mm@kvack.org, LKML , Michal Hocko , Martin Schwidefsky , Heiko Carstens , Herbert Xu , Anton Vorontsov , Colin Cross , Kees Cook , Tony Luck , "Rafael J. Wysocki" , Ben Skeggs , Kent Overstreet , Santosh Raspatur , Hariprasad S , Tariq Toukan , Yishai Hadas , Dan Williams , Oleg Drokin , Andreas Dilger , David Sterba , "Yan, Zheng" , Ilya Dryomov , Alexei Starovoitov , Eric Dumazet , netdev@vger.kernel.org > 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; > }; > =20 > -static evtchn_port_t *evtchn_alloc_ring(unsigned int size) > -{ > - evtchn_port_t *ring; > - size_t s =3D size * sizeof(*ring); > - > - ring =3D kmalloc(s, GFP_KERNEL); > - if (!ring) > - ring =3D vmalloc(s); > - > - return ring; > -} > - > static void evtchn_free_ring(evtchn_port_t *ring) > { > kvfree(ring); > @@ -334,7 +322,7 @@ static int evtchn_resize_ring(struct per_user_data = *u) > else > new_size =3D 2 * u->ring_size; > =20 > - new_ring =3D evtchn_alloc_ring(new_size); > + new_ring =3D kvmalloc(new_size * sizeof(*new_ring), GFP_KERNEL); > if (!new_ring) > return -ENOMEM; > =20 Xen bits: Reviewed-by: Boris Ostrovsky -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org