Dave Jones wrote:

We got a bug report in our bugzilla from a user that saw
SiS DRM crashing when he restarted X.

The crash seems to be two things.

First, a page allocation failure.

Mar 11 17:52:29 localhost kernel: X: page allocation failure. order:4, mode:0xd0
Mar 11 17:52:29 localhost kernel:  [<c01435a1>] __alloc_pages+0x281/0x28e
Mar 11 17:52:29 localhost kernel:  [<c01435c6>] __get_free_pages+0x18/0x24
Mar 11 17:52:29 localhost kernel:  [<c0146bb5>] kmem_getpages+0x15/0x94
Mar 11 17:52:29 localhost kernel:  [<c01478ae>] cache_grow+0x11f/0x260
Mar 11 17:52:29 localhost kernel:  [<c0147bfd>] cache_alloc_refill+0x20e/0x23e
Mar 11 17:52:29 localhost kernel:  [<c0147f2d>] __kmalloc+0x64/0x76
Mar 11 17:52:29 localhost kernel:  [<dca6adcb>] sisdrv_alloc+0xa/0xb [sis]
Mar 11 17:52:29 localhost kernel:  [<dca6d19b>] setInit+0xf/0x4f [sis]

That's caused by setInit trying to allocate this..  (drivers/char/drm/sis_ds.h)

#define SET_SIZE 5000

typedef unsigned int ITEM_TYPE;

typedef struct {
   ITEM_TYPE val;
   int alloc_next, free_next;
} list_item_t;

typedef struct {
   int alloc;
   int free;
   int trace;
   list_item_t list[SET_SIZE];
} set_t;


set_t ends up at a whopping 60012 bytes. This just plain isn't
going to work if someone restarts X after the memory has become
fragmented after quite a lot of use. This should be converted
to use a linked-list of smaller allocations.


The same code is present in the via driver as well, although I have so far never attributed any crashes to it. It is used heavily for textures, Xv and XvMC.

I remember Eric Anholt posting a patch a couple of months ago with a new reimplementation of the SiS memory manager which could easily have been extended
to via. Hmm... looking at it the link is broken.... Seem to have saved a copy.


ftp://ftp.shipmail.org/pub/anholt/sis-drm-memory-management.diff

Maybe about time for a generic multi-instance memory manager in core drm?

/Thomas




------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click -- _______________________________________________ Dri-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to