mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Unusually long delay in the kernel
@ 2005-09-16 16:42 Alan Stern
  2005-09-16 17:58 ` Fawad Lateef
  2005-09-17  6:52 ` Andrew Morton
  0 siblings, 2 replies; 9+ messages in thread
From: Alan Stern @ 2005-09-16 16:42 UTC (permalink / raw)
  To: Kernel development list

This code excerpt is taken from the start of the control thread for the 
usb-storage driver in 2.6.14-rc1:


static int usb_stor_control_thread(void * __us)
{
	struct us_data *us = (struct us_data *)__us;
	struct Scsi_Host *host = us_to_host(us);

printk(KERN_INFO "Before thread start\n");
	lock_kernel();

	/*
	 * This thread doesn't need any user-level access,
	 * so get rid of all our resources.
	 */
	daemonize("usb-storage");
	current->flags |= PF_NOFREEZE;
	unlock_kernel();
printk(KERN_INFO "After thread start\n");


The code between the two printk's takes a long time to run.  I don't have 
precise numbers, but it feels like more than 1 second.

(1) Can anyone explain why, or indicate how to speed it up?

(2) Are the {un}lock_kernel calls really needed?

Thanks,

Alan Stern


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-09-19 18:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-16 16:42 Unusually long delay in the kernel Alan Stern
2005-09-16 17:58 ` Fawad Lateef
2005-09-17  6:52 ` Andrew Morton
2005-09-17 22:15   ` Alan Stern
2005-09-17 23:41     ` Andrew Morton
2005-09-18 15:05       ` Alan Stern
2005-09-18 20:09         ` Andrew Morton
2005-09-19 14:40           ` [Proposed PATCH] Add kthread_stop_sem Alan Stern
2005-09-19 18:06       ` Unusually long delay in the kernel Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®