Subject: kern/25164: infinite busy loop when scsipi tries to grow resources
To: None <gnats-bugs@gnats.netbsd.org>
From: None <yamt@mwd.biglobe.ne.jp>
List: netbsd-bugs
Date: 04/13/2004 22:55:20
>Number:         25164
>Category:       kern
>Synopsis:       infinite busy loop when scsipi tries to grow resources
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 13 13:56:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
>Release:        NetBSD 2.0C
>Organization:

>Environment:
	
	
System: NetBSD kaeru 2.0C NetBSD 2.0C (build.kaeru) #1189: Tue Apr 13 19:13:54 JST 2004 takashi@kaeru:/home/takashi/work/kernel/build.kaeru i386
Architecture: i386
Machine: i386
>Description:
	scsipi_completion_thread() clears SCSIPI_CHANT_GROWRES.
	however, it then calls scsipi_channel_thaw(), which will set
	the flag again.  thus scsipi_completion_thread() loops busily
	while SCSIPI_CHANT_GROWRES is set, ie. until
	ADAPTER_REQ_GROW_RESOURCES succeeds.

	because ADAPTER_REQ_GROW_RESOURCES is usually implemented
	using NOWAIT allocations, it never succeeds if there's
	no enough memory.  if it was triggered by pageout requests,
	it deadlocks.

>How-To-Repeat:
	
>Fix:
	- don't freeze the channel even if ADAPTER_REQ_GROW_RESOURCES failed.
	- don't try ADAPTER_REQ_GROW_RESOURCES too frequently.

>Release-Note:
>Audit-Trail:
>Unformatted: