[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0B164192-F549-4D5E-BB07-B51886D936B0@intel.com>
Date: Fri, 13 Jan 2017 01:11:51 +0000
From: "Dilger, Andreas" <andreas.dilger@...el.com>
To: Michal Hocko <mhocko@...nel.org>
CC: Andrew Morton <akpm@...ux-foundation.org>,
Vlastimil Babka <vbabka@...e.cz>,
David Rientjes <rientjes@...gle.com>,
Mel Gorman <mgorman@...e.de>,
Johannes Weiner <hannes@...xchg.org>,
Al Viro <viro@...iv.linux.org.uk>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>,
Michal Hocko <mhocko@...e.com>,
"Martin Schwidefsky" <schwidefsky@...ibm.com>,
Heiko Carstens <heiko.carstens@...ibm.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
Anton Vorontsov <anton@...msg.org>,
Colin Cross <ccross@...roid.com>,
"Kees Cook" <keescook@...omium.org>,
"Luck, Tony" <tony.luck@...el.com>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Ben Skeggs <bskeggs@...hat.com>,
"Kent Overstreet" <kent.overstreet@...il.com>,
Santosh Raspatur <santosh@...lsio.com>,
Hariprasad S <hariprasad@...lsio.com>,
Tariq Toukan <tariqt@...lanox.com>,
Yishai Hadas <yishaih@...lanox.com>,
"Williams, Dan J" <dan.j.williams@...el.com>,
"Drokin, Oleg" <oleg.drokin@...el.com>,
"Boris Ostrovsky" <boris.ostrovsky@...cle.com>,
David Sterba <dsterba@...e.com>,
"Yan, Zheng" <zyan@...hat.com>, Ilya Dryomov <idryomov@...il.com>,
"Alexei Starovoitov" <ast@...nel.org>,
Eric Dumazet <eric.dumazet@...il.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded
variants
> On Jan 12, 2017, at 08:37, Michal Hocko <mhocko@...nel.org> wrote:
>
> From: Michal Hocko <mhocko@...e.com>
>
> 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 killer to
> satisfy the allocation. This sounds too disruptive for something that
> has a reasonable fallback - the vmalloc. On the other hand those
> requests might fallback to vmalloc even when the memory allocator would
> succeed after several more reclaim/compaction attempts previously. There
> is no guarantee something like that happens though.
>
> This patch converts many of those places to kv[mz]alloc* helpers because
> they are more conservative.
>
> Signed-off-by: Michal Hocko <mhocko@...e.com>
Lustre part can be
Acked-by: Andreas Dilger <andreas.dilger@...el.com>
[snip]
> diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-mem.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-mem.c
> index a6a76a681ea9..8f638267e704 100644
> --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-mem.c
> +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-mem.c
> @@ -45,15 +45,6 @@ EXPORT_SYMBOL(libcfs_kvzalloc);
> void *libcfs_kvzalloc_cpt(struct cfs_cpt_table *cptab, int cpt, size_t size,
> gfp_t flags)
> {
> - void *ret;
> -
> - ret = kzalloc_node(size, flags | __GFP_NOWARN,
> - cfs_cpt_spread_node(cptab, cpt));
> - if (!ret) {
> - WARN_ON(!(flags & (__GFP_FS | __GFP_HIGH)));
> - ret = vmalloc_node(size, cfs_cpt_spread_node(cptab, cpt));
> - }
> -
> - return ret;
> + return kvzalloc_node(size, flags, cfs_cpt_spread_node(cptab, cpt));
> }
> EXPORT_SYMBOL(libcfs_kvzalloc_cpt);
Powered by blists - more mailing lists