The branch main has been updated by wulf:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=41559beb000555770cff1e1b3ef0275157aeb608

commit 41559beb000555770cff1e1b3ef0275157aeb608
Author:     Vladimir Kondratyev <[email protected]>
AuthorDate: 2022-05-17 12:10:20 +0000
Commit:     Vladimir Kondratyev <[email protected]>
CommitDate: 2022-05-17 12:10:20 +0000

    LinuxKPI: Fix typo in cond_resched_lock
    
    Lock must be released rather than acquired around mi_switch call.
    
    MFC after:      1 week
    Reviewed by:    hselasky, manu
    Differential Revision:  https://reviews.freebsd.org/D35048
---
 sys/compat/linuxkpi/common/include/linux/sched.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/sched.h 
b/sys/compat/linuxkpi/common/include/linux/sched.h
index aa4bdbc65c5b..1409df0a4b26 100644
--- a/sys/compat/linuxkpi/common/include/linux/sched.h
+++ b/sys/compat/linuxkpi/common/include/linux/sched.h
@@ -134,9 +134,9 @@ cond_resched_lock(spinlock_t *lock)
 
        if (need_resched() == 0)
                return (0);
-       spin_lock(lock);
-       cond_resched();
        spin_unlock(lock);
+       cond_resched();
+       spin_lock(lock);
        return (1);
 }
 

Reply via email to