linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.4.24 extra CPU cycles in scsi.c
@ 2004-02-19 16:18 Richard B. Johnson
  2004-04-05 18:37 ` 2.6.5, ACPI, suspend and ThinkPad R40 Biker
  0 siblings, 1 reply; 11+ messages in thread
From: Richard B. Johnson @ 2004-02-19 16:18 UTC (permalink / raw)
  To: Linux kernel


When looking through various modules that I use, trying to
find out where some memory seems to be leaking, I found a
couple of unrelated things in scsi.c.

The code sets a structure-member to NULL, then releases the
pointer to that structure. A few CPU cycles being thrown away.
Since I was reviewing the whole file, I also got rid of the
spurious casts when calling kfree().



--- linux-2.4.24/drivers/scsi/scsi.c.orig	Thu Feb 19 10:45:20 2004
+++ linux-2.4.24/drivers/scsi/scsi.c	Thu Feb 19 11:01:47 2004
@@ -314,11 +314,7 @@
 void scsi_release_request(Scsi_Request * req)
 {
 	if( req->sr_command != NULL )
-	{
 		scsi_release_command(req->sr_command);
-		req->sr_command = NULL;
-	}
-
 	kfree(req);
 }

@@ -1449,7 +1445,7 @@
  	spin_lock_irqsave(&device_request_lock, flags);
 	for (SCpnt = SDpnt->device_queue; SCpnt; SCpnt = SCnext) {
 		SDpnt->device_queue = SCnext = SCpnt->next;
-		kfree((char *) SCpnt);
+		kfree(SCpnt);
 	}
 	SDpnt->has_cmdblocks = 0;
 	SDpnt->queue_depth = 0;
@@ -1550,7 +1546,7 @@
 	    max_scsi_hosts = n+1;
 	}
 	else
-	    kfree((char *) shn);
+	    kfree(shn);
     }
 }

@@ -1845,7 +1841,7 @@
 				HBA_ptr->host_queue = scd->next;
 			}
 			blk_cleanup_queue(&scd->request_queue);
-			kfree((char *) scd);
+			kfree(scd);
 		} else {
 			goto out;
 		}
@@ -2164,7 +2160,7 @@
 			blk_cleanup_queue(&SDpnt->request_queue);
 			/* Next free up the Scsi_Device structures for this host */
 			shpnt->host_queue = SDpnt->next;
-			kfree((char *) SDpnt);
+			kfree(SDpnt);

 		}
 	}


Cheers,
Dick Johnson
Penguin : Linux version 2.4.24 on an i686 machine (797.90 BogoMips).
            Note 96.31% of all statistics are fiction.



^ permalink raw reply	[flat|nested] 11+ messages in thread
* 2.6.5, ACPI, suspend and ThinkPad R40
@ 2004-04-04 17:36 Olivier Bornet
  2004-04-04 22:00 ` Michal Schmidt
  0 siblings, 1 reply; 11+ messages in thread
From: Olivier Bornet @ 2004-04-04 17:36 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1040 bytes --]

Hello,

I have an IBM ThinkPad R40, with kernel 2.6.5 and ACPI enabled. The
system is a GNU/Debian testing up-to-date, with acpid debian package
1.0.3-2.

I can suspend with Fn-F4, thanks to a acpi config doing:

    echo 3 > /proc/acpi/sleep

The laptop goes to sleep as execpted: all the lights goes off, and the
light with the moon goes on. All is OK until this. :-)

The problem is that I can't resume it. I have found no way. Pressing Fn
don't work. The power button don't work. Closing and opening the display
don't work. The only way to re-start the computer is to remove the
battery. Of course, this cause a reboot.

Has anyone some suggestion for me ?

Thanks in advance.

		Olivier
-- 
Olivier Bornet                |    français : http://puck.ch/f
Swiss Ice Hockey Results      |    english  : http://puck.ch/e
http://puck.ch/               |    deutsch  : http://puck.ch/g
Olivier.Bornet@puck.ch        |    italiano : http://puck.ch/i
Get my PGP-key at http://puck.ch/pgp or at http://pgp.mit.edu/

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread
[parent not found: <1HjUX-5pa-3@gated-at.bofh.it>]
* RE: 2.6.5, ACPI, suspend and ThinkPad R40
@ 2004-04-06 22:53 Brown, Len
  0 siblings, 0 replies; 11+ messages in thread
From: Brown, Len @ 2004-04-06 22:53 UTC (permalink / raw)
  To: Theodore Ts'o, Vincent C Jones; +Cc: kevin, linux-kernel

>> lack of interest in supporting notebook features

I'm glad that you're complaining about suspend/resume not working.
This means that you were able to boot and configure your system
using ACPI -- a year ago you wouldn't have got so far;-)

Yes, in the past year we've concentrated more on the configuration
issues at the expense of advanced features such as suspend/resume.
While we still have configuration issues, their frequency and
severity is lower than it once was, and so I'm hopeful that
we're over the hump there and will be able to
spend more time on features such as supsend/resume.

When I looked at a suspend/resume failure a couple of weeks ago
I discovered that there is no code in linux to save/restore
PCI configuration space for PCI bridges.  This is sort of a deal
killer -- as bits such as bus-master-enable could come up
enabled or disabled depending on the roll of the dice.
I hoped somebody on linux-pci would send a patch, but I haven't
seen one yet.

Cheers,
-Len

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

end of thread, other threads:[~2004-04-19 11:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-19 16:18 2.4.24 extra CPU cycles in scsi.c Richard B. Johnson
2004-04-05 18:37 ` 2.6.5, ACPI, suspend and ThinkPad R40 Biker
2004-04-04 17:36 Olivier Bornet
2004-04-04 22:00 ` Michal Schmidt
2004-04-05 22:19   ` Olivier Bornet
2004-04-06  3:28     ` Kevin Fenzi
2004-04-07  7:24     ` Olivier Bornet
     [not found] <1HjUX-5pa-3@gated-at.bofh.it>
     [not found] ` <1HnYA-hr-9@gated-at.bofh.it>
     [not found]   ` <1HKVd-1Uf-3@gated-at.bofh.it>
     [not found]     ` <1HPBr-5yC-5@gated-at.bofh.it>
2004-04-06 13:16       ` Vincent C Jones
2004-04-06 18:20         ` Theodore Ts'o
2004-04-19  6:23         ` Charles Bueche
2004-04-06 22:53 Brown, Len

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).