-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linux 5.8 __vmalloc compat #10422
Linux 5.8 __vmalloc compat #10422
Conversation
An alternative would be redefining |
good point.. i think i will change this in this way |
@c0d3z3r0 made a new commit which follows your suggestion. please review |
Codecov Report
@@ Coverage Diff @@
## master #10422 +/- ##
===========================================
- Coverage 79.39% 66.03% -13.37%
===========================================
Files 391 308 -83
Lines 123633 106348 -17285
===========================================
- Hits 98162 70225 -27937
- Misses 25471 36123 +10652
Continue to review full report at Codecov.
|
cbc8971
to
9fb9eaf
Compare
@BrainSlayer yup that's what I meant, thx! I slightly simplified it (tbh I was surprised that it works this way \o/) |
Codecov Report
@@ Coverage Diff @@
## master #10422 +/- ##
==========================================
+ Coverage 79.39% 79.45% +0.06%
==========================================
Files 391 391
Lines 123633 123632 -1
==========================================
+ Hits 98162 98237 +75
+ Misses 25471 25395 -76
Continue to review full report at Codecov.
|
yay, this even made codecov green :D |
9fb9eaf
to
52a54a9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for sorting this out!
#ifdef HAVE_VMALLOC_PAGE_KERNEL | ||
#define __vmalloc(size, gfp_flags) \ | ||
__vmalloc(size, gfp_flags, PAGE_KERNEL) | ||
#endif /* HAVE_VMALLOC_PAGE_KERNEL */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we only intend to use this wrapper from the SPL, let's move it to include/os/linux/spl/sys/kmem.h
with the other Linux kmem compatibility code and add the spl_
prefix. I was thinking something like this after the void *spl_kvmalloc(size_t size, gfp_t flags);
prototype.
/*
* 5.8 API change, pgprot_t argument removed.
*/
#ifdef HAVE_VMALLOC_PAGE_KERNEL
#define spl_vmalloc(size, flags) __vmalloc(size, flags, PAGE_KERNEL)
#else
#define spl_vmalloc(size, flags) __vmalloc(size, flags)
#endif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack, we can even move the __GFP_RETRY_MAYFAIL compat code there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@c0d3z3r0 yep. makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@behlendorf include/os/linux/spl/sys is for userspace and kernel space. but include/os/linux/kernel/linux is for kernel only. so kernel wrappers should be placed in this folder as i initially did. spl_vmalloc should never be used from userspace and should be out of reach by its declaration
@BrainSlayer by moving to spl code, this get's relicensed from CCDL to GPL. do you agree with that? |
@c0d3z3r0 i dont mind its nothing i see as intellectual property. do as you wish. but take care about the cstyle error i see |
have the same opinion on that, but in that area better be safe than sorry |
all okay. i'm currently preparing all changes in my tree. just need to finish all compiling tests locally. gimme 5 minutes. then check my PR |
f764564
to
dbb9d4a
Compare
The `pgprot` argument has been removed from `__vmalloc` in Linux 5.8, being `PAGE_KERNEL` always now [1]. Detect this during configure and redefine `__vmalloc` older kernels. [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/mm/vmalloc.c?h=next-20200605&id=88dca4ca5a93d2c09e5bbc6a62fbfc3af83c4fca Co-authored-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Co-authored-by: Michael Niewöhner <foss@mniewoehner.de> Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
dbb9d4a
to
507245a
Compare
The `pgprot` argument has been removed from `__vmalloc` in Linux 5.8, being `PAGE_KERNEL` always now [1]. Detect this during configure and define a wrapper for older kernels. [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/mm/vmalloc.c?h=next-20200605&id=88dca4ca5a93d2c09e5bbc6a62fbfc3af83c4fca Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Co-authored-by: Michael Niewöhner <foss@mniewoehner.de> Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Signed-off-by: Michael Niewöhner <foss@mniewoehner.de> Closes openzfs#10422
The `pgprot` argument has been removed from `__vmalloc` in Linux 5.8, being `PAGE_KERNEL` always now [1]. Detect this during configure and define a wrapper for older kernels. [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/mm/vmalloc.c?h=next-20200605&id=88dca4ca5a93d2c09e5bbc6a62fbfc3af83c4fca Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Co-authored-by: Michael Niewöhner <foss@mniewoehner.de> Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Signed-off-by: Michael Niewöhner <foss@mniewoehner.de> Closes #10422
The `pgprot` argument has been removed from `__vmalloc` in Linux 5.8, being `PAGE_KERNEL` always now [1]. Detect this during configure and define a wrapper for older kernels. [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/mm/vmalloc.c?h=next-20200605&id=88dca4ca5a93d2c09e5bbc6a62fbfc3af83c4fca Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Co-authored-by: Michael Niewöhner <foss@mniewoehner.de> Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Signed-off-by: Michael Niewöhner <foss@mniewoehner.de> Closes openzfs#10422 (cherry picked from commit 080102a)
The `pgprot` argument has been removed from `__vmalloc` in Linux 5.8, being `PAGE_KERNEL` always now [1]. Detect this during configure and define a wrapper for older kernels. [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/mm/vmalloc.c?h=next-20200605&id=88dca4ca5a93d2c09e5bbc6a62fbfc3af83c4fca Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Co-authored-by: Michael Niewöhner <foss@mniewoehner.de> Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Signed-off-by: Michael Niewöhner <foss@mniewoehner.de> Closes openzfs#10422 (cherry picked from commit 080102a)
Adding this patch makes zfs compile against 5.8-rc7 kernels. Upstream PR: openzfs/zfs#10422 Modifications: - spl_kvmalloc does not exists in zfs 0.8.4 - related code was dropped.
The `pgprot` argument has been removed from `__vmalloc` in Linux 5.8, being `PAGE_KERNEL` always now [1]. Detect this during configure and define a wrapper for older kernels. [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/mm/vmalloc.c?h=next-20200605&id=88dca4ca5a93d2c09e5bbc6a62fbfc3af83c4fca Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Co-authored-by: Michael Niewöhner <foss@mniewoehner.de> Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Signed-off-by: Michael Niewöhner <foss@mniewoehner.de> Closes openzfs#10422
The `pgprot` argument has been removed from `__vmalloc` in Linux 5.8, being `PAGE_KERNEL` always now [1]. Detect this during configure and define a wrapper for older kernels. [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/mm/vmalloc.c?h=next-20200605&id=88dca4ca5a93d2c09e5bbc6a62fbfc3af83c4fca Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Co-authored-by: Michael Niewöhner <foss@mniewoehner.de> Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Signed-off-by: Michael Niewöhner <foss@mniewoehner.de> Closes openzfs#10422
The `pgprot` argument has been removed from `__vmalloc` in Linux 5.8, being `PAGE_KERNEL` always now [1]. Detect this during configure and define a wrapper for older kernels. [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/mm/vmalloc.c?h=next-20200605&id=88dca4ca5a93d2c09e5bbc6a62fbfc3af83c4fca Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Co-authored-by: Michael Niewöhner <foss@mniewoehner.de> Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Signed-off-by: Michael Niewöhner <foss@mniewoehner.de> Closes openzfs#10422 (cherry picked from commit 080102a) - apply to 0.8.4 before certain files were moved around - config/kernel-kmem.m4 exists in git but not release tarballs because it is unused; introduce it in a new file to prevent conflicts - linux/mm.h is included in git master via sys/kmem.h; do not remove it here or the build will error due to undefined is_vmalloc_addr() Original-patch-by: Michael Niewöhner <c0d3z3r0@users.noreply.github.com> Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
@@ -26,7 +26,6 @@ | |||
#include <sys/sysmacros.h> | |||
#include <sys/kmem.h> | |||
#include <sys/vmem.h> | |||
#include <linux/mm.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file still uses is_vmalloc_addr()
and trying to backport the patch to 0.8.x results in compile errors. It turns out sys/kmem.h includes linux/mm.h but only in git master.
Is this indirection intentional?
The `pgprot` argument has been removed from `__vmalloc` in Linux 5.8, being `PAGE_KERNEL` always now [1]. Detect this during configure and define a wrapper for older kernels. [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/mm/vmalloc.c?h=next-20200605&id=88dca4ca5a93d2c09e5bbc6a62fbfc3af83c4fca Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Co-authored-by: Michael Niewöhner <foss@mniewoehner.de> Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Signed-off-by: Michael Niewöhner <foss@mniewoehner.de> Closes #10422 (cherry picked from commit 080102a) - apply to 0.8.4 before certain files were moved around - config/kernel-kmem.m4 exists in git but not release tarballs because it is unused; introduce it in a new file to prevent conflicts - linux/mm.h is included in git master via sys/kmem.h; do not remove it here or the build will error due to undefined is_vmalloc_addr() Original-patch-by: Michael Niewöhner <c0d3z3r0@users.noreply.github.com> Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
backport kernel 5.8 support from openzfs/zfs#10728 (see openzfs/zfs#10422)
The `pgprot` argument has been removed from `__vmalloc` in Linux 5.8, being `PAGE_KERNEL` always now [1]. Detect this during configure and define a wrapper for older kernels. [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/mm/vmalloc.c?h=next-20200605&id=88dca4ca5a93d2c09e5bbc6a62fbfc3af83c4fca Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Co-authored-by: Michael Niewöhner <foss@mniewoehner.de> Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Signed-off-by: Michael Niewöhner <foss@mniewoehner.de> Closes openzfs#10422 (cherry picked from commit 080102a) - apply to 0.8.4 before certain files were moved around - config/kernel-kmem.m4 exists in git but not release tarballs because it is unused; introduce it in a new file to prevent conflicts - linux/mm.h is included in git master via sys/kmem.h; do not remove it here or the build will error due to undefined is_vmalloc_addr() Original-patch-by: Michael Niewöhner <c0d3z3r0@users.noreply.github.com> Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
The `pgprot` argument has been removed from `__vmalloc` in Linux 5.8, being `PAGE_KERNEL` always now [1]. Detect this during configure and define a wrapper for older kernels. [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/mm/vmalloc.c?h=next-20200605&id=88dca4ca5a93d2c09e5bbc6a62fbfc3af83c4fca Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Co-authored-by: Michael Niewöhner <foss@mniewoehner.de> Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Signed-off-by: Michael Niewöhner <foss@mniewoehner.de> Closes openzfs#10422 (cherry picked from commit 080102a) - apply to 0.8.4 before certain files were moved around - config/kernel-kmem.m4 exists in git but not release tarballs because it is unused; introduce it in a new file to prevent conflicts - linux/mm.h is included in git master via sys/kmem.h; do not remove it here or the build will error due to undefined is_vmalloc_addr() Original-patch-by: Michael Niewöhner <c0d3z3r0@users.noreply.github.com> Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Adding this patch makes zfs compile against 5.8-rc7 kernels. Upstream PR: openzfs/zfs#10422 Modifications: - spl_kvmalloc does not exists in zfs 0.8.4 - related code was dropped.
The `pgprot` argument has been removed from `__vmalloc` in Linux 5.8, being `PAGE_KERNEL` always now [1]. Detect this during configure and define a wrapper for older kernels. [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/mm/vmalloc.c?h=next-20200605&id=88dca4ca5a93d2c09e5bbc6a62fbfc3af83c4fca Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Co-authored-by: Michael Niewöhner <foss@mniewoehner.de> Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Signed-off-by: Michael Niewöhner <foss@mniewoehner.de> Closes openzfs#10422
The `pgprot` argument has been removed from `__vmalloc` in Linux 5.8, being `PAGE_KERNEL` always now [1]. Detect this during configure and define a wrapper for older kernels. [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/mm/vmalloc.c?h=next-20200605&id=88dca4ca5a93d2c09e5bbc6a62fbfc3af83c4fca Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Co-authored-by: Michael Niewöhner <foss@mniewoehner.de> Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Signed-off-by: Michael Niewöhner <foss@mniewoehner.de> Closes openzfs#10422
The `pgprot` argument has been removed from `__vmalloc` in Linux 5.8, being `PAGE_KERNEL` always now [1]. Detect this during configure and define a wrapper for older kernels. [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/mm/vmalloc.c?h=next-20200605&id=88dca4ca5a93d2c09e5bbc6a62fbfc3af83c4fca Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Co-authored-by: Michael Niewöhner <foss@mniewoehner.de> Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com> Signed-off-by: Michael Niewöhner <foss@mniewoehner.de> Closes openzfs#10422
backport kernel 5.8 support from openzfs/zfs#10728 (see openzfs/zfs#10422)
The pgprot argument has been removed from __vmalloc in Linux 5.8 [1],
being
PAGE_KERNEL
always now.Detect this during configure to use the right function call in spl.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/mm/vmalloc.c?h=next-20200605&id=88dca4ca5a93d2c09e5bbc6a62fbfc3af83c4fca
Co-authored-by: Sebastian Gottschall s.gottschall@dd-wrt.com
Co-authored-by: Michael Niewöhner foss@mniewoehner.de
Signed-off-by: Sebastian Gottschall s.gottschall@dd-wrt.com
Signed-off-by: Michael Niewöhner foss@mniewoehner.de
Motivation and Context
Description
How Has This Been Tested?
Types of changes
Checklist:
Signed-off-by
.