[8470] in linux-scsi channel archive
Re: scsi_init_malloc and scsi_malloc
daemon@ATHENA.MIT.EDU (Eric Youngdale)
Thu Mar 23 17:04:15 2000
Message-ID: <004301bf9512$50905750$4d0310ac@fairfax.datafocus.com>
From: "Eric Youngdale" <eric@andante.org>
To: "Stanley Wu" <wudragon2@yahoo.com>,
"scsi" <linux-scsi@vger.rutgers.edu>
Date: Thu, 23 Mar 2000 16:54:08 -0500
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
scsi_malloc() is really only to be used in allocating DMA-safe memory
for bounce buffers and other such structures.
scsi_init_malloc() is essentially just a wrapper around kmalloc(). If
you just need some general purpose memory, use kmalloc(). In the 2.3 series
kernel there is no longer a scsi_init_malloc() function - everything that
used it now uses kmalloc instead.
-Eric
----- Original Message -----
From: Stanley Wu <wudragon2@yahoo.com>
To: scsi <linux-scsi@vger.rutgers.edu>
Sent: Thursday, March 23, 2000 4:28 PM
Subject: scsi_init_malloc and scsi_malloc
> My driver consistently hang after 3 or 4 successful
> scsi commands been issued. From the messages file,
> I'm getting hundreds of:
> magic (corrupt) (name=size-256)
> kmem_alloc: Bad slab magic (corrupt) .....
> And it looks like I'm running out of memory. Am not
> sure why because it does not look like my driver is
> allocating the memory.
>
> The driver isn't all that big, about 300K and I was
> just allocating 56 bytes buffer for the inquiry data.
> I use scsi_init_malloc with GFP_ATOMIC for allocating
> the data buffer. If I changed it to scsi_malloc, I'd
> then get segmentation fault instead of hang.
>
> Whats the difference between these two malloc? Which
> is the right one to use? Also, any rules on using
> GFP_ATOMIC and GFP_KERNEL?
>
> thanks.
>
> __________________________________________________
> Do You Yahoo!?
> Talk to your friends online with Yahoo! Messenger.
> http://im.yahoo.com
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.rutgers.edu
>
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.rutgers.edu