[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [patch 14/30] drm/i915/pmu: Replace open coded kstat_irqs() copy
 
- To: 'Thomas Gleixner' <tglx@xxxxxxxxxxxxx>, Tvrtko Ursulin	<tvrtko.ursulin@xxxxxxxxxxxxxxx>, LKML <linux-kernel@xxxxxxxxxxxxxxx>
 
- From: David Laight <David.Laight@xxxxxxxxxx>
 
- Date: Fri, 11 Dec 2020 22:06:24 +0000
 
- Accept-language: en-GB, en-US
 
- Authentication-results: relay.mimecast.com;	auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@xxxxxxxxxx
 
- Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Marc Zyngier <maz@xxxxxxxxxx>,	"Jani Nikula" <jani.nikula@xxxxxxxxxxxxxxx>, Joonas Lahtinen	<joonas.lahtinen@xxxxxxxxxxxxxxx>, Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx>,	David Airlie <airlied@xxxxxxxx>, Daniel Vetter <daniel@xxxxxxxx>,	"intel-gfx@xxxxxxxxxxxxxxxxxxxxx" <intel-gfx@xxxxxxxxxxxxxxxxxxxxx>,	"dri-devel@xxxxxxxxxxxxxxxxxxxxx" <dri-devel@xxxxxxxxxxxxxxxxxxxxx>, "James E.J. Bottomley" <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>, Helge Deller	<deller@xxxxxx>, afzal mohammed <afzal.mohd.ma@xxxxxxxxx>,	"linux-parisc@xxxxxxxxxxxxxxx" <linux-parisc@xxxxxxxxxxxxxxx>, Russell King	<linux@xxxxxxxxxxxxxxx>, "linux-arm-kernel@xxxxxxxxxxxxxxxxxxx"	<linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, Mark Rutland <mark.rutland@xxxxxxx>,	Catalin Marinas <catalin.marinas@xxxxxxx>, Will Deacon <will@xxxxxxxxxx>,	Christian Borntraeger <borntraeger@xxxxxxxxxx>, Heiko Carstens	<hca@xxxxxxxxxxxxx>, "linux-s390@xxxxxxxxxxxxxxx"	<linux-s390@xxxxxxxxxxxxxxx>, Pankaj Bharadiya	<pankaj.laxminarayan.bharadiya@xxxxxxxxx>, Chris Wilson	<chris@xxxxxxxxxxxxxxxxxx>, Wambui Karuga <wambui.karugax@xxxxxxxxx>, "Linus Walleij" <linus.walleij@xxxxxxxxxx>, "linux-gpio@xxxxxxxxxxxxxxx"	<linux-gpio@xxxxxxxxxxxxxxx>, Lee Jones <lee.jones@xxxxxxxxxx>, Jon Mason	<jdmason@xxxxxxxx>, Dave Jiang <dave.jiang@xxxxxxxxx>, Allen Hubbe	<allenbh@xxxxxxxxx>, "linux-ntb@xxxxxxxxxxxxxxxx"	<linux-ntb@xxxxxxxxxxxxxxxx>, Lorenzo Pieralisi <lorenzo.pieralisi@xxxxxxx>,	Rob Herring <robh@xxxxxxxxxx>, Bjorn Helgaas <bhelgaas@xxxxxxxxxx>, "Michal Simek" <michal.simek@xxxxxxxxxx>, "linux-pci@xxxxxxxxxxxxxxx"	<linux-pci@xxxxxxxxxxxxxxx>, Karthikeyan Mitran	<m.karthikeyan@xxxxxxxxxxxxxx>, Hou Zhiqiang <Zhiqiang.Hou@xxxxxxx>, "Tariq Toukan" <tariqt@xxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, "Jakub Kicinski" <kuba@xxxxxxxxxx>, "netdev@xxxxxxxxxxxxxxx"	<netdev@xxxxxxxxxxxxxxx>, "linux-rdma@xxxxxxxxxxxxxxx"	<linux-rdma@xxxxxxxxxxxxxxx>, Saeed Mahameed <saeedm@xxxxxxxxxx>, "Leon Romanovsky" <leon@xxxxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>,	Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>,	"xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
 
- Delivery-date: Fri, 11 Dec 2020 22:06:30 +0000
 
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
 
- Thread-index: AQHWz72qwjNpP0n0UkWT70W8RrLS8qnx7xrwgAB1jgCAAA6ksA==
 
- Thread-topic: [patch 14/30] drm/i915/pmu: Replace open coded kstat_irqs() copy
 
 
 
From: Thomas Gleixner
> Sent: 11 December 2020 21:11
> 
> On Fri, Dec 11 2020 at 14:19, David Laight wrote:
> > From: Thomas Gleixner
> >> You can't catch that. If this really becomes an issue you need a
> >> sequence counter around it.
> >
> > Or just two copies of the high word.
> > Provided the accesses are sequenced:
> > writer:
> >     load high:low
> >     add small_value,high:low
> >     store high
> >     store low
> >     store high_copy
> > reader:
> >     load high_copy
> >     load low
> >     load high
> >     if (high != high_copy)
> >             low = 0;
> 
> And low = 0 is solving what? You need to loop back and retry until it's
> consistent and then it's nothing else than an open coded sequence count.
If it is a counter or timestamp then the high:0 value happened
some time between when you started trying to read the value and
when you finished trying to read it.
As such it is a perfectly reasonable return value.
        David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, 
UK
Registration No: 1397386 (Wales)
 
    
     |