1
0
Fork 0
remarkable-linux/drivers/md/bcache
Michal Hocko 752ade68cb treewide: use kv[mz]alloc* rather than opencoded variants
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.

Link: http://lkml.kernel.org/r/20170306103327.2766-2-mhocko@kernel.org
Signed-off-by: Michal Hocko <mhocko@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> # Xen bits
Acked-by: Kees Cook <keescook@chromium.org>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Andreas Dilger <andreas.dilger@intel.com> # Lustre
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> # KVM/s390
Acked-by: Dan Williams <dan.j.williams@intel.com> # nvdim
Acked-by: David Sterba <dsterba@suse.com> # btrfs
Acked-by: Ilya Dryomov <idryomov@gmail.com> # Ceph
Acked-by: Tariq Toukan <tariqt@mellanox.com> # mlx4
Acked-by: Leon Romanovsky <leonro@mellanox.com> # mlx5
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Anton Vorontsov <anton@enomsg.org>
Cc: Colin Cross <ccross@android.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Kent Overstreet <kent.overstreet@gmail.com>
Cc: Santosh Raspatur <santosh@chelsio.com>
Cc: Hariprasad S <hariprasad@chelsio.com>
Cc: Yishai Hadas <yishaih@mellanox.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: "Yan, Zheng" <zyan@redhat.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-05-08 17:15:13 -07:00
..
Kconfig bcache: Kill dead cgroup code 2014-03-18 12:22:35 -07:00
Makefile bcache: Abstract out stuff needed for sorting 2014-01-08 13:05:12 -08:00
alloc.c bcache: bch_allocator_thread() is not freezable 2016-05-24 09:00:43 -06:00
bcache.h bcache: Make gc wakeup sane, remove set_task_state() 2016-12-17 13:01:55 -07:00
bset.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/clock.h> 2017-03-02 08:42:27 +01:00
bset.h bcache: fix typo in bch_bkey_equal_header 2014-08-04 15:23:03 -07:00
btree.c sched/headers: Prepare to use <linux/rcuupdate.h> instead of <linux/rculist.h> in <linux/sched.h> 2017-03-02 08:42:38 +01:00
btree.h bcache: Make gc wakeup sane, remove set_task_state() 2016-12-17 13:01:55 -07:00
closure.c bcache: update document info 2016-07-05 11:34:49 -06:00
closure.h sched/headers: Prepare for new header dependencies before moving code to <linux/sched/task_stack.h> 2017-03-02 08:42:36 +01:00
debug.c bcache: debug: avoid accessing .bi_io_vec directly 2016-11-22 08:57:55 -07:00
debug.h bcache: Convert debug code to btree_keys 2014-01-08 13:05:13 -08:00
extents.c bcache: Fix a journal replay bug 2014-08-04 15:23:02 -07:00
extents.h bcache: Fix a journal replay bug 2014-08-04 15:23:02 -07:00
io.c block: bio: pass bvec table to bio_init() 2016-11-22 08:57:21 -07:00
journal.c block: bio: pass bvec table to bio_init() 2016-11-22 08:57:21 -07:00
journal.h bcache: Fix a shutdown bug 2014-02-25 18:42:49 -08:00
movinggc.c block: bio: pass bvec table to bio_init() 2016-11-22 08:57:21 -07:00
request.c block: Use pointer to backing_dev_info from request_queue 2017-02-02 08:20:48 -07:00
request.h bcache: Kill dead cgroup code 2014-03-18 12:22:35 -07:00
stats.c bcache: Kill dead cgroup code 2014-03-18 12:22:35 -07:00
stats.h bcache: Break up struct search 2013-11-10 21:56:32 -08:00
super.c block: Use pointer to backing_dev_info from request_queue 2017-02-02 08:20:48 -07:00
sysfs.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/clock.h> 2017-03-02 08:42:27 +01:00
sysfs.h bcache: Don't export utility code, prefix with bch_ 2013-03-28 12:50:55 -06:00
trace.c bcache: Better alloc tracepoints 2014-03-18 12:22:35 -07:00
util.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/clock.h> 2017-03-02 08:42:27 +01:00
util.h treewide: use kv[mz]alloc* rather than opencoded variants 2017-05-08 17:15:13 -07:00
writeback.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/clock.h> 2017-03-02 08:42:27 +01:00
writeback.h bcache: use op_is_sync to check for synchronous requests 2016-11-01 09:43:26 -06:00