-
Notifications
You must be signed in to change notification settings - Fork 179
Conversation
…oc.h torvalds/linux@db3808c1 Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
torvalds/linux@d9dda78b Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com> Signed-off-by: Richard Yao <ryao@gentoo.org> Conflicts: config/spl-build.m4
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
|
||
static spinlock_t kstat_lock; | ||
static kmutex_t kstat_lock; |
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.
As an additional note, the critical sections protected by kstat_lock involve allocations where KM_SLEEP is used. I switched from spinlock_t to kmutex_t to avoid the possibility of holding a spin lock while allocating memory with KM_SLEEP.
torvalds/linux#59d8053f moved the definition of struct proc_dir_entry from include/linux/proc_fs.h to fs/proc/internal.h. The SPL relied on that to map Solaris' kstat to entries in /proc/spl/kstat. Brian Belendorf suggested reworking "the __kstat_install/__kstat_delete handlers to only pass around the opaque handle", which is what we do. Signed-off-by: Richard Yao <ryao@gentoo.org>
I have refreshed the pull request with most of the suggested changes. The only one that I did not make was splitting kstat_add_module from __kstat_install because the __kstat_install function should by definition do that. Also, this did not forget to test an older kernel to ensure that I was not relying on 3.10-specific functions. I am not setup to test a wide variety of kernels, so my testing was rather limited in comparison to what is done at LLNL. In specific, I tested against 3.9.8 and 3.10.0. |
Observed on kernels prior to 3.9, exactly which ones I have run down yet. This was for a RHEL6 2.6.32 based kernel.
|
Linux kernel commmit torvalds/linux@db3808c1 moved the vmalloc_info structure from a private to a public header. Now that it's available for kernel modules use it. Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Issue #257
Linux kernel commit torvalds/linux@d9dda78b renamed PDE() to PDE_DATA(). To handle this detect the prefered interface and define a PDE_DATA() wrapper for consistency. Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com> Signed-off-by: Richard Yao <ryao@gentoo.org> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Issue #257
Linux kernel commit torvalds/linux@0d01ff2 changes some includes we were depending on through linux/proc_fs.h. Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Issue #257
Linux kernel commit torvalds/linux#59d8053f moved the definition of struct proc_dir_entry from include/linux/proc_fs.h to the private header fs/proc/internal.h. The SPL relied on that to map Solaris' kstat to entries in /proc/spl/kstat. Since the proc_dir_entry structure is now private the only safe thing to do is wrap the opaque proc handle with our own structure. This actually ends up simplify the code and is good because it moves us away from depending on implementation details of /proc. Signed-off-by: Richard Yao <ryao@gentoo.org> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Issue #257
Related to issue openzfs#257 which added Linux 3.10 compatibility. For ARM and Sparc architectures we must explicitly include the <linux/vmalloc.h> header to ensure the vmalloc_info structure is always defined when available. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Issue openzfs#257 Closes openzfs#291
@yshui's 3.10 compatibility patches worked, but a few of them addressed the Linux kernel's move to make
struct proc_dir_entry
a private interface by duplicating the definition. @behlendorf pointed out that is prone to break, so I wrote a patch to implement his suggestion to "rework the __kstat_install/__kstat_delete handlers to only pass around the opaque handle". I also fixed the merge conflict in one of yshui's other patches that replacing his proc_dir_entry patches caused.This is complemented by openzfs/zfs#1494. It contains an autotools check that is slightly better than the one @yshui proposed in openzfs/zfs#1458.