Re: audio cd writing causes massive swap and crash

From: Ed Sweetman
Date: Sat Jul 24 2004 - 12:58:21 EST


I noticed something interesting when mounting dvd+R's with my plextor.

normal mount of cd-r
cdrom: hdc: mrw address space DMA selected

mount of dvd+R with -o rw
udf: registering filesystem
hdc: packet command error: status=0x51 { DriveReady SeekComplete Error }
hdc: packet command error: error=0x54
cdrom: failed setting lba address space
UDF-fs INFO UDF 0.9.8.1 (2004/29/09) Mounting volume 'CDROM', timestamp 2004/07/17 18:41 (1f10)


I dont have packet writing enabled because i haven't configured it yet, but it's interesting that lba isn't functioning on this drive. There is a flash upgrade available for it but not apparently for linux, just windows. It only seemed to be for reading dual layer recordable disks though. It's a PX-712A. Perhaps the problem with writing audio disks come from some code in the driver that converts lba to mrw? It's frustrating to be able to pin down the problem this close but be unable to solve it.









Ed Sweetman wrote:

Martin Schlemmer wrote:

On Thu, 2004-07-22 at 14:54, Jens Axboe wrote:


On Thu, Jul 22 2004, Ed Sweetman wrote:


I've had other people test writing. It appears that scsi-emu is not effected by this memory leak when writing audio cds. So it would appear that ide-cd along with any of the dependent ide source files is the culprit. But I cannot find anywhere in ide-cd that is apparent to being a mem leak. There are various conditions in ide_do_drive_cmd that state that the cdrom driver has to be very careful about handling but without intimate knowledge of the driver, I can't be sure that it's sufficiently handling those situations. Surprisingly, it's very hard to find anyone who's used the native atapi mode to write an audio cd in 2.6. Which is partly why this problem hasn't generated more mail traffic here I would guess.

That's not true, lots of people use it. But, oddly, the leak isn't
reproducable on any machine I've tested.


I seem to remember he noted a patch about dma during audio writing,
and his 'testing' if it might be the cause was to just disable dma
on the drive ...




The patch is now part of vanilla 2.6. It was an audio dma api that was a workaround for the broken dma api that only allows ide commands 512bytes long. Schilling mentioned something about this in an earlier lkml posting around january. I've asked some other people in an irc channel to test out the problem. Basically You need to be using the native atapi method for recording audio. Also, it appears that the mem leak is just what happens to some people, other people like some of those who tested in the irc channel experienced random program sigsevs and no mem leak at all. It would appear from this that what may be happening is the cdrom ide module is mangling a pointer and either can't free it due to it possibly randomly pointing to null or cause crashes due to it randomly pointing to other anonymous/shared memory regions as kfree is called. That's obviously just a guess. But some sort of memory mangling is apparently happening. This is not just happening on my computer.

My drive is using udma33 and not mdma so maybe that makes the problem occur more quickly. I disabled dma to test it writing the old way but it appears to be occuring in ide-cd or somewhere between cdrom.o and the block device layer. ide-scsi people dont have the problem at all apparently.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/