linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: Andrew Morton <akpm@digeo.com>
Cc: Stephen Hemminger <shemminger@osdl.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>, Andi Kleen <ak@suse.de>,
	linux-mm@kvack.org
Subject: Re: New version of frlock (now called seqlock)
Date: Fri, 31 Jan 2003 00:50:26 +0100	[thread overview]
Message-ID: <20030130235026.GX18538@dualathlon.random> (raw)
In-Reply-To: <3E39B8E6.5F668D28@digeo.com>

On Thu, Jan 30, 2003 at 03:44:38PM -0800, Andrew Morton wrote:
> Stephen Hemminger wrote:
> > 
> > This is an update to the earlier frlock.
> > 
> 
> Sorry, but I have lost track of what version is what.  Please
> let me get my current act together and then prepare diffs
> against (or new versions of) that.
> 
> You appear to have not noticed my earlier suggestions wrt
> coding tweaks and inefficiencies in the new implementation.
> 
> - SEQ_INIT and seq_init can go away.
> 
> - do seq_write_begin/end need wmb(), or mb()?  Probably, we
>   should just remove these functions altogether.
> 
> -
> 	+static inline int seq_read_end(const seqcounter_t *s, unsigned iv)
> 	+{
> 	+       mb();
> 	+       return (s->counter != iv) || (iv & 1);
> 	+}
> 
>   So the barriers changed _again_!  Could we please at least
>   get Richard Henderson and Andrea to agree that this is the
>   right way to do it?

the right way is the one used by x86-64 vgettimeofday and
i_size_read/write in my tree (and frlock in my tree too for x86
gettimeofday)

that is pure rmb() in read_lock and pure wmb() in write_lock

never mb()

The only place where mb() could be somehow interesting is the
write_begin/end but it's mostly a theorical interest, and we both think
that write_begin/end is pointless, since the lock part is useless for
them, and in turn write_begin/end aren't that clean anyways.


> 
> -
> 	+typedef struct {
> 	+       volatile unsigned counter;
> 	+} seqcounter_t;
> 
>   Why did this become a struct?
> 
>   Why is it volatile?

it definitely doesn't need to be volatile

on the struct or not I don't mind either ways

Andrea
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/

  reply	other threads:[~2003-01-30 23:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-30 23:30 Stephen Hemminger
2003-01-30 23:44 ` Andrew Morton
2003-01-30 23:50   ` Andrea Arcangeli [this message]
2003-01-31  0:15     ` Stephen Hemminger
2003-01-30 23:51 ` Andi Kleen
2003-01-31  0:33   ` Stephen Hemminger

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=20030130235026.GX18538@dualathlon.random \
    --to=andrea@suse.de \
    --cc=ak@suse.de \
    --cc=akpm@digeo.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-mm@kvack.org \
    --cc=shemminger@osdl.org \
    /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