Whamcloud - gitweb
LU-12564 libcfs: Use vfree_atomic instead of vfree 36/40136/3
authorOleg Drokin <green@whamcloud.com>
Thu, 1 Oct 2020 05:51:55 +0000 (01:51 -0400)
committerOleg Drokin <green@whamcloud.com>
Thu, 3 Dec 2020 07:26:15 +0000 (07:26 +0000)
commit7a9c0ca690eb00a6e314322b62fb1fd3e9b31f0e
tree482f9c4e708f9f340973205b0801e529fb003af0
parent1123bbd3fc4d5abeb111ddc6bd762d1fb2c1ce82
LU-12564 libcfs: Use vfree_atomic instead of vfree

Since vfree is unsafe to use in atomic context, implement our own
libcfs_vfree_atomic heavily based on code from linux 4.10 commit
bf22e37a641327e34681b7b6959d9646e3886770

We can't use the one in the kernel because it's not exported.

unconditionally use it in *_FREE_LARGE() macros since in_atomic()
is not recommended to be used outside of core kernel code.

Not everything is present on 3.10 (rhel7) so we also add
llist primitive and a replacement for raw_cpu_ptr there.

Change-Id: I50892f231e54a284f4d8a14d910ea9ab2fbe6a16
Signed-off-by: Oleg Drokin <green@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/40136
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Aurelien Degremont <degremoa@amazon.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Tested-by: Maloo <maloo@whamcloud.com>
libcfs/include/libcfs/libcfs.h
libcfs/include/libcfs/libcfs_private.h
libcfs/libcfs/libcfs_mem.c
libcfs/libcfs/module.c
lustre/include/obd_support.h