On Mon, Jan 30, 2017 at 10:49:36AM +0100, Michal Hocko wrote:
> From: Michal Hocko <mho...@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 <= 32kB (with 4kB pages) 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.
>
> Changes since v1
> - add kvmalloc_array - this might silently fix some overflow issues
>   because most users simply didn't check the overflow for the vmalloc
>   fallback.
>
> Cc: Martin Schwidefsky <schwidef...@de.ibm.com>
> Cc: Heiko Carstens <heiko.carst...@de.ibm.com>
> Cc: Herbert Xu <herb...@gondor.apana.org.au>
> Cc: Anton Vorontsov <an...@enomsg.org>
> Cc: Colin Cross <ccr...@android.com>
> Cc: Kees Cook <keesc...@chromium.org>
> Cc: Tony Luck <tony.l...@intel.com>
> Cc: "Rafael J. Wysocki" <r...@rjwysocki.net>
> Cc: Ben Skeggs <bske...@redhat.com>
> Cc: Kent Overstreet <kent.overstr...@gmail.com>
> Cc: Santosh Raspatur <sant...@chelsio.com>
> Cc: Hariprasad S <haripra...@chelsio.com>
> Cc: Yishai Hadas <yish...@mellanox.com>
> Cc: Oleg Drokin <oleg.dro...@intel.com>
> Cc: "Yan, Zheng" <z...@redhat.com>
> Cc: Alexander Viro <v...@zeniv.linux.org.uk>
> Cc: Alexei Starovoitov <a...@kernel.org>
> Cc: Eric Dumazet <eric.duma...@gmail.com>
> Cc: net...@vger.kernel.org
> Acked-by: Andreas Dilger <andreas.dil...@intel.com> # Lustre
> Reviewed-by: Boris Ostrovsky <boris.ostrov...@oracle.com> # Xen bits
> Acked-by: Christian Borntraeger <borntrae...@de.ibm.com> # KVM/s390
> Acked-by: Dan Williams <dan.j.willi...@intel.com> # nvdim
> Acked-by: David Sterba <dste...@suse.com> # btrfs
> Acked-by: Ilya Dryomov <idryo...@gmail.com> # Ceph
> Acked-by: Tariq Toukan <tar...@mellanox.com> # mlx4
> Signed-off-by: Michal Hocko <mho...@suse.com>

Acked-by: Leon Romanovsky <leo...@mellanox.com> # mlx5

Attachment: signature.asc
Description: PGP signature

Reply via email to