From jin@shasta.panasas.com  Wed Jan 17 16:58:16 2001
Return-Path: <jin@shasta.panasas.com>
Received: from shasta.panasas.com (dsl-237-43-22-64.cust.dslnetworks.net [64.22.43.237])
	by hub.freebsd.org (Postfix) with ESMTP id 2113C37B400
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 17 Jan 2001 16:58:16 -0800 (PST)
Received: (from jin@localhost)
	by shasta.panasas.com (8.11.1/8.11.1) id f0I0wEs01319;
	Wed, 17 Jan 2001 16:58:14 -0800 (PST)
	(envelope-from jin)
Message-Id: <200101180058.f0I0wEs01319@shasta.panasas.com>
Date: Wed, 17 Jan 2001 16:58:14 -0800 (PST)
From: Jin Guojun <jin@shasta.panasas.com>
Reply-To: jin@panasas.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: read/write in thread library (-lc_r) does not do context switch
X-Send-Pr-Version: 3.2

>Number:         24418
>Category:       kern
>Synopsis:       read/write in thread library (-lc_r) does not do context switch
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 17 17:00:00 PST 2001
>Closed-Date:    Mon Sep 09 14:50:41 PDT 2002
>Last-Modified:  Mon Sep 09 14:50:41 PDT 2002
>Originator:     Jin Guojun
>Release:        FreeBSD 4.2-RELEASE i386
>Organization:
>Environment:

	FreeBSD STABLE and CURRENT

>Description:

	threaded read/write shoule not block on I/O till I/O completion.
	Blocking on I/O causes thread I/O meaningless.

	read does context switch on stdin, and this is probably only
	I/O sys-call that FreeBSD does the context switch on thread.
	Thread does not do context switch on disk I/O and timed select().
	I have not tested accept() and network I/O yet.

	Linux 2.2.x does not do context switch on thread I/O either,
	but linux 2.4.0 fixed it.
	Solaris does this well.
	Both Solaris and Linux 2.4.0 submit the I/O job to the driver,
	and immediately switch context to another thread regardless
	how less the I/O data is.
	This contest switch utilizes both system CPU and I/O CPU time.

>How-To-Repeat:

	

>Fix:



>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->jasone 
Responsible-Changed-By: kris 
Responsible-Changed-When: Sat Jun 2 02:40:42 PDT 2001 
Responsible-Changed-Why:  
Jason is a threads guru. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=24418 
Responsible-Changed-From-To: jasone->freebsd-bugs 
Responsible-Changed-By: jasone 
Responsible-Changed-When: Sat May 11 15:21:41 PDT 2002 
Responsible-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=24418 
State-Changed-From-To: open->closed 
State-Changed-By: archie 
State-Changed-When: Mon Sep 9 14:50:00 PDT 2002 
State-Changed-Why:  
Submitter is no longer reachable, and bug is likely fixed now anyway. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=24418 
>Unformatted:
