freebsd-nq/patches/fc11-spl-export-symbols.patch
Brian Behlendorf e811949a57 Reimplement rwlocks for Linux lock profiling/analysis.
It turns out that the previous rwlock implementation worked well but
did not integrate properly with the upstream kernel lock profiling/
analysis tools.  This is a major problem since it would be awfully
nice to be able to use the automatic lock checker and profiler.

The problem is that the upstream lock tools use the pre-processor
to create a lock class for each uniquely named locked.  Since the
rwsem was embedded in a wrapper structure the name was always the
same.  The effect was that we only ended up with one lock class for
the entire SPL which caused the lock dependency checker to flag
nearly everything as a possible deadlock.

The solution was to directly map a krwlock to a Linux rwsem using
a typedef there by eliminating the wrapper structure.  This was not
done initially because the rwsem implementation is specific to the arch.
To fully implement the Solaris krwlock API using only the provided rwsem
API is not possible.  It can only be done by directly accessing some of
the internal data member of the rwsem structure.

For example, the Linux API provides a different function for dropping
a reader vs writer lock.  Whereas the Solaris API uses the same function
and the caller does not pass in what type of lock it is.  This means to
properly drop the lock we need to determine if the lock is currently a
reader or writer lock.  Then we need to call the proper Linux API function.
Unfortunately, there is no provided API for this so we must extracted this
information directly from arch specific lock implementation.  This is
all do able, and what I did, but it does complicate things considerably.

The good news is that in addition to the profiling benefits of this
change.  We may see performance improvements due to slightly reduced
overhead when creating rwlocks and manipulating them.

The only function I was forced to sacrafice was rw_owner() because this
information is simply not stored anywhere in the rwsem.  Luckily this
appears not to be a commonly used function on Solaris, and it is my
understanding it is mainly used for debugging anyway.

In addition to the core rwlock changes, extensive updates were made to
the rwlock regression tests.  Each class of test was extended to provide
more API coverage and to be more rigerous in checking for misbehavior.

This is a pretty significant change and with that in mind I have been
careful to validate it on several platforms before committing.  The full
SPLAT regression test suite was run numberous times on all of the following
platforms.  This includes various kernels ranging from 2.6.16 to 2.6.29.

- SLES10   (ppc64)
- SLES11   (x86_64)
- CHAOS4.2 (x86_64)
- RHEL5.3  (x86_64)
- RHEL6    (x86_64)
- FC11     (x86_64)
2009-09-18 16:09:47 -07:00

107 lines
3.3 KiB
Diff

Required missing symbols for FC11 kernels (2.6.29.4-167.fc11.x86_64)
* get_vmalloc_info()
There is no clean API in the kernel for modules to check the virtual
memory state of the system. This information is available in user
space under /proc/meminfo and the details for every virtual memory
node are available under /proc/vmallocinfo.
* groups_search()
This support is easily replicated if the symbol is not provided by the
kernel. However exporting the symbol from the kernel is preferable.
This is required by the solaris credential API.
* task_curr()
This symbol is used by the solaris adaptive mutex implementation. If
unavailable then all solaris mutexs behave strictly like linux style
semaphones. If available then the mutex may spin for a short while,
rather than sleep, if the holder of the lock is currently executing.
* first_online_pgdat()
* next_online_pgdat()
* next_zone()
Required helper functions for the zone iterators for_each_zone() and
for_each_populated_zone(). These symbols were previously available
in 2.6.17 kernels, marked unused in 2.6.18 kernels, and removed as
of the 2.6.19 kernel series. The information is available in user
space under /proc/zoneinfo.
diff --git a/fs/proc/mmu.c b/fs/proc/mmu.c
index 8ae221d..081c7b5 100644
--- a/fs/proc/mmu.c
+++ b/fs/proc/mmu.c
@@ -58,3 +58,4 @@ void get_vmalloc_info(struct vmalloc_info *vmi)
read_unlock(&vmlist_lock);
}
}
+EXPORT_SYMBOL(get_vmalloc_info);
diff --git a/kernel/groups.c b/kernel/groups.c
index 2b45b2e..24b62f8 100644
--- a/kernel/groups.c
+++ b/kernel/groups.c
@@ -153,6 +153,7 @@ int groups_search(const struct group_info *group_info, gid_t grp)
}
return 0;
}
+EXPORT_SYMBOL(groups_search);
/**
* set_groups - Change a group subscription in a set of credentials
diff --git a/kernel/sched.c b/kernel/sched.c
index 1b59e26..8728c52 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1883,10 +1883,11 @@ static void deactivate_task(struct rq *rq, struct task_struct *p, int sleep)
* task_curr - is this task currently executing on a CPU?
* @p: the task in question.
*/
-inline int task_curr(const struct task_struct *p)
+task_curr(const struct task_struct *p)
{
return cpu_curr(task_cpu(p)) == p;
}
+EXPORT_SYMBOL(task_curr);
static inline void __set_task_cpu(struct task_struct *p, unsigned int cpu)
{
diff --git a/mm/mmzone.c b/mm/mmzone.c
index f5b7d17..1468a22 100644
--- a/mm/mmzone.c
+++ b/mm/mmzone.c
@@ -14,6 +14,7 @@ struct pglist_data *first_online_pgdat(void)
{
return NODE_DATA(first_online_node);
}
+EXPORT_SYMBOL(first_online_pgdat);
struct pglist_data *next_online_pgdat(struct pglist_data *pgdat)
{
@@ -23,6 +24,7 @@ struct pglist_data *next_online_pgdat(struct pglist_data *pgdat)
return NULL;
return NODE_DATA(nid);
}
+EXPORT_SYMBOL(next_online_pgdat);
/*
* next_zone - helper magic for for_each_zone()
@@ -42,6 +44,7 @@ struct zone *next_zone(struct zone *zone)
}
return zone;
}
+EXPORT_SYMBOL(next_zone);
static inline int zref_in_nodemask(struct zoneref *zref, nodemask_t *nodes)
{
diff --git a/kernel/fork.c b/kernel/fork.c
index 9b42695..852499e 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -159,6 +159,7 @@ void __put_task_struct(struct task_struct *tsk)
if (!profile_handoff_task(tsk))
free_task(tsk);
}
+EXPORT_SYMBOL(__put_task_struct);
/*
* macro override instead of weak attribute alias, to workaround