<!-- Some styling for better description lists --><style type='text/css'>dt { font-weight: bold;float: left;display:inline;margin-right: 1em} dd { display:block; margin-left: 2em}</style> ***: ChanServ sets mode: +o mchehab` <br> ChanServ sets mode: +o mchehab` marc|gonzalez: <u>mchehab</u>: there are occurrences of kmalloc(1, GFP_KERNEL); and kmalloc(2, GFP_KERNEL); just for the lifetime of a single function. That seems excessive... mchehab: agreed. the code probably need some rework <br> without knowing where it happens, I bet those are due to DMA buffers that can't be at stack <br> the right fix would be to have a temp buffer allocated together with the dev-specific struct marc|gonzalez: <u>mchehab</u>: hehehe, I didn't dare say where, because it's one of the media maintainers ;-) mchehab: and having a mutex to avoid concurrency <br> the code you're likely mentioning is due to a bug fix <br> after a Kernel change that caused a regression on almost every USB media driver <br> the quick/safe fix were to change stack alloc to kmalloc marc|gonzalez: I see, but allocating 1 or 2 bytes on the heap sounds very wasteful (in memory and CPU), and it's unlikely to be a problem on the stack mchehab: stack doesn't do DMA transfers <br> any URB object should be allocated with kmalloc marc|gonzalez: <u>mchehab</u>: haaaaa mchehab: what most drivers do is that a temp buff is allocated at their struct driver_dev <br> so, a single allocation <br> but that requires a mutex marc|gonzalez: I think I see the issue now <br> Thanks for taking the time to explain mchehab: specially if the same buffer is used also for polling events (for CI and IR) marc|gonzalez: <u>mchehab</u>: in dvb_pll_attach() it is an URB object? mchehab: on several drivers, I2C transfers happen via URB <br> dvb_pll can be used for I2C transfers marc|gonzalez: wow, so much complexity, it's humbling... mchehab: also, tuning a device is an operation that doesn't occur too often - the memory pressure of doing a kalloc/kfree inside it is minimal marc|gonzalez: I see, I was thinking about the maintenance burden of the error-handling mchehab: the maintainance burden of breaking random devices due to DMA on stack is a lot worse marc|gonzalez: smirk <br> I have a random crash in my system that comes several seconds after a dvbv5-scan, mchehab any idea what could this be? mchehab: no, sorry. my crystal ball is broken :-p marc|gonzalez: smirk :-) <br> Do you know that there is one girl named Kristal Ball? <br> weird parents... mchehab: or maybe it is an artistic name she choose b-rad: you wany mysterious names go to africa where they just choose two arbitrary words they like <br> i've met lawyer doctor, patient person, etc mchehab: I suspect that most names are like that... b-rad: yup, you choose what you like mchehab: except that the origin of a name usually comes from an old language marc|gonzalez: "Ball was born to Edward and Rose Marie Ball, a physicist and a teacher, respectively. The name Krystal came from her father, a physicist who did his dissertation on crystals."