[LU-6769] Mellanox backport header (kthread.h) conflicts with newer kernels Created: 26/Jun/15  Updated: 14/Jun/18  Resolved: 29/Jul/15

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.8.0

Type: Bug Priority: Minor
Reporter: Chris Horn Assignee: Amir Shehata (Inactive)
Resolution: Fixed Votes: 0
Labels: RTS, patch

Issue Links:
Related
is related to LU-6763 redefinition of sk_sleep when using e... Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

This is very similar to LU-5140, except the conflict is in kthread.h

[  224s] In file included from /usr/src/packages/BUILD/cray-lustre/lnet/klnds/o2iblnd/o2iblnd.h:44,
[  224s]                  from /usr/src/packages/BUILD/cray-lustre/lnet/klnds/o2iblnd/o2iblnd.c:42:
[  224s] /usr/src/kernel-modules-ofed/x86_64/cray_ari_s/include/linux/kthread.h:21: error: redefinition of typedef 'kthread_work_func_t'
[  224s] /usr/src/linux-3.0.101-0.46.1_1.0000.8764/include/linux/kthread.h:55: error: previous declaration of 'kthread_work_func_t' was here
[  224s] /usr/src/kernel-modules-ofed/x86_64/cray_ari_s/include/linux/kthread.h:23: error: redefinition of 'struct kthread_worker'
[  224s] /usr/src/kernel-modules-ofed/x86_64/cray_ari_s/include/linux/kthread.h:29: error: redefinition of 'struct kthread_work'
[  224s] /usr/src/kernel-modules-ofed/x86_64/cray_ari_s/include/linux/kthread.h:75: error: conflicting types for '__init_kthread_worker'
[  224s] /usr/src/linux-3.0.101-0.46.1_1.0000.8764/include/linux/kthread.h:109: error: previous declaration of '__init_kthread_worker' was here
[  224s] /usr/src/kernel-modules-ofed/x86_64/cray_ari_s/include/linux/kthread.h:94: error: conflicting types for 'queue_kthread_work'
[  224s] /usr/src/linux-3.0.101-0.46.1_1.0000.8764/include/linux/kthread.h:128: error: previous declaration of 'queue_kthread_work' was here
[  224s] /usr/src/kernel-modules-ofed/x86_64/cray_ari_s/include/linux/kthread.h:96: error: conflicting types for 'flush_kthread_work'
[  224s] /usr/src/linux-3.0.101-0.46.1_1.0000.8764/include/linux/kthread.h:130: error: previous declaration of 'flush_kthread_work' was here
[  224s] /usr/src/kernel-modules-ofed/x86_64/cray_ari_s/include/linux/kthread.h:97: error: conflicting types for 'flush_kthread_worker'
[  224s] /usr/src/linux-3.0.101-0.46.1_1.0000.8764/include/linux/kthread.h:131: error: previous declaration of 'flush_kthread_worker' was here

I think we just to test for the kthread code and define CONFIG_COMPAT_IS_KTHREAD as appropriate. I have a patch but might not get around to pushing until Monday.



 Comments   
Comment by James A Simmons [ 27/Jun/15 ]

Ugh. Does moving compact-2.6.h to be the first file fix the issue?

Comment by Chris Horn [ 29/Jun/15 ]

It does, but if I include your change from LU-6763 then the error shows up elsewhere:

[  139s] In file included from /usr/src/packages/BUILD/cray-lustre/lnet/include/lnet/lib-types.h:49,
[  139s]                  from /usr/src/packages/BUILD/cray-lustre/lnet/include/lnet/lib-lnet.h:51,
[  139s]                  from /usr/src/packages/BUILD/cray-lustre/lnet/lnet/api-ni.c:39:
[  139s] /usr/src/kernel-modules-ofed/x86_64/cray_ari_s/include/linux/kthread.h:21: error: redefinition of typedef 'kthread_work_func_t'
[  139s] /usr/src/linux-3.0.101-0.46.1_1.0000.8764/include/linux/kthread.h:55: error: previous declaration of 'kthread_work_func_t' was here
[  139s] /usr/src/kernel-modules-ofed/x86_64/cray_ari_s/include/linux/kthread.h:23: error: redefinition of 'struct kthread_worker'
[  139s] /usr/src/kernel-modules-ofed/x86_64/cray_ari_s/include/linux/kthread.h:29: error: redefinition of 'struct kthread_work'
[  139s] /usr/src/kernel-modules-ofed/x86_64/cray_ari_s/include/linux/kthread.h:75: error: conflicting types for '__init_kthread_worker'
[  139s] /usr/src/linux-3.0.101-0.46.1_1.0000.8764/include/linux/kthread.h:109: error: previous declaration of '__init_kthread_worker' was here
[  139s] /usr/src/kernel-modules-ofed/x86_64/cray_ari_s/include/linux/kthread.h:94: error: conflicting types for 'queue_kthread_work'
[  139s] /usr/src/linux-3.0.101-0.46.1_1.0000.8764/include/linux/kthread.h:128: error: previous declaration of 'queue_kthread_work' was here
[  139s] /usr/src/kernel-modules-ofed/x86_64/cray_ari_s/include/linux/kthread.h:96: error: conflicting types for 'flush_kthread_work'
[  139s] /usr/src/linux-3.0.101-0.46.1_1.0000.8764/include/linux/kthread.h:130: error: previous declaration of 'flush_kthread_work' was here
[  139s] /usr/src/kernel-modules-ofed/x86_64/cray_ari_s/include/linux/kthread.h:97: error: conflicting types for 'flush_kthread_worker'
[  139s] /usr/src/linux-3.0.101-0.46.1_1.0000.8764/include/linux/kthread.h:131: error: previous declaration of 'flush_kthread_worker' was here

If I add a test for this in lustre-lnet.m4, and set:

EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_IS_KTHREAD"

appropriately then things seem to work.

Comment by Gerrit Updater [ 29/Jun/15 ]

Chris Horn (hornc@cray.com) uploaded a new patch: http://review.whamcloud.com/15428
Subject: LU-6769 build: Test for kthread_worker support
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: d3fd0a93347070422f1c02095d86030e2473d7de

Comment by Peter Jones [ 03/Jul/15 ]

Amir

Could you please take care of this patch?

Thanks

Peter

Comment by Gerrit Updater [ 29/Jul/15 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/15428/
Subject: LU-6769 build: Test for kthread_worker support
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: b984a7bed4afec88677c89840d85f40b48d14c23

Comment by Peter Jones [ 29/Jul/15 ]

Landed for 2.8

Generated at Sat Feb 10 02:03:05 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.