Discussion:
[Bug 192926] New: [patch] sched_yield is a no-op
(too old to reply)
b***@freebsd.org
2014-08-22 18:24:00 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192926

Bug ID: 192926
Summary: [patch] sched_yield is a no-op
Product: Base System
Version: 10.0-RELEASE
Hardware: Any
OS: Any
Status: Needs Triage
Severity: Affects Some People
Priority: ---
Component: kern
Assignee: freebsd-***@FreeBSD.org
Reporter: ***@vangyzen.net

Created attachment 146161
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=146161&action=edit
proposed patch

sched_yield() is a no-op. The thread is put back on the CPU immediately,
preventing other threads from running. ru_nvcsw gets incremented, but ktrace
does not show a context switch.

This was introduced by r239157:

http://svnweb.freebsd.org/base?view=revision&revision=r239157

I found this on 10.0-RELEASE-p7, but the same code exists in head.

I will attach a test case and patch against releng/10.0.
--
You are receiving this mail because:
You are the assignee for the bug.
b***@freebsd.org
2014-08-22 18:24:46 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192926

--- Comment #1 from ***@vangyzen.net ---
Created attachment 146162
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=146162&action=edit
test case
--
You are receiving this mail because:
You are the assignee for the bug.
b***@freebsd.org
2014-08-22 18:34:43 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192926

--- Comment #2 from ***@vangyzen.net ---
sched_4bsd.c would need a similar change.
--
You are receiving this mail because:
You are the assignee for the bug.
b***@freebsd.org
2014-08-23 17:32:29 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192926

--- Comment #3 from commit-***@freebsd.org ---
A commit references this bug:

Author: mav
Date: Sat Aug 23 17:31:56 UTC 2014
New revision: 270423
URL: http://svnweb.freebsd.org/changeset/base/270423

Log:
Restore pre-r239157 handling of sched_yield(), when thread time slice was
aborted, allowing other threads to run. Without this change thread is just
rescheduled again, that was illustrated by provided test tool.

PR: 192926
Submitted by: ***@vangyzen.net
MFC after: 2 weeks

Changes:
head/sys/kern/sched_4bsd.c
head/sys/kern/sched_ule.c
--
You are receiving this mail because:
You are the assignee for the bug.
b***@freebsd.org
2014-08-23 17:34:19 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192926

Alexander Motin <***@FreeBSD.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|Needs Triage |Needs MFC

--- Comment #4 from Alexander Motin <***@FreeBSD.org> ---
I've confirmed the issue with provided test tool, and committed the proposed
patch and its SCHED_4BSD counterpart to FreeBSD HEAD branch.
--
You are receiving this mail because:
You are the assignee for the bug.
b***@freebsd.org
2014-09-06 15:31:50 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192926

--- Comment #6 from commit-***@freebsd.org ---
A commit references this bug:

Author: mav
Date: Sat Sep 6 15:30:58 UTC 2014
New revision: 271195
URL: http://svnweb.freebsd.org/changeset/base/271195

Log:
MFC r270423:
Restore pre-r239157 handling of sched_yield(), when thread time slice
was aborted, allowing other threads to run. Without this change thread
is just rescheduled again, that was illustrated by provided test tool.

PR: 192926
Submitted by: ***@vangyzen.net

Changes:
_U stable/9/
_U stable/9/sys/
stable/9/sys/kern/sched_4bsd.c
stable/9/sys/kern/sched_ule.c
--
You are receiving this mail because:
You are the assignee for the bug.
Loading...