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

Build error on cpus_allowed/cpus_mask with kernel 4.18.0-240.1.1 #40

Open
davidjkcho opened this issue Jan 5, 2021 · 1 comment
Open

Comments

@davidjkcho
Copy link

Building xpmem failed with below error using kernel 4.18.0-240.1.1 on CentOS 8.3.

kernel/xpmem_pfn.c:255:25: error: 'struct task_struct' has no member named 'cpus_allowed'; did you mean 'nr_cpus_allowed'?
saved_mask = current->cpus_allowed;
^~~~~~~~~~~~

Below if statement in kernel/xpmem_pfn.c was checking for kernel version for 5.3.0-x or newer to use cpus_mask.
However, kernel 4.18.0-240.1.1 on CentOS 8.3 introduced "RH_KABI_RENAME(cpumask_t cpus_allowed, cpumask_t cpus_mask);" in /usr/src/kernels/4.18.0-240.1.1.el8_3.x86_64/include/linux/sched.h and cpus_mask had to be used instead of cpus_allowed.
Thus it failed to compile.

#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)
saved_mask = current->cpus_mask;
#else
saved_mask = current->cpus_allowed;
#endif

@ravitejak07
Copy link

As a work around, I have added below code.

#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)
saved_mask = current->cpus_mask;
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0)
saved_mask = current->cpus_mask;

#else
saved_mask = current-> cpus_allowed;
#endif

tzafrir-mellanox pushed a commit to tzafrir-mellanox/xpmem that referenced this issue Sep 11, 2024
LIB: Don't create xpmem segments twice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants