Skip to contentSkip to conversation

module references

DISCUSSION Hollis Blanchard 3 participants 6 messages Nov 23, 2005 – Nov 24, 2005

lore
Share & tools
lore
#0 lore raw

Right now I'm getting a lot of these:

	../fs/affs.c: In function `grub_mod_init':
	../fs/affs.c:556: warning: unused parameter `mod'

... in fact, one for every GRUB_MOD_INIT in fs/ and partmap/, it seems.

This led me to examine the module reference counting system. Most filesystems don't do anything more than set a "my_mod" global variable, and never use it. fat.c, on the other hand, seems to actually be trying to use a refcount.

Are modules ever automatically unloaded? When? If so, we need a lot more reference counting. If not, we've got some unnecessary complexity we should remove.

-Hollis

#1 lore raw
Quoted 4 lines · Hollis Blanchard

Right now I'm getting a lot of these:

	../fs/affs.c: In function `grub_mod_init':
	../fs/affs.c:556: warning: unused parameter `mod'

... in fact, one for every GRUB_MOD_INIT in fs/ and partmap/, it seems.

Right. `my_mod' is used by the filesystems, but not used from INIT.

Quoted 4 lines

This led me to examine the module reference counting system. Most filesystems don't do anything more than set a "my_mod" global variable, and never use it. fat.c, on the other hand, seems to actually be trying to use a refcount.

They do use it. When opening a file the reference is increased so the user can't remove the filesystem module until the file is closed. If this is not implemented this way, it's a bug.

Quoted 3 lines

Are modules ever automatically unloaded? When? If so, we need a lot more reference counting. If not, we've got some unnecessary complexity we should remove.

It's done so you can not remove a module that is in use by GRUB or another module. For example when you open a file for a long time.

--
Marco

#2 lore raw
Quoted 7 lines · Marco Gerards
Quoted 4 lines

Are modules ever automatically unloaded? When? If so, we need a lot more reference counting. If not, we've got some unnecessary complexity we should remove.

It's done so you can not remove a module that is in use by GRUB or another module. For example when you open a file for a long time.

Please describe for me how I can trigger this bug. In other words, what commands can I run to unload a filesystem module while a file is open?

-Hollis

#3 lore raw
Quoted 11 lines · Hollis Blanchard
Quoted 7 lines · Marco Gerards
Quoted 4 lines

Are modules ever automatically unloaded? When? If so, we need a lot more reference counting. If not, we've got some unnecessary complexity we should remove.

It's done so you can not remove a module that is in use by GRUB or another module. For example when you open a file for a long time.

Please describe for me how I can trigger this bug. In other words, what commands can I run to unload a filesystem module while a file is open?

One way at least is to use font subsystem. That at least keeps file open.

See guide from Okuji's message how to create font file and:

insmod font
font .../fontfile.pff

#4 lore raw
Quoted 9 lines · Vesa Jääskeläinen
Quoted 2 lines

Please describe for me how I can trigger this bug. In other words, what commands can I run to unload a filesystem module while a file is open?

One way at least is to use font subsystem. That at least keeps file open.

See guide from Okuji's message how to create font file and:

insmod font
font .../fontfile.pff

Shouldn't the font file be opened, loaded into memory and closed?

--
Marco

#5 lore raw
Quoted 4 lines · Marco Gerards
Quoted 2 lines · Vesa Jääskeläinen
Quoted 2 lines

Please describe for me how I can trigger this bug. In other words, what commands can I run to unload a filesystem module while a file is open?

Quoted 8 lines
Quoted 6 lines

One way at least is to use font subsystem. That at least keeps file open.

See guide from Okuji's message how to create font file and:

insmod font
font .../fontfile.pff

Shouldn't the font file be opened, loaded into memory and closed?

Not at this time :)

Perhaps in the future...

But in reality, memory requirements for whole Unicode map is quite big. So loading only parts that really matter, saves quite a lot.

If you look at the code there is TODO with similar commend "caching needed" :)

If we think about my problem with fonts (or reading them), I didn't even try to make workaround like caching everything. Instead I wanted to find root cause for the reading problem. So this has slowed down a bit development.