summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_rmlock.c
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2011-07-04 12:04:52 +0000
committerattilio <attilio@FreeBSD.org>2011-07-04 12:04:52 +0000
commit364d0522f778b206262efce0932d6cea821879c6 (patch)
treef85bc4cd83b575a0c42f08d746e644f6dfc0e2ef /sys/kern/kern_rmlock.c
parent95ca970257de274a90a1a867048c5ace5acf532d (diff)
downloadFreeBSD-src-364d0522f778b206262efce0932d6cea821879c6.zip
FreeBSD-src-364d0522f778b206262efce0932d6cea821879c6.tar.gz
With retirement of cpumask_t and usage of cpuset_t for representing a
mask of CPUs, pc_other_cpus and pc_cpumask become highly inefficient. Remove them and replace their usage with custom pc_cpuid magic (as, atm, pc_cpumask can be easilly represented by (1 << pc_cpuid) and pc_other_cpus by (all_cpus & ~(1 << pc_cpuid))). This change is not targeted for MFC because of struct pcpu members removal and dependency by cpumask_t retirement. MD review by: marcel, marius, alc Tested by: pluknet MD testing by: marcel, marius, gonzo, andreast
Diffstat (limited to 'sys/kern/kern_rmlock.c')
-rw-r--r--sys/kern/kern_rmlock.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_rmlock.c b/sys/kern/kern_rmlock.c
index 3214e1b..1c7337d 100644
--- a/sys/kern/kern_rmlock.c
+++ b/sys/kern/kern_rmlock.c
@@ -263,7 +263,7 @@ _rm_rlock_hard(struct rmlock *rm, struct rm_priotracker *tracker, int trylock)
pc = pcpu_find(curcpu);
/* Check if we just need to do a proper critical_exit. */
- if (!CPU_OVERLAP(&pc->pc_cpumask, &rm->rm_writecpus)) {
+ if (!CPU_ISSET(pc->pc_cpuid, &rm->rm_writecpus)) {
critical_exit();
return (1);
}
@@ -325,7 +325,7 @@ _rm_rlock_hard(struct rmlock *rm, struct rm_priotracker *tracker, int trylock)
critical_enter();
pc = pcpu_find(curcpu);
- CPU_NAND(&rm->rm_writecpus, &pc->pc_cpumask);
+ CPU_CLR(pc->pc_cpuid, &rm->rm_writecpus);
rm_tracker_add(pc, tracker);
sched_pin();
critical_exit();
@@ -367,7 +367,7 @@ _rm_rlock(struct rmlock *rm, struct rm_priotracker *tracker, int trylock)
* conditional jump.
*/
if (0 == (td->td_owepreempt |
- CPU_OVERLAP(&rm->rm_writecpus, &pc->pc_cpumask)))
+ CPU_ISSET(pc->pc_cpuid, &rm->rm_writecpus)))
return (1);
/* We do not have a read token and need to acquire one. */
OpenPOWER on IntegriCloud