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


Groups > linux.kernel > #1301629

Re: [PATCH v2 22/32] s390: define __smp_xxx

From Christian Borntraeger <borntraeger@de.ibm.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 22/32] s390: define __smp_xxx
Date 2016-01-05 16:50 +0100
Message-ID <qNC1Y-4OF-19@gated-at.bofh.it> (permalink)
References (1 earlier) <qLQLN-8pu-49@gated-at.bofh.it> <qNdGi-48u-19@gated-at.bofh.it> <qNjLL-8i4-69@gated-at.bofh.it> <qNv0t-7OE-7@gated-at.bofh.it> <qNwfU-ag-29@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 01/05/2016 10:30 AM, Michael S. Tsirkin wrote:

> 
> arch/s390/kernel/vdso.c:        smp_mb();
> 
> Looking at
> 	Author: Christian Borntraeger <borntraeger@de.ibm.com>
> 	Date:   Fri Sep 11 16:23:06 2015 +0200
> 
> 	    s390/vdso: use correct memory barrier
> 
> 	    By definition smp_wmb only orders writes against writes. (Finish all
> 	    previous writes, and do not start any future write). To protect the
> 	    vdso init code against early reads on other CPUs, let's use a full
> 	    smp_mb at the end of vdso init. As right now smp_wmb is implemented
> 	    as full serialization, this needs no stable backport, but this change
> 	    will be necessary if we reimplement smp_wmb.
> 
> ok from hypervisor point of view, but it's also strange:
> 1. why isn't this paired with another mb somewhere?
>    this seems to violate barrier pairing rules.
> 2. how does smp_mb protect against early reads on other CPUs?
>    It normally does not: it orders reads from this CPU versus writes
>    from same CPU. But init code does not appear to read anything.
>    Maybe this is some s390 specific trick?
> 
> I could not figure out the above commit.

It was probably me misreading the code. I change a wmb into a full mb here
since I was changing the defintion of wmb to a compiler barrier. I tried to
fixup all users of wmb that really pair with other code. I assumed that there
must be some reader (as there was a wmb before) but I could not figure out
which. So I just played safe here.

But it probably can be removed.

> arch/s390/kvm/kvm-s390.c:       smp_mb();

This can go. If you have a patch, I can carry that via the kvms390 tree,
or I will spin a new patch with you as suggested-by.

Christian

--
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 22/32] s390: define __smp_xxx Peter Zijlstra <peterz@infradead.org> - 2016-01-04 14:50 +0100
  Re: [PATCH v2 22/32] s390: define __smp_xxx "Michael S. Tsirkin" <mst@redhat.com> - 2016-01-04 21:20 +0100
    Re: [PATCH v2 22/32] s390: define __smp_xxx Martin Schwidefsky <schwidefsky@de.ibm.com> - 2016-01-05 09:20 +0100
      Re: [PATCH v2 22/32] s390: define __smp_xxx "Michael S. Tsirkin" <mst@redhat.com> - 2016-01-05 10:40 +0100
        Re: [PATCH v2 22/32] s390: define __smp_xxx Martin Schwidefsky <schwidefsky@de.ibm.com> - 2016-01-05 13:10 +0100
          Re: [PATCH v2 22/32] s390: define __smp_xxx "Michael S. Tsirkin" <mst@redhat.com> - 2016-01-05 14:10 +0100
            Re: [PATCH v2 22/32] s390: define __smp_xxx Martin Schwidefsky <schwidefsky@de.ibm.com> - 2016-01-05 15:30 +0100
        Re: [PATCH v2 22/32] s390: define __smp_xxx Christian Borntraeger <borntraeger@de.ibm.com> - 2016-01-05 16:50 +0100
          Re: [PATCH v2 22/32] s390: define __smp_xxx "Michael S. Tsirkin" <mst@redhat.com> - 2016-01-05 17:10 +0100

csiph-web