Re: remove_proc_entry and read_proc

2007-02-05 Thread Duncan Sands
> Gee, thanks. I sat and wrote code side-by-side, and it looks like, even > barriers > won't fix anything, because they don't affect other CPUs. ?! The whole point of memory barriers is that they affect other CPUs. Maybe you are thinking of compiler barriers? > ->proc_fops is valid

Re: remove_proc_entry and read_proc

2007-02-05 Thread Alexey Dobriyan
On Fri, Feb 02, 2007 at 08:31:57AM +0100, Duncan Sands wrote: > > I believe, barriers not needed, not now. > > This scheme relies on the fact that remove_proc_entry() will be the only > > place that will clear ->proc_fops and, once cleared, ->proc_fops will > > never be resurrected. Clearing of ->

Re: remove_proc_entry and read_proc

2007-02-01 Thread Duncan Sands
Hi Alexey, > I believe, barriers not needed, not now. > > This scheme relies on the fact that remove_proc_entry() will be the only > place that will clear ->proc_fops and, once cleared, ->proc_fops will > never be resurrected. Clearing of ->proc_fops will eventually propagate > to CPU doing first

Re: remove_proc_entry and read_proc

2007-02-01 Thread Alexey Dobriyan
Duncan Sands wrote: > On Wednesday 31 January 2007 19:42:51 Alexey Dobriyan wrote: > > On Wed, Jan 31, 2007 at 11:54:35AM +0100, Duncan Sands wrote: > > > Can read_proc still be executing when remove_proc_entry returns? > > > > > > In my driver [*] I allocate some data and create a proc entry using

Re: remove_proc_entry and read_proc

2007-02-01 Thread Duncan Sands
> I don't understand how this is supposed to work. Consider > > CPU1 CPU2 > > atomic_inc(&dp->pde_users); > if (dp->proc_fops) > de->proc_fops = NULL; > use_proc_fops <= BOOM > if (

Re: remove_proc_entry and read_proc

2007-01-31 Thread Duncan Sands
On Wednesday 31 January 2007 19:42:51 Alexey Dobriyan wrote: > On Wed, Jan 31, 2007 at 11:54:35AM +0100, Duncan Sands wrote: > > Can read_proc still be executing when remove_proc_entry returns? > > > > In my driver [*] I allocate some data and create a proc entry using > > create_proc_entry. My re

Re: remove_proc_entry and read_proc

2007-01-31 Thread Alexey Dobriyan
On Wed, Jan 31, 2007 at 11:54:35AM +0100, Duncan Sands wrote: > Can read_proc still be executing when remove_proc_entry returns? > > In my driver [*] I allocate some data and create a proc entry using > create_proc_entry. My read method reads from my allocated data. When > shutting down, I call r

remove_proc_entry and read_proc

2007-01-31 Thread Duncan Sands
Can read_proc still be executing when remove_proc_entry returns? In my driver [*] I allocate some data and create a proc entry using create_proc_entry. My read method reads from my allocated data. When shutting down, I call remove_proc_entry and immediately free the data. If some call to read_pr