The kernel version check was wrong in two ways. First it tested against
kernel_v >= "3.1.0" but linux commit 172703 "mm: delete non-atomic mm
counter implementation" was actually integrated for 3.0. But fedora
names their 3.0 kernels 2.6.40 (and 3.1 kernels 2.6.41, depending on
release). So change the test to kernel_v >= "2.6.40".
The reason this wasn't found earlier was that there is another check
for CONFIG_NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS which is almost always
true (but not on arm tegra kernels).
function _stp_get_mm_counter:long(mm:long, member:long)
{
- /* kernels >= 2.6.34, 3.1 and later always use atomics */
+ /* kernels >= 2.6.34, 3.0 (2.6.40 fedora) and later always use atomics */
if (@defined(&@cast(mm, "mm_struct", "kernel<linux/sched.h>")->rss_stat)) {
-%( kernel_v >= "3.1.0" || CONFIG_NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS %?
+%( kernel_v >= "2.6.40" || CONFIG_NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS %?
val = atomic_long_read(&@cast(mm, "mm_struct",
"kernel<linux/sched.h>")->rss_stat->count[member])
%: