Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1303039

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb

Path csiph.com!eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!news.panservice.it!bofh.it!news.nic.it!robomod
From "Michael S. Tsirkin" <mst@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb
Date Wed, 06 Jan 2016 21:30:02 +0100
Message-ID <qO2Su-5Zm-9@gated-at.bofh.it> (permalink)
References <qLQLL-8pu-3@gated-at.bofh.it> <qLQVs-8sN-7@gated-at.bofh.it> <qNJmN-1oM-5@gated-at.bofh.it> <qNUif-nA-59@gated-at.bofh.it> <qNULf-zb-9@gated-at.bofh.it> <qNUUW-Cv-13@gated-at.bofh.it> <qNXpM-2lM-21@gated-at.bofh.it> <qO10n-4M5-35@gated-at.bofh.it>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
X-Scanned-By MIMEDefang 2.68 on 10.5.11.26
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 64
Organization linux.* mail to news gateway
X-Original-Cc Peter Zijlstra <peterz@infradead.org>, linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org, Rob Landley <rob@landley.net>, Jeff Dionne <jeff@uclinux.org>, Yoshinori Sato <ysato@users.sourceforge.jp>
X-Original-Date Wed, 6 Jan 2016 22:23:12 +0200
X-Original-Message-ID <20160106222019-mutt-send-email-mst@redhat.com>
X-Original-References <1451572003-2440-1-git-send-email-mst@redhat.com> <1451572003-2440-32-git-send-email-mst@redhat.com> <20160105232735.GC238@brightrain.aerifal.cx> <20160106131321-mutt-send-email-mst@redhat.com> <20160106114023.GU6344@twins.programming.kicks-ass.net> <20160106134301-mutt-send-email-mst@redhat.com> <20160106143218.GV6344@twins.programming.kicks-ass.net> <20160106182349.GD238@brightrain.aerifal.cx>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1303039

Show key headers only | View raw


On Wed, Jan 06, 2016 at 01:23:50PM -0500, Rich Felker wrote:
> On Wed, Jan 06, 2016 at 03:32:18PM +0100, Peter Zijlstra wrote:
> > On Wed, Jan 06, 2016 at 01:52:17PM +0200, Michael S. Tsirkin wrote:
> > > > > Peter, what do you think? How about I leave this patch as is for now?
> > > > 
> > > > No, and I object to removing the single byte implementation too. Either
> > > > remove the full arch or fix xchg() to conform. xchg() should work on all
> > > > native word sizes, for SH that would be 1,2 and 4 bytes.
> > > 
> > > Rick, maybe you could explain how is current 1 byte xchg on llsc wrong?
> > 
> > It doesn't seem to preserve the 3 other bytes in the word.
> > 
> > > It does use 4 byte accesses but IIUC that is all that exists on
> > > this architecture.
> > 
> > Right, that's not a problem, look at arch/alpha/include/asm/xchg.h for
> > example. A store to another portion of the word should make the
> > store-conditional fail and we'll retry the loop.
> > 
> > The short versions should however preserve the other bytes in the word.
> 
> Indeed. Also, accesses must be aligned, so the asm needs to round down
> to an aligned address and perform a correct read-modify-write on it,
> placing the new byte in the correct offset in the word.
> 
> Alternatively (my preference) this logic can be impemented in C as a
> wrapper around the 32-bit cmpxchg. I think this is less error-prone
> and it can be shared between the multiple sh cmpxchg back-ends,
> including the new cas.l one we need for J2.
> 
> > SH's cmpxchg() is equally incomplete and does not provide 1 and 2 byte
> > versions.
> > 
> > In any case, I'm all for rm -rf arch/sh/, one less arch to worry about
> > is always good, but ISTR some people wanting to resurrect SH:
> > 
> >   http://old.lwn.net/Articles/647636/
> > 
> > Rob, Jeff, Sato-san, might I suggest you send a MAINTAINERS patch and
> > take up an active interest in SH lest someone 'accidentally' nukes it?
> 
> We're in the process of preparing such a proposal right now. That
> current intent is that Sato-san and I will co-maintain arch/sh. We'll
> include more details about motivation, proposed development direction,
> existing work to be merged, etc. in that proposal.
> 
> Rich

Well I'd like to be able to make progress with generic
arch cleanups meanwhile.

Could you quickly write a version of 1 and 2 byte xchg that
works so I can include it?

Thanks!

-- 
MST
--
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/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb Rich Felker <dalias@libc.org> - 2016-01-06 00:40 +0100
  Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb "Michael S. Tsirkin" <mst@redhat.com> - 2016-01-06 12:20 +0100
    Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb Peter Zijlstra <peterz@infradead.org> - 2016-01-06 12:50 +0100
      Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb "Michael S. Tsirkin" <mst@redhat.com> - 2016-01-06 13:00 +0100
        Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb Peter Zijlstra <peterz@infradead.org> - 2016-01-06 15:40 +0100
          Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb Rob Landley <rob@landley.net> - 2016-01-06 16:50 +0100
            Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb Peter Zijlstra <peterz@infradead.org> - 2016-01-06 18:00 +0100
              Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb Rob Landley <rob@landley.net> - 2016-01-06 21:30 +0100
            Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb Geert Uytterhoeven <geert@linux-m68k.org> - 2016-01-06 20:00 +0100
          Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb Rich Felker <dalias@libc.org> - 2016-01-06 19:30 +0100
            Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb "Michael S. Tsirkin" <mst@redhat.com> - 2016-01-06 21:30 +0100
              Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb Rich Felker <dalias@libc.org> - 2016-01-07 01:00 +0100
                Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb Peter Zijlstra <peterz@infradead.org> - 2016-01-07 14:40 +0100
                Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb Rich Felker <dalias@libc.org> - 2016-01-07 20:10 +0100
                Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb "Michael S. Tsirkin" <mst@redhat.com> - 2016-01-07 17:00 +0100
                Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb "Michael S. Tsirkin" <mst@redhat.com> - 2016-01-07 18:50 +0100
                Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb Rich Felker <dalias@libc.org> - 2016-01-07 20:20 +0100
                Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb "Michael S. Tsirkin" <mst@redhat.com> - 2016-01-07 23:50 +0100
                Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb Rich Felker <dalias@libc.org> - 2016-01-08 05:30 +0100
                Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb "Michael S. Tsirkin" <mst@redhat.com> - 2016-01-08 08:30 +0100
            Re: [PATCH v2 31/32] sh: support a 2-byte smp_store_mb "Michael S. Tsirkin" <mst@redhat.com> - 2016-01-06 23:20 +0100

csiph-web