From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f70.google.com (mail-wm0-f70.google.com [74.125.82.70]) by kanga.kvack.org (Postfix) with ESMTP id 69F746B0033 for ; Mon, 16 Jan 2017 02:33:19 -0500 (EST) Received: by mail-wm0-f70.google.com with SMTP id c85so26230726wmi.6 for ; Sun, 15 Jan 2017 23:33:19 -0800 (PST) Received: from mx2.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id z80si11533128wmd.57.2017.01.15.23.33.17 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 15 Jan 2017 23:33:18 -0800 (PST) Date: Mon, 16 Jan 2017 08:33:11 +0100 From: Michal Hocko Subject: Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants Message-ID: <20170116073310.GA7981@dhcp22.suse.cz> References: <20170112153717.28943-1-mhocko@kernel.org> <20170112153717.28943-6-mhocko@kernel.org> <20170114105632.GV20392@mtr-leonro.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170114105632.GV20392@mtr-leonro.local> Sender: owner-linux-mm@kvack.org List-ID: To: Leon Romanovsky Cc: Andrew Morton , Vlastimil Babka , David Rientjes , Mel Gorman , Johannes Weiner , Al Viro , linux-mm@kvack.org, LKML , 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 , Boris Ostrovsky , David Sterba , "Yan, Zheng" , Ilya Dryomov , Alexei Starovoitov , Eric Dumazet , netdev@vger.kernel.org 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, GFP_KERNEL | __GFP_NOWARN); > 886 if (!rtn) > 887 rtn = vzalloc(size); > 888 return rtn; > 889 } No reason to skip it, I just didn't see it. I will fold the following in if you are OK with it --- diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index cdd2bd62f86d..5e6063170e48 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h @@ -874,12 +874,7 @@ static inline u16 cmdif_rev(struct mlx5_core_dev *dev) static inline void *mlx5_vzalloc(unsigned long size) { - void *rtn; - - rtn = kzalloc(size, GFP_KERNEL | __GFP_NOWARN); - if (!rtn) - rtn = vzalloc(size); - return rtn; + return kvzalloc(GFP_KERNEL, size); } static inline u32 mlx5_base_mkey(const u32 key) -- Michal Hocko SUSE Labs -- 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