Whamcloud - gitweb
LU-12564 libcfs: Use vfree_atomic instead of vfree 10/40110/9
authorOleg Drokin <green@whamcloud.com>
Sun, 6 Dec 2020 05:40:24 +0000 (00:40 -0500)
committerOleg Drokin <green@whamcloud.com>
Thu, 4 Mar 2021 08:35:50 +0000 (08:35 +0000)
commit1dc31de15ff270befceb64257bd84f15ffe75000
treec9e3220f725fdd94a76b174cd2caacbd44064971
parentb1e0ba8cfc5fd1aa000841b55420e89a96d9f6bc
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>
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