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.
For RHEL6 the llist support us also missing, so just
stick with the old vfree() call that was always used.
Lustre-change: https://review.whamcloud.com/40136
Lustre-commit:
7a9c0ca690eb00a6e314322b62fb1fd3e9b31f0e
Change-Id: I50892f231e54a284f4d8a14d910ea9ab2fbe6a16
Signed-off-by: Oleg Drokin <green@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/40110
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Aurelien Degremont <degremoa@amazon.com>