public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dipankar Sarma <dipankar@in.ibm.com>
To: torvalds@transmeta.com
Cc: davem@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: Segfault hidden in list.h
Date: Mon, 13 May 2002 12:03:23 +0530	[thread overview]
Message-ID: <20020513120323.A1265@in.ibm.com> (raw)


In article <Pine.LNX.4.44.0205121805220.15392-100000@home.transmeta.com> Linus Torvalds wrote:

> On Sun, 12 May 2002, David S. Miller wrote:
>> However, if the list manipulation had some memory barriers
>> added to it...

> That would just make _those_ much slower, with some very doubtful end
> results.

I agree. In most cases, list.h macros will be used under lock and
putting barriers there will penalize the common case.


> Show me numbers, and show me readable source, and show me a proof that the
> memory ordering actually works, and I may consider lockless algorithms
> worthwhile. As it is, they are damn fragile and require more care that I
> personally care to expect out of 99.9% of all programmers.
> And I'm sure as hell not going to put any lockless stuff in functions
> meant for "normal human consumption". If we create list macros like that,
> they had better be called "lockless_list_add_be_damn_careful_about_it()"
> rather than "list_add()".

It isn't really necessary to to put memeory barriers in list macros
for use with RCU. In many data structures, list traversal is done in
only one direction and therefore memory barriers can be put after
list_add() or such macros. If indeed traversal is more complicated
than that, it might not be a good idea to do lockfree traversal in
the first place.

As for readable lockless algorithms, sure they exist. See
http://prdownloads.sourceforge.net/lse/rt_rcu-2.5.3-1.patch.

Thanks
-- 
Dipankar Sarma  <dipankar@in.ibm.com> http://lse.sourceforge.net
Linux Technology Center, IBM Software Lab, Bangalore, India.

             reply	other threads:[~2002-05-13  6:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-13  6:33 Dipankar Sarma [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-05-13  2:17 Segfault hidden in list.h Rose, Billy
2002-05-13  1:10 Rose, Billy
2002-05-13  1:02 Rose, Billy
2002-05-13  1:34 ` Davide Libenzi
2002-05-13  0:37 Rose, Billy
2002-05-13  0:59 ` Linus Torvalds
2002-05-13  0:50   ` David S. Miller
2002-05-13  1:08     ` Linus Torvalds
2002-05-13  2:08       ` David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020513120323.A1265@in.ibm.com \
    --to=dipankar@in.ibm.com \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox