lkml.org 
[lkml]   [2001]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion
Date
In message <Pine.LNX.4.33.0110120948540.31692-100000@penguin.transmeta.com> you
write:
> Yes. With maybe
>
> non_preempt()
> ..
> preempt()
>
> around it for the pre-emption patches.

Sure, if they want pre-emption on SMP. Of course, then they'll want
priority inheritence.

> However, you also need to make your free _free_ be aware of the count.
> Which means that the current RCU patch is really unusable for this. You
> need to have the "count" always in a generic place (put it with the hash),
> and your schedule-time free needs to do
>
> if (atomic_read(&count))
> skip_this_do_it_next_time

WTF? I'll spell it out for you again:

static inline void foo_put(struct foo *foo)
{
if (atomic_dec_and_test(foo->use))
kfree(foo);
}

Write side normal:

lock
unhash(foo)
unlock
foo_put(foo)

Write side RCU:

lock
unhash(foo)
unlock
rcu_call(foo_put, foo);
/* ie. call foo_put(foo) "later". */

That's all. Really.

> Do that, and the RCU patches may start looking usable for the real world.

I know you're under strain, but think harder please.

Rusty.
--
Premature optmztion is rt of all evl. --DK
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:08    [W:0.432 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site