Skip to contentSkip to conversation

Proper module_cleanup procedure

Xenomai-help gilles.chanteperdrix 1 participant 1 message Sep 28, 2006

lore
Share & tools
lore
#0 lore raw

---------- Debut du message initial -----------

De : [email protected]
A : [email protected]
Copies :
Date : Thu, 28 Sep 2006 09:09:36 -0400
Objet : Re: [Xenomai-help] Re: Proper module_cleanup procedure

Quoted 3 lines

Thanks for all of your help and just a quick follow up on this.

I added a call to rt_task_delete() in my module cleanup

routine and this

Quoted 1 line

cleared the memory error I was getting whenever I tried to

unload the

Quoted 3 lines

module and then load it again.

I am still trying to discover some mechanism by which the

kernel module

Quoted 1 line

can determine if a particular heap is in use by a user-mode

app without

Quoted 1 line

having coordinating code in the user app. Don't want to jerk

the rug out

Quoted 1 line

from under the user app by deleting the heap before the user

app is

Quoted 1 line

finished with it.

If you are already in the module cleanup function, what are you going
to do if you detect that a user-mode application is using the module ?
You can not have the module cleanup function fail, it is too late. So,
my advice is to lock the module with try_module_get as long as the heap
are being used by user-space. Of course, this require calling some ioctl
in user-space, but it looks like a small price to pay.

--
Gilles Chanteperdrix

Accédez au courrier électronique de La Poste
sur www.laposte.net ou sur 3615 LAPOSTENET (0,34€ TTC /mn) 1 Giga de stockage gratuit – Antispam et antivirus intégrés