Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1557944
| From | "Dilger, Andreas" <andreas.dilger@intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants |
| Date | 2017-01-13 02:20 +0100 |
| Message-ID | <sYYH8-2PK-3@gated-at.bofh.it> (permalink) |
| References | <sYPNw-5HL-19@gated-at.bofh.it> <sYPNw-5HL-17@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
> On Jan 12, 2017, at 08:37, Michal Hocko <mhocko@kernel.org> wrote:
>
> From: Michal Hocko <mhocko@suse.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@suse.com>
Lustre part can be
Acked-by: Andreas Dilger <andreas.dilger@intel.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);
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/6 v3] kvmalloc Michal Hocko <mhocko@kernel.org> - 2017-01-12 16:50 +0100
[PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants Michal Hocko <mhocko@kernel.org> - 2017-01-12 16:50 +0100
Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants David Sterba <dsterba@suse.cz> - 2017-01-12 17:00 +0100
Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants Christian Borntraeger <borntraeger@de.ibm.com> - 2017-01-12 17:10 +0100
Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants Ilya Dryomov <idryomov@gmail.com> - 2017-01-12 18:00 +0100
Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants Michal Hocko <mhocko@kernel.org> - 2017-01-12 18:20 +0100
Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants Dan Williams <dan.j.williams@intel.com> - 2017-01-12 18:10 +0100
Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants Kees Cook <keescook@chromium.org> - 2017-01-12 18:30 +0100
Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants Michal Hocko <mhocko@kernel.org> - 2017-01-12 18:40 +0100
Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants Michal Hocko <mhocko@kernel.org> - 2017-01-12 18:40 +0100
Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2017-01-14 04:10 +0100
Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants Michal Hocko <mhocko@kernel.org> - 2017-01-14 10:10 +0100
Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-01-12 21:20 +0100
Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants "Dilger, Andreas" <andreas.dilger@intel.com> - 2017-01-13 02:20 +0100
Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants Leon Romanovsky <leon@kernel.org> - 2017-01-14 12:00 +0100
Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants Michal Hocko <mhocko@kernel.org> - 2017-01-16 08:40 +0100
Re: [PATCH 5/6] treewide: use kv[mz]alloc* rather than opencoded variants Leon Romanovsky <leon@kernel.org> - 2017-01-16 09:30 +0100
[PATCH 4/6] ila: simplify a strange allocation pattern Michal Hocko <mhocko@kernel.org> - 2017-01-12 16:50 +0100
[PATCH 3/6] rhashtable: simplify a strange allocation pattern Michal Hocko <mhocko@kernel.org> - 2017-01-12 16:50 +0100
[PATCH 1/6] mm: introduce kv[mz]alloc helpers Michal Hocko <mhocko@kernel.org> - 2017-01-12 16:50 +0100
Re: [PATCH 1/6] mm: introduce kv[mz]alloc helpers John Hubbard <jhubbard@nvidia.com> - 2017-01-16 05:40 +0100
Re: [PATCH 1/6] mm: introduce kv[mz]alloc helpers Michal Hocko <mhocko@kernel.org> - 2017-01-16 09:50 +0100
Re: [PATCH 1/6] mm: introduce kv[mz]alloc helpers John Hubbard <jhubbard@nvidia.com> - 2017-01-16 20:10 +0100
csiph-web