All of lore.kernel.org
 help / color / mirror / Atom feed
* module references
@ 2005-11-23  2:58 Hollis Blanchard
  2005-11-23 12:33 ` Marco Gerards
  0 siblings, 1 reply; 6+ messages in thread
From: Hollis Blanchard @ 2005-11-23  2:58 UTC (permalink / raw)
  To: The development of GRUB 2

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




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: module references
  2005-11-23  2:58 module references Hollis Blanchard
@ 2005-11-23 12:33 ` Marco Gerards
  2005-11-23 22:46   ` Hollis Blanchard
  0 siblings, 1 reply; 6+ messages in thread
From: Marco Gerards @ 2005-11-23 12:33 UTC (permalink / raw)
  To: The development of GRUB 2

Hollis Blanchard <hollis@penguinppc.org> writes:

> 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.

> 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.

> 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




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: module references
  2005-11-23 12:33 ` Marco Gerards
@ 2005-11-23 22:46   ` Hollis Blanchard
  2005-11-24  6:23     ` Vesa Jääskeläinen
  0 siblings, 1 reply; 6+ messages in thread
From: Hollis Blanchard @ 2005-11-23 22:46 UTC (permalink / raw)
  To: The development of GRUB 2

On Nov 23, 2005, at 6:33 AM, Marco Gerards wrote:
>
>> 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




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: module references
  2005-11-23 22:46   ` Hollis Blanchard
@ 2005-11-24  6:23     ` Vesa Jääskeläinen
  2005-11-24  7:28       ` Marco Gerards
  0 siblings, 1 reply; 6+ messages in thread
From: Vesa Jääskeläinen @ 2005-11-24  6:23 UTC (permalink / raw)
  To: The development of GRUB 2

Hollis Blanchard wrote:
> On Nov 23, 2005, at 6:33 AM, Marco Gerards wrote:
>>
>>> 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





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: module references
  2005-11-24  6:23     ` Vesa Jääskeläinen
@ 2005-11-24  7:28       ` Marco Gerards
  2005-11-24  7:57         ` Vesa Jääskeläinen
  0 siblings, 1 reply; 6+ messages in thread
From: Marco Gerards @ 2005-11-24  7:28 UTC (permalink / raw)
  To: The development of GRUB 2

Vesa Jääskeläinen <chaac@nic.fi> writes:

>> 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




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: module references
  2005-11-24  7:28       ` Marco Gerards
@ 2005-11-24  7:57         ` Vesa Jääskeläinen
  0 siblings, 0 replies; 6+ messages in thread
From: Vesa Jääskeläinen @ 2005-11-24  7:57 UTC (permalink / raw)
  To: The development of GRUB 2

Marco Gerards wrote:
> Vesa Jääskeläinen <chaac@nic.fi> writes:
> 
>>> 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?

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.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-11-24  7:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-23  2:58 module references Hollis Blanchard
2005-11-23 12:33 ` Marco Gerards
2005-11-23 22:46   ` Hollis Blanchard
2005-11-24  6:23     ` Vesa Jääskeläinen
2005-11-24  7:28       ` Marco Gerards
2005-11-24  7:57         ` Vesa Jääskeläinen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.