From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751863AbcFWPYS (ORCPT ); Thu, 23 Jun 2016 11:24:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56945 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750866AbcFWPYQ (ORCPT ); Thu, 23 Jun 2016 11:24:16 -0400 Message-ID: <1466695453.15275.31.camel@redhat.com> Subject: Re: [PATCH 5/5] irqtime: drop local_irq_save/restore from irqtime_account_irq From: Rik van Riel To: Paolo Bonzini , Peter Zijlstra Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, fweisbec@gmail.com, wanpeng.li@hotmail.com, efault@gmx.de, tglx@linutronix.de, rkrcmar@redhat.com Date: Thu, 23 Jun 2016 11:24:13 -0400 In-Reply-To: References: <1466093167-27653-1-git-send-email-riel@redhat.com> <1466093167-27653-6-git-send-email-riel@redhat.com> <20160621214934.GT30909@twins.programming.kicks-ass.net> <1466632519.15275.29.camel@redhat.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-WONeIrJgqVLhOltZe22Y" Mime-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 23 Jun 2016 15:24:16 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-WONeIrJgqVLhOltZe22Y Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2016-06-23 at 15:52 +0200, Paolo Bonzini wrote: >=20 > On 22/06/2016 23:55, Rik van Riel wrote: > >=20 > > >=20 > > > >=20 > > > > + hardirq_time =3D > > > > READ_ONCE(per_cpu(cpu_hardirq_time, > > > > cpu)); > > > Which makes this per_cpu(,cpu) usage somewhat curious. What's > > > wrong > > > with __this_cpu_read() ? > > I played around with it a bit, and it seems that > > __this_cpu_read does not want to nest inside > > READ_ONCE.=C2=A0=C2=A0Nobody else seems to be doing that, > > either. > According to arch/x86/include/asm/percpu.h, this_cpu_read always has=C2= =A0 > READ_ONCE semantics, but I cannot find that in include/asm-generic > /percpu.h.=C2=A0=C2=A0It probably just works because of all the layers of= goo, > but > something like this (101% untested) would make me feel safer: >=20 Are READ_ONCE semantics desired for every per-cpu read? > > Back to READ_ONCE(per_cpu(,cpu)) it is... > What about READ_ONCE(this_cpu_ptr())? I tried that yesterday, because it looked like it would work. Unfortunately, it does not. =C2=A0 CC=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0kernel/sched/cputime.o kernel/sched/cputime.c: In function =E2=80=98irqtime_account_irq=E2=80=99: kernel/sched/cputime.c:107:71: warning: initialization makes pointer from integer without a cast [-Wint-conversion] kernel/sched/cputime.c:107:298: error: invalid type argument of unary =E2=80=98*=E2=80=99 (have =E2=80=98u64 {aka long long unsigned int}=E2=80= =99) kernel/sched/cputime.c:107:428: warning: initialization makes pointer from integer without a cast [-Wint-conversion] kernel/sched/cputime.c:107:655: error: invalid type argument of unary =E2=80=98*=E2=80=99 (have =E2=80=98u64 {aka long long unsigned int}=E2=80= =99) kernel/sched/cputime.c:107:749: warning: initialization makes pointer from integer without a cast [-Wint-conversion] kernel/sched/cputime.c:107:976: error: invalid type argument of unary =E2=80=98*=E2=80=99 (have =E2=80=98u64 {aka long long unsigned int}=E2=80= =99) kernel/sched/cputime.c:107:1087: warning: initialization makes pointer from integer without a cast [-Wint-conversion] kernel/sched/cputime.c:107:1314: error: invalid type argument of unary =E2=80=98*=E2=80=99 (have =E2=80=98u64 {aka long long unsigned int}=E2=80= =99) kernel/sched/cputime.c:107:1408: warning: initialization makes pointer from integer without a cast [-Wint-conversion] kernel/sched/cputime.c:107:1635: error: invalid type argument of unary =E2=80=98*=E2=80=99 (have =E2=80=98u64 {aka long long unsigned int}=E2=80= =99) kernel/sched/cputime.c: In function =E2=80=98irqtime_account_hi_update=E2= =80=99: kernel/sched/cputime.c:145:175: warning: comparison of distinct pointer types lacks a cast kernel/sched/cputime.c: In function =E2=80=98irqtime_account_si_update=E2= =80=99: kernel/sched/cputime.c:162:182: warning: comparison of distinct pointer types lacks a cast scripts/Makefile.build:291: recipe for target 'kernel/sched/cputime.o' failed make[1]: *** [kernel/sched/cputime.o] Error 1 Makefile:1594: recipe for target 'kernel/sched/' failed make: *** [kernel/sched/] Error 2 --=20 All rights reversed --=-WONeIrJgqVLhOltZe22Y Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJXa/8dAAoJEM553pKExN6DgRAH/ihPeVtfpKkfbD8mztQHZuOi lrfxJYkcGFgwqgEt/uCYLfmVBCIst4sS5uXhOPOWUdqkR3k/snHeqysuny5DykRb WUGUvwi6aPG2s/4Jig42WUKq/jZ63CtV4MArhXbnpt4MgPGJWrIOAUaLrNr0Ciqu jW+snDIB3An++DMiqk92weU6kdA7HV4Uw+BH+QT60bqNV9c7SoK8iJJZkVO5ZNuZ v0ZvsxC+JCtm3wSUD8ami0R0hlkIsu2U0zznZ4UYInXPtgTfDh/RTdl8Cnhgr9ls GuccG67+XUVNtxRAwHJsg4AR0mCe5Q9lvNKWCKKlR0NkRZvk94y9poTSpmEFGxo= =hRTQ -----END PGP SIGNATURE----- --=-WONeIrJgqVLhOltZe22Y--