1
0
Fork 0
remarkable-linux/drivers/md
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
..
bcache treewide: use kv[mz]alloc* rather than opencoded variants 2017-05-08 17:15:13 -07:00
persistent-data dm block manager: remove an unused argument from dm_block_manager_create() 2017-04-27 17:08:41 -04:00
Kconfig - DM cache metadata fixes to short-circuit operations that require the 2017-05-05 19:31:06 -07:00
Makefile - A major update for DM cache that reduces the latency for deciding 2017-05-03 10:31:20 -07:00
bitmap.c md: fix several trivial typos in comments 2017-03-23 22:54:57 -07:00
bitmap.h md: move bitmap_destroy to the beginning of __md_stop 2017-03-16 16:55:58 -07:00
dm-bio-prison-v1.c dm bio prison v2: new interface for the bio prison 2017-03-07 11:30:16 -05:00
dm-bio-prison-v1.h dm bio prison v2: new interface for the bio prison 2017-03-07 11:30:16 -05:00
dm-bio-prison-v2.c dm bio prison v2: new interface for the bio prison 2017-03-07 11:30:16 -05:00
dm-bio-prison-v2.h dm bio prison v2: new interface for the bio prison 2017-03-07 11:30:16 -05:00
dm-bio-record.h dm: Refactor for new bio cloning/splitting 2013-11-23 22:33:55 -08:00
dm-bufio.c dm bufio: check new buffer allocation watermark every 30 seconds 2017-05-01 15:21:42 -04:00
dm-bufio.h dm bufio: add sector start offset to dm-bufio interface 2017-03-07 13:28:33 -05:00
dm-builtin.c dm: move request-based code out to dm-rq.[hc] 2016-06-10 15:15:44 -04:00
dm-cache-background-tracker.c dm cache: significant rework to leverage dm-bio-prison-v2 2017-03-07 13:28:31 -05:00
dm-cache-background-tracker.h dm cache: significant rework to leverage dm-bio-prison-v2 2017-03-07 13:28:31 -05:00
dm-cache-block-types.h linux: drop __bitwise__ everywhere 2016-12-16 00:13:41 +02:00
dm-cache-metadata.c dm cache metadata: fail operations if fail_io mode has been established 2017-05-05 14:40:13 -04:00
dm-cache-metadata.h dm cache: significant rework to leverage dm-bio-prison-v2 2017-03-07 13:28:31 -05:00
dm-cache-policy-internal.h dm cache: significant rework to leverage dm-bio-prison-v2 2017-03-07 13:28:31 -05:00
dm-cache-policy-smq.c dm cache policy smq: cleanup free_target_met() and clean_target_met() 2017-05-04 10:27:47 -04:00
dm-cache-policy.c dm cache: add policy name to status output 2014-01-16 13:44:11 -05:00
dm-cache-policy.h dm cache: significant rework to leverage dm-bio-prison-v2 2017-03-07 13:28:31 -05:00
dm-cache-target.c - A major update for DM cache that reduces the latency for deciding 2017-05-03 10:31:20 -07:00
dm-core.h libnvdimm for 4.12 2017-05-05 18:49:20 -07:00
dm-crypt.c - A major update for DM cache that reduces the latency for deciding 2017-05-03 10:31:20 -07:00
dm-delay.c dm: mark targets that pass integrity data 2017-04-24 12:04:32 -04:00
dm-era-target.c dm block manager: remove an unused argument from dm_block_manager_create() 2017-04-27 17:08:41 -04:00
dm-exception-store.c - Revert a dm-multipath change that caused a regression for unprivledged 2015-11-04 21:19:53 -08:00
dm-exception-store.h dm snapshot: fix hung bios when copy error occurs 2016-01-08 20:03:05 -05:00
dm-flakey.c dm flakey: introduce "error_writes" feature 2016-12-13 15:01:31 -05:00
dm-integrity.c dm integrity: use previously calculated log2 of sectors_per_block 2017-04-27 12:16:32 -04:00
dm-io.c dm: support REQ_OP_WRITE_ZEROES 2017-04-08 11:25:38 -06:00
dm-ioctl.c dm: introduce enum dm_queue_mode to cleanup related code 2017-04-27 17:08:44 -04:00
dm-kcopyd.c dm kcopyd: switch to use REQ_OP_WRITE_ZEROES 2017-04-08 11:25:38 -06:00
dm-linear.c libnvdimm for 4.12 2017-05-05 18:49:20 -07:00
dm-log-userspace-base.c dm: drop NULL test before kmem_cache_destroy() and mempool_destroy() 2015-10-31 19:06:00 -04:00
dm-log-userspace-transfer.c dm log userspace transfer: match wait_for_completion_timeout return type 2015-04-15 12:10:20 -04:00
dm-log-userspace-transfer.h
dm-log-writes.c Merge branch 'for-4.9/block' of git://git.kernel.dk/linux-block 2016-10-07 14:42:05 -07:00
dm-log.c block,fs: use REQ_* flags directly 2016-11-01 09:43:26 -06:00
dm-mpath.c - A major update for DM cache that reduces the latency for deciding 2017-05-03 10:31:20 -07:00
dm-mpath.h
dm-path-selector.c
dm-path-selector.h dm path selector: remove 'repeat_count' return from .select_path hook 2016-02-22 22:34:42 -05:00
dm-queue-length.c dm path selector: remove 'repeat_count' return from .select_path hook 2016-02-22 22:34:42 -05:00
dm-raid.c - A major update for DM cache that reduces the latency for deciding 2017-05-03 10:31:20 -07:00
dm-raid1.c block: remove the discard_zeroes_data flag 2017-04-08 11:25:38 -06:00
dm-region-hash.c block: rename bio bi_rw to bi_opf 2016-08-07 14:41:02 -06:00
dm-round-robin.c dm round robin: revert "use percpu 'repeat_count' and 'current_path'" 2017-02-17 00:54:09 -05:00
dm-rq.c Merge branch 'for-linus' of git://git.kernel.dk/linux-block 2017-05-06 11:25:08 -07:00
dm-rq.h dm: always defer request allocation to the owner of the request_queue 2017-01-27 15:08:35 -07:00
dm-service-time.c dm path selector: remove 'repeat_count' return from .select_path hook 2016-02-22 22:34:42 -05:00
dm-snap-persistent.c block,fs: use REQ_* flags directly 2016-11-01 09:43:26 -06:00
dm-snap-transient.c dm snapshot: fix hung bios when copy error occurs 2016-01-08 20:03:05 -05:00
dm-snap.c dm: teach dm-targets to use a dax_device + dax_operations 2017-04-25 13:20:36 -07:00
dm-stats.c mm: introduce kv[mz]alloc helpers 2017-05-08 17:15:12 -07:00
dm-stats.h dm stats: support precise timestamps 2015-06-17 12:40:40 -04:00
dm-stripe.c libnvdimm for 4.12 2017-05-05 18:49:20 -07:00
dm-switch.c dm switch: simplify conditional in alloc_region_table() 2015-10-31 19:06:06 -04:00
dm-sysfs.c dm: move request-based code out to dm-rq.[hc] 2016-06-10 15:15:44 -04:00
dm-table.c - A major update for DM cache that reduces the latency for deciding 2017-05-03 10:31:20 -07:00
dm-target.c libnvdimm for 4.12 2017-05-05 18:49:20 -07:00
dm-thin-metadata.c dm block manager: remove an unused argument from dm_block_manager_create() 2017-04-27 17:08:41 -04:00
dm-thin-metadata.h dm thin: fix a race condition between discarding and provisioning a block 2016-07-20 12:43:35 -04:00
dm-thin.c - A major update for DM cache that reduces the latency for deciding 2017-05-03 10:31:20 -07:00
dm-uevent.c
dm-uevent.h
dm-verity-fec.c - A major update for DM cache that reduces the latency for deciding 2017-05-03 10:31:20 -07:00
dm-verity-fec.h dm verity fec: limit error correction recursion 2017-03-16 09:37:31 -04:00
dm-verity-target.c dm verity: switch to using asynchronous hash crypto API 2017-04-24 15:37:04 -04:00
dm-verity.h dm verity: switch to using asynchronous hash crypto API 2017-04-24 15:37:04 -04:00
dm-zero.c block: rename bio bi_rw to bi_opf 2016-08-07 14:41:02 -06:00
dm.c libnvdimm for 4.12 2017-05-05 18:49:20 -07:00
dm.h dm: introduce enum dm_queue_mode to cleanup related code 2017-04-27 17:08:44 -04:00
faulty.c md: fast clone bio in bio_clone_mddev() 2017-02-15 11:24:54 -08:00
linear.c Merge branch 'md-next' into md-linus 2017-05-01 14:09:21 -07:00
linear.h md linear: fix a race between linear_add() and linear_congested() 2017-02-13 09:17:50 -08:00
md-cluster.c md-cluster: Fix a memleak in an error handling path 2017-04-14 08:08:29 -07:00
md-cluster.h md-cluster: add the support for resize 2017-03-16 16:55:50 -07:00
md.c md: handle read-only member devices better. 2017-04-20 13:25:51 -07:00
md.h Merge branch 'md-next' into md-linus 2017-05-01 14:09:21 -07:00
multipath.c md: support REQ_OP_WRITE_ZEROES 2017-04-08 11:25:38 -06:00
multipath.h
raid0.c Merge branch 'md-next' into md-linus 2017-05-01 14:09:21 -07:00
raid0.h block: kill merge_bvec_fn() completely 2015-08-13 12:31:57 -06:00
raid1.c Merge branch 'md-next' into md-linus 2017-05-01 14:09:21 -07:00
raid1.h md/raid1: Use a new variable to count flighting sync requests 2017-04-27 14:01:16 -07:00
raid5-cache.c - A major update for DM cache that reduces the latency for deciding 2017-05-03 10:31:20 -07:00
raid5-log.h raid5-ppl: use resize_stripes() when enabling or disabling ppl 2017-04-10 12:00:49 -07:00
raid5-ppl.c raid5-ppl: use a single mempool for ppl_io_unit and header_page 2017-04-11 14:56:46 -07:00
raid5.c Merge branch 'md-next' into md-linus 2017-05-01 14:09:21 -07:00
raid5.h - A major update for DM cache that reduces the latency for deciding 2017-05-03 10:31:20 -07:00
raid10.c Merge branch 'md-next' into md-linus 2017-05-01 14:09:21 -07:00
raid10.h md/raid10: simplify the splitting of requests. 2017-04-11 10:13:02 -07:00