On Fri, 17 Nov 2000, Francois romieu wrote:
> CPU A: assume de->count = 1 (in de_put)
> fs/proc/inode.c::44 if (!--de->count) {
> de->count = 0
>
> CPU B: (in remove_proc_entry)
> fs/proc/generic.c::577 if (!de->count)
> fs/proc/generic.c::578 free_proc_entry(de);
>
> CPU A:
On Fri, Nov 17, 2000 at 12:35:03AM -0800, Jacob Luna Lundberg wrote:
> > atomic_dec_and_test() returns true.
>
> Indeed, after studying the asm in question I think I see how it ticks.
> What is the reasoning behind reversing the result of the test instead of
> returning the new value of the count
CPU A: assume de->count = 1 (in de_put)
fs/proc/inode.c::44 if (!--de->count) {
de->count = 0
CPU B: (in remove_proc_entry)
fs/proc/generic.c::577 if (!de->count)
fs/proc/generic.c::578 free_proc_entry(de);
CPU A: (in de_put)
fs/proc/inode.c::45 if (de->deleted) { <-- derefer
On Fri, 17 Nov 2000, Jacob Luna Lundberg wrote:
> On Fri, 17 Nov 2000, Dan Aloni wrote:
> > If you are right, I guess put_files_struct() of kernel/exit.c would
> > have cleaned files_struct everytime someones called it.
> > Everywhere in the kernel, objects are freed when
> > atomic_dec_and_test
On Thu, 16 Nov 2000, Dan Aloni wrote:
> On Thu, 16 Nov 2000, Linus Torvalds wrote:
>
> > On Thu, 16 Nov 2000, Dan Aloni wrote:
> > >
> > > Makes procfs use an atomic use count for dir entries, to avoid using
> > > the Big kernel lock. Axboe says it looks ok.
> >
> > There's a race there. Look
On Fri, 17 Nov 2000, Dan Aloni wrote:
> If you are right, I guess put_files_struct() of kernel/exit.c would
> have cleaned files_struct everytime someones called it.
> Everywhere in the kernel, objects are freed when
> atomic_dec_and_test() returns true.
Indeed, after studying the asm in questi
On Thu, 16 Nov 2000, Jacob Luna Lundberg wrote:
>
> I'm not (yet) a kernel guru, so just point and laugh if I'm wrong, but...
>
> On Thu, 16 Nov 2000, Dan Aloni wrote:
> > - if (!--de->count) {
> > + if (atomic_dec_and_test(&de->count)) {
>
> Doesn't this reverse th
I'm not (yet) a kernel guru, so just point and laugh if I'm wrong, but...
On Thu, 16 Nov 2000, Dan Aloni wrote:
> - if (!--de->count) {
> + if (atomic_dec_and_test(&de->count)) {
Doesn't this reverse the sense of the test?
-Jacob
--
"My my, the cruelest lies are
On Thu, 16 Nov 2000, Linus Torvalds wrote:
> On Thu, 16 Nov 2000, Dan Aloni wrote:
> >
> > Makes procfs use an atomic use count for dir entries, to avoid using
> > the Big kernel lock. Axboe says it looks ok.
>
> There's a race there. Look at what happens if de_put() races with
> remove_proc_e
On Thu, 16 Nov 2000, Dan Aloni wrote:
>
> Makes procfs use an atomic use count for dir entries, to avoid using
> the Big kernel lock. Axboe says it looks ok.
There's a race there. Look at what happens if de_put() races with
remove_proc_entry(): we'd do free_proc_entry() twice. Not good.
Leav
(against test11-pre5)
Makes procfs use an atomic use count for dir entries, to avoid using
the Big kernel lock. Axboe says it looks ok.
--- linux/fs/proc/inode.c Wed Jun 21 17:25:17 2000
+++ linux/fs/proc/inode.c Thu Nov 16 19:09:28 2000
@@ -25,7 +25,7 @@
struct proc_dir_entry * d
11 matches
Mail list logo