public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: pm list <linux-pm@lists.linux-foundation.org>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>
Subject: Re: [RFC] Asynchronous suspend/resume - test results
Date: Mon, 21 Dec 2009 21:36:12 +0100	[thread overview]
Message-ID: <200912212136.12665.rjw@sisk.pl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0912211200200.2979-100000@iolanthe.rowland.org>

On Monday 21 December 2009, Alan Stern wrote:
> On Mon, 21 Dec 2009, Rafael J. Wysocki wrote:
> 
> > Hi,
> > 
> > After the Dmitry's suggestion to use PSMOUSE_CMD_RESET_DIS during suspend
> > (and analogously for atkbd), I found that it reduced the suspend time
> > significantly and changed the picture quite a bit.  For this reason I re-ran
> > the async suspend and resume tests on the nx6325 and Wind U100.
> > 
> > This time I marked the following devices as "async":
> > - all USB devices (including interfaces and endpoints)
> > - ACPI battery
> > - sd and its parent
> 
> Apparently not.  On nx6325 the sd device is 0:0:0:0, which did suspend
> in a different thread, but its parent is target0:0:0 which suspended
> and resumed in the main thread.  And its grandparent, host0, also
> suspended and resumed in the main thread.

Hmm.  I must have confused things, then.

...
> There are still some odd things going on.  Look at 
> nx6325-async-suspend-upfront-dmesg.log.  There's a peculiar gap between 
> 
> [  233.176029] call 0000:00:14.2+ returned 0 after 217543 usecs
> 
> and
> 
> [  234.059948] call 0:0:0:0+ returned 0 after 1078047 usecs
> 
> A lot of stuff could have happened during that gap, but nothing did.  
> That's because the target0:0:0 device was synchronous, and it was
> waiting for its child (the long-running async 0:0:0:0) to finish.  Not
> that it made much difference in the end, because the entire suspend
> finished about 16 ms later.  But if there was more than one disk or if
> the disk had been a USB drive, it would have mattered.
> 
> You should also make SCSI targets and hosts async.  Hosts are added in
> drivers/scsi/hosts.c:scsi_add_host_with_dma() (in 2.6.32 this was
> named scsi_add_host()).  Targets are added in
> drivers/scsi/scsi_sysfs.c:scsi_target_add().  And for thoroughness,
> SCSI devices are added in scsi_sysfs_add_sdev() in the same file.

Thanks a lot for the pointers.

Do you think it's a good idea to mark all SCSI devices as async?  Well, for
testing it probably is, but I doubt in general.

> More importantly, why did 0:0:0:0 wait almost 20 ms to begin 
> suspending?  Undoubtedly because it was blocked, waiting for some 
> unlogged synchronous device.  That's why you need to print out log 
> entries for devices without methods.  In this case it was probably a 
> class device.

OK

> Although USB host controllers aren't the longest-running devices to
> resume, they do tend to be on the longest paths.  Speeding them up
> would help.  One change you could try is in the patch below.  
> Currently when a controller has to be reset, the root hub beneath it is
> also reset and then re-suspended.  However there's no reason to suspend
> it if the PM core is only going to resume it a little bit later.  The
> patch gets rid of the unnecessary suspend.  Note: I haven't tested it.

OK, I'll try it.

Rafael

 
> Index: usb-2.6/drivers/usb/host/ohci-hub.c
> ===================================================================
> --- usb-2.6.orig/drivers/usb/host/ohci-hub.c
> +++ usb-2.6/drivers/usb/host/ohci-hub.c
> @@ -333,14 +333,12 @@ static void ohci_finish_controller_resum
>  		}
>  	}
>  
> -	/* If needed, reinitialize and suspend the root hub */
> +	/* If needed, reinitialize the root hub */
>  	if (need_reinit) {
>  		spin_lock_irq(&ohci->lock);
>  		hcd->state = HC_STATE_RESUMING;
> -		ohci_rh_resume(ohci);
> -		hcd->state = HC_STATE_QUIESCING;
> -		ohci_rh_suspend(ohci, 0);
> -		hcd->state = HC_STATE_SUSPENDED;
> +		if (ohci_rh_resume(ohci) == 0)
> +			hcd->state = HC_STATE_RUNNING;
>  		spin_unlock_irq(&ohci->lock);
>  	}
>  
> Index: usb-2.6/drivers/usb/host/uhci-hcd.c
> ===================================================================
> --- usb-2.6.orig/drivers/usb/host/uhci-hcd.c
> +++ usb-2.6/drivers/usb/host/uhci-hcd.c
> @@ -835,7 +835,6 @@ static int uhci_pci_resume(struct usb_hc
>  
>  		/* The controller had to be reset */
>  		usb_root_hub_lost_power(hcd->self.root_hub);
> -		suspend_rh(uhci, UHCI_RH_SUSPENDED);
>  	}
>  
>  	spin_unlock_irq(&uhci->lock);
> 

  reply	other threads:[~2009-12-21 20:35 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-21  0:40 [RFC] Asynchronous suspend/resume - test results Rafael J. Wysocki
2009-12-21  7:25 ` [linux-pm] " Nigel Cunningham
2009-12-21  7:35   ` Dmitry Torokhov
2009-12-21 19:58   ` Maxim Levitsky
2009-12-21 20:04     ` Nigel Cunningham
2009-12-23 20:46   ` Rafael J. Wysocki
2009-12-24  2:32     ` Nigel Cunningham
2009-12-24 22:10       ` [linux-pm] " Rafael J. Wysocki
2009-12-25 20:57         ` Nigel Cunningham
2009-12-26 21:33           ` Rafael J. Wysocki
2009-12-26 22:03             ` Nigel Cunningham
2009-12-27 14:20               ` Rafael J. Wysocki
2009-12-21 20:10 ` Alan Stern
2009-12-21 20:36   ` Rafael J. Wysocki [this message]
2009-12-21 20:54     ` Alan Stern
2009-12-21 23:00     ` Linus Torvalds
2009-12-23 20:35     ` Rafael J. Wysocki
2010-01-02 21:28       ` [Update] " Rafael J. Wysocki
2010-01-04 17:17         ` Jesse Barnes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200912212136.12665.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=stern@rowland.harvard.edu \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox