public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
* Some questions about memory allocation and BKL
@ 2003-10-26  4:42 Ian Kent
  2003-10-26  9:44 ` Jan Hudec
  2003-10-26 18:37 ` dirty buffer_head, but not marked dirty Mark B
  0 siblings, 2 replies; 9+ messages in thread
From: Ian Kent @ 2003-10-26  4:42 UTC (permalink / raw)
  To: linux-fsdevel


Hi,

Not sure this is the right place to discuss this but ...

I have been working on changes to the autofs4 kernel module for some time 
now, in order to support enhancements to the user space daemon.

The BKL is widely used in both the autofs and autofs4 modules. Both of 
these modules call kmalloc under the BKL. Since the BKL is a spinlock and 
kmalloc can sleep this is bad. Worse, I have used kmalloc with GFP_ATOMIC 
inside the dcache_lock, which I suspect may be failing on after about a 
week of heavy activity. This has lead me to the following questions. The 
situation here is that the memory is used to communicate requests to the 
userspace daemon on behalf of processes.

1) Since the BKL is so widely used is it really worth eliminating it from 
   code that you work on?

2) How should smallish memory chunks be allocated if under the BKL if at 
   all? How else should it be done? What about other spinlocks like 
   dcache_lock?

3) How do I get hold of the vfsmount struct that corresponds to a dentry 
   from within revalidate and lookup calls?

4) How does one decide when locking is actually needed? For example, what 
   is the 'usual' locking need for the dentry release operation?

I realize that these are, in many ways, simple minded questions but I have 
considered them for some time and every time I work on the autofs4 module I 
always find myself saying "does this really need protection". Looking 
elsewhere, such as the VFS, autofs and nfs leaves me even more unsure.

Hope that there is some interest in a small discussion on this.

Regards
Ian 

-- 

   ,-._|\    Ian Kent
  /      \   Perth, Western Australia
  *_.--._/   E-mail: raven@themaw.net
        v    Web: http://themaw.net/



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

end of thread, other threads:[~2003-10-26 18:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-26  4:42 Some questions about memory allocation and BKL Ian Kent
2003-10-26  9:44 ` Jan Hudec
2003-10-26 11:27   ` Ian Kent
2003-10-26 12:43     ` Jan Hudec
2003-10-26 13:21       ` Ian Kent
2003-10-26 14:01         ` Jan Hudec
2003-10-26 15:59           ` Ian Kent
2003-10-26 15:54             ` Jan Hudec
2003-10-26 18:37 ` dirty buffer_head, but not marked dirty Mark B

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox