Skip to content
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 kernel 5.13 + zfs 2.1-release +dkms vs realtime patch #12387

Closed
comrade-meowski opened this issue Jul 17, 2021 · 4 comments
Closed

linux kernel 5.13 + zfs 2.1-release +dkms vs realtime patch #12387

comrade-meowski opened this issue Jul 17, 2021 · 4 comments
Labels
Status: Stale No recent activity for issue Type: Defect Incorrect behavior (e.g. crash, hang)

Comments

@comrade-meowski
Copy link

System information

Type Version/Name
Distribution Name Ubuntu
Distribution Version 21.04
Kernel Version 5.13 realtime
Architecture x64
OpenZFS Version 2.1-release

Describe the problem you're observing

DKMS fails to build zfs module against 5.13 realtime kernel.

Describe how to reproduce the problem

1: Build and install a 5.13 realtime kernel:

git clone --depth 1 --branch v5.13 https://github.com/torvalds/linux.git repro
wget https://mirrors.edge.kernel.org/pub/linux/kernel/projects/rt/5.13/patch-5.13-rt1.patch.xz
unxz patch-5.13-rt1.patch.xz
cd repro/
patch -p1 < ../patch-5.13-rt1.patch
[kernel config step - ensure PREEMPT_RT=y]
make -j$(nproc) deb-pkg

2: Build and install a hacked zfs-2.1-release:

DKMS will fail the configuration checks building against vanilla zfs-2.1-release with what looks like a regression of Fix CONFIG_DEBUG_LOCK_ALLOC configure check #10991.

'Fix' this by rebuilding it with the one line edit of META and change CDDL to GPL. Rebuild and install.

3: Attempt DKMS build of 5.13-rt with zfs-2.1-release with modified license:

dkms install -m zfs/2.1.0 -k 5.13-$your-realtime-kernel-name

Include any warning/errors/backtraces from the system logs

Entire /var/lib/dkms/zfs/2.1.0/build/make.log is here.

The important bit is:

  AS [M]  /var/lib/dkms/zfs/2.1.0/build/module/lua/setjmp/setjmp.o
In file included from /var/lib/dkms/zfs/2.1.0/build/include/os/linux/spl/sys/taskq.h:34,
                 from /var/lib/dkms/zfs/2.1.0/build/include/os/linux/spl/sys/kmem_cache.h:27,
                 from /var/lib/dkms/zfs/2.1.0/build/include/sys/zfs_context.h:52,
                 from /var/lib/dkms/zfs/2.1.0/build/module/icp/os/modhash.c:140:
/var/lib/dkms/zfs/2.1.0/build/module/icp/os/modhash.c: In function ‘mod_hash_create_extended’:
/var/lib/dkms/zfs/2.1.0/build/include/os/linux/spl/sys/rwlock.h:125:2: error: implicit declaration of function ‘__init_rwsem’; did you mean ‘init_rwsem’? [-Werror=implicit-function-declaration]
  125 |  __init_rwsem(SEM(rwp), #rwp, &__key);    \
      |  ^~~~~~~~~~~~
/var/lib/dkms/zfs/2.1.0/build/module/icp/os/modhash.c:470:2: note: in expansion of macro ‘rw_init’
  470 |  rw_init(&mod_hash->mh_contents, NULL, RW_DEFAULT, NULL);
      |  ^~~~~~~
  CC [M]  /var/lib/dkms/zfs/2.1.0/build/module/icp/algs/modes/cbc.o
  LD [M]  /var/lib/dkms/zfs/2.1.0/build/module/lua/zlua.o
  CC [M]  /var/lib/dkms/zfs/2.1.0/build/module/icp/algs/modes/ccm.o
cc1: some warnings being treated as errors
make[5]: *** [scripts/Makefile.build:272: /var/lib/dkms/zfs/2.1.0/build/module/icp/os/modhash.o] Error 1
make[5]: *** Waiting for unfinished jobs....
  CC [M]  /var/lib/dkms/zfs/2.1.0/build/module/zfs/dataset_kstats.o
  CC [M]  /var/lib/dkms/zfs/2.1.0/build/module/zfs/dbuf.o
  CC [M]  /var/lib/dkms/zfs/2.1.0/build/module/zfs/dbuf_stats.o
  CC [M]  /var/lib/dkms/zfs/2.1.0/build/module/zfs/ddt.o
  CC [M]  /var/lib/dkms/zfs/2.1.0/build/module/zfs/ddt_zap.o
make[4]: *** [scripts/Makefile.build:515: /var/lib/dkms/zfs/2.1.0/build/module/icp] Error 2
make[4]: *** Waiting for unfinished jobs....
  CC [M]  /var/lib/dkms/zfs/2.1.0/build/module/zfs/dmu.o
In file included from /var/lib/dkms/zfs/2.1.0/build/include/os/linux/spl/sys/taskq.h:34,
                 from /var/lib/dkms/zfs/2.1.0/build/include/os/linux/spl/sys/kmem_cache.h:27,
                 from /var/lib/dkms/zfs/2.1.0/build/include/sys/zfs_context.h:52,
                 from /var/lib/dkms/zfs/2.1.0/build/module/zfs/dbuf.c:31:
/var/lib/dkms/zfs/2.1.0/build/module/zfs/dbuf.c: In function ‘dbuf_cons’:
/var/lib/dkms/zfs/2.1.0/build/include/os/linux/spl/sys/rwlock.h:125:2: error: implicit declaration of function ‘__init_rwsem’; did you mean ‘init_rwsem’? [-Werror=implicit-function-declaration]
  125 |  __init_rwsem(SEM(rwp), #rwp, &__key);    \
      |  ^~~~~~~~~~~~
/var/lib/dkms/zfs/2.1.0/build/module/zfs/dbuf.c:290:2: note: in expansion of macro ‘rw_init’
  290 |  rw_init(&db->db_rwlock, NULL, RW_DEFAULT, NULL);
      |  ^~~~~~~
  CC [M]  /var/lib/dkms/zfs/2.1.0/build/module/zfs/dmu_diff.o
  CC [M]  /var/lib/dkms/zfs/2.1.0/build/module/zfs/dmu_object.o
  CC [M]  /var/lib/dkms/zfs/2.1.0/build/module/zfs/dmu_objset.o
  CC [M]  /var/lib/dkms/zfs/2.1.0/build/module/zfs/dmu_recv.o
In file included from /var/lib/dkms/zfs/2.1.0/build/include/os/linux/spl/sys/taskq.h:34,
                 from /var/lib/dkms/zfs/2.1.0/build/include/os/linux/spl/sys/kmem_cache.h:27,
                 from /var/lib/dkms/zfs/2.1.0/build/include/sys/zfs_context.h:52,
                 from /var/lib/dkms/zfs/2.1.0/build/module/zfs/dmu_objset.c:40:
/var/lib/dkms/zfs/2.1.0/build/module/zfs/dmu_objset.c: In function ‘dmu_objset_init’:
/var/lib/dkms/zfs/2.1.0/build/include/os/linux/spl/sys/rwlock.h:125:2: error: implicit declaration of function ‘__init_rwsem’; did you mean ‘init_rwsem’? [-Werror=implicit-function-declaration]
  125 |  __init_rwsem(SEM(rwp), #rwp, &__key);    \
      |  ^~~~~~~~~~~~
/var/lib/dkms/zfs/2.1.0/build/module/zfs/dmu_objset.c:98:2: note: in expansion of macro ‘rw_init’
   98 |  rw_init(&os_lock, NULL, RW_DEFAULT, NULL);
      |  ^~~~~~~
cc1: some warnings being treated as errors
make[5]: *** [scripts/Makefile.build:272: /var/lib/dkms/zfs/2.1.0/build/module/zfs/dbuf.o] Error 1
make[5]: *** Waiting for unfinished jobs....
cc1: some warnings being treated as errors
make[5]: *** [scripts/Makefile.build:272: /var/lib/dkms/zfs/2.1.0/build/module/zfs/dmu_objset.o] Error 1
make[4]: *** [scripts/Makefile.build:515: /var/lib/dkms/zfs/2.1.0/build/module/zfs] Error 2
  LD [M]  /var/lib/dkms/zfs/2.1.0/build/module/zstd/zzstd.o
make[3]: *** [Makefile:1847: /var/lib/dkms/zfs/2.1.0/build/module] Error 2
make[3]: Leaving directory '/usr/src/linux-headers-5.13.0-rt1-badwater1+'
make[2]: *** [Makefile:54: modules-Linux] Error 2
make[2]: Leaving directory '/var/lib/dkms/zfs/2.1.0/build/module'
make[1]: *** [Makefile:909: all-recursive] Error 1
make[1]: Leaving directory '/var/lib/dkms/zfs/2.1.0/build'
make: *** [Makefile:770: all] Error 2
@comrade-meowski comrade-meowski added the Type: Defect Incorrect behavior (e.g. crash, hang) label Jul 17, 2021
@szanni
Copy link

szanni commented Nov 28, 2021

Does this issue persist with kernel 5.15-rt?

I had similar issues a while back. Now with the RT patches being mainline I am back to technically functioning build that I can't distribute due to licensing issues, see #11097

@comrade-meowski
Copy link
Author

I've just checked for you by doing a quick testbuild - I maintain a kernel repo for Ubuntu systems and build various different "flavours" for pretty much every minor release such as AMD, Intel, etc. I also regularly try to build a RT flavour as well but it very rarely compiles successfully and it it does, DKMS will subsequently fail to build the ZFS modules as you detail in #11097.

linux-5.13.3 + patch-5.15.3-rt21.patch + openzfs-2.1.1 gives me the exact same result as you in #11097 (comment). The usual "fix" of editing META to swap CDDL to GPL and rebuilding the DKMS modules also still works of course resulting in something I'm quite happy to use, but not distribute.

I note with interest that one of the first respondents to your LKML thread is Oleksandr Natalenko who's excellent pf-kernel patchset actually forms the base for my kernels. My ideal kernel build would actually be pf-kernel + full realtime patch + miscellaneous patches whilst still maintaining DKMS compatibility with the latest ZFS release. I've been building them for years at this point and to date have never managed to get all four of those things working together even once - I'm not holding my breath either. I understand and accept the upstream licensing problems may well never be resolved at this point and have quite frankly stopped caring so I commend you for at least trying to prod that bees nest again.

@szanni
Copy link

szanni commented Dec 1, 2021

Thanks for testing.

And yeah, that's what I figured, Ubuntu would eventually suffer from this, too. I was not aware the Ubuntu kernel was this close to master these days though.

Sadly my plead on the mailing list seems to have gone nowhere. So sad that we can not have nice things due to some IMO silly licensing mismatch. Hadn't heard of the pf patch set yet. Looks interesting. But so far the rt kernel has been perfectly fine for my live audio needs.

@stale
Copy link

stale bot commented Dec 3, 2022

This issue has been automatically marked as "stale" because it has not had any activity for a while. It will be closed in 90 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Stale No recent activity for issue label Dec 3, 2022
@stale stale bot closed this as completed Mar 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale No recent activity for issue Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
None yet
Development

No branches or pull requests

2 participants