Subject: kern/25164: infinite busy loop when scsipi tries to grow resources
To: None <>
From: None <>
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
>Originator:     YAMAMOTO Takashi <>
>Release:        NetBSD 2.0C

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
	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

	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.

	- don't freeze the channel even if ADAPTER_REQ_GROW_RESOURCES failed.
	- don't try ADAPTER_REQ_GROW_RESOURCES too frequently.