aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linuxkpi/common/src/linux_rcu.c
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2018-03-30 20:11:12 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2018-03-30 20:11:12 +0000
commit4b706099413af29d3eb006c6423815dae576b310 (patch)
treee38a88e8842f563b9082275769b3c3a365ed8c6d /sys/compat/linuxkpi/common/src/linux_rcu.c
parentd77004ab470f9eb3d511f09ee1b0c0ceaea35ff1 (diff)
downloadsrc-4b706099413af29d3eb006c6423815dae576b310.tar.gz
src-4b706099413af29d3eb006c6423815dae576b310.zip
Optimise use of Giant in the LinuxKPI.
- Make sure Giant is locked when calling PCI device methods. Newbus currently requires this. - Avoid unlocking Giant right before aquiring the sleepqueue lock. This can save a task switch. MFC after: 1 week Sponsored by: Mellanox Technologies
Notes
Notes: svn path=/head/; revision=331828
Diffstat (limited to 'sys/compat/linuxkpi/common/src/linux_rcu.c')
-rw-r--r--sys/compat/linuxkpi/common/src/linux_rcu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/compat/linuxkpi/common/src/linux_rcu.c b/sys/compat/linuxkpi/common/src/linux_rcu.c
index 0ece0342aad5..c565d85724bd 100644
--- a/sys/compat/linuxkpi/common/src/linux_rcu.c
+++ b/sys/compat/linuxkpi/common/src/linux_rcu.c
@@ -297,14 +297,14 @@ linux_synchronize_rcu(void)
td = curthread;
- DROP_GIANT();
-
/*
* Synchronizing RCU might change the CPU core this function
* is running on. Save current values:
*/
thread_lock(td);
+ DROP_GIANT();
+
old_cpu = PCPU_GET(cpuid);
old_pinned = td->td_pinned;
old_prio = td->td_priority;