search for: write_seqcount_begin

Displaying 20 results from an estimated 56 matches for "write_seqcount_begin".

2019 Jul 31
2
[PATCH V2 7/9] vhost: do not use RCU to synchronize MMU notifier with worker
...the VA while it is being changed by the mm. ie you use something seqlocky instead of the ugly mmu_notifier_unregister/register cycle. You are supposed to use something simple like a spinlock or mutex inside the invalidate_range_start to serialized tear down of the SPTEs with their accessors. > write_seqcount_begin() > > map = vq->map[X] > > write or read through map->addr directly > > write_seqcount_end() > > > There's no rmb() in write_seqcount_begin(), so map could be read before > write_seqcount_begin(), but it looks to me now that this doesn't harm at >...
2019 Jul 31
2
[PATCH V2 7/9] vhost: do not use RCU to synchronize MMU notifier with worker
...the VA while it is being changed by the mm. ie you use something seqlocky instead of the ugly mmu_notifier_unregister/register cycle. You are supposed to use something simple like a spinlock or mutex inside the invalidate_range_start to serialized tear down of the SPTEs with their accessors. > write_seqcount_begin() > > map = vq->map[X] > > write or read through map->addr directly > > write_seqcount_end() > > > There's no rmb() in write_seqcount_begin(), so map could be read before > write_seqcount_begin(), but it looks to me now that this doesn't harm at >...
2019 Jul 31
2
[PATCH V2 7/9] vhost: do not use RCU to synchronize MMU notifier with worker
On Wed, Jul 31, 2019 at 04:46:53AM -0400, Jason Wang wrote: > We used to use RCU to synchronize MMU notifier with worker. This leads > calling synchronize_rcu() in invalidate_range_start(). But on a busy > system, there would be many factors that may slow down the > synchronize_rcu() which makes it unsuitable to be called in MMU > notifier. > > A solution is SRCU but its
2019 Jul 31
2
[PATCH V2 7/9] vhost: do not use RCU to synchronize MMU notifier with worker
On Wed, Jul 31, 2019 at 04:46:53AM -0400, Jason Wang wrote: > We used to use RCU to synchronize MMU notifier with worker. This leads > calling synchronize_rcu() in invalidate_range_start(). But on a busy > system, there would be many factors that may slow down the > synchronize_rcu() which makes it unsuitable to be called in MMU > notifier. > > A solution is SRCU but its
2019 Aug 01
0
[PATCH V2 7/9] vhost: do not use RCU to synchronize MMU notifier with worker
...de the invalidate_range_start to serialized tear down of the SPTEs > with their accessors. Technically yes, but we probably can't afford that for vhost fast path, the atomics eliminate almost all the performance improvement brought by this patch on a machine without SMAP. > >> write_seqcount_begin() >> >> map = vq->map[X] >> >> write or read through map->addr directly >> >> write_seqcount_end() >> >> >> There's no rmb() in write_seqcount_begin(), so map could be read before >> write_seqcount_begin(), but it looks to me now...
2019 Jul 31
0
[PATCH V2 7/9] vhost: do not use RCU to synchronize MMU notifier with worker
...g dirty pages and unmapping page.? It looks to me seqlock doesn't provide things like this.? Or are you suggesting that taking writer seq lock in vhost worker and busy wait for seqcount to be even in MMU notifier (something similar to what this patch did)? I don't do this because e.g: write_seqcount_begin() map = vq->map[X] write or read through map->addr directly write_seqcount_end() There's no rmb() in write_seqcount_begin(), so map could be read before write_seqcount_begin(), but it looks to me now that this doesn't harm at all, maybe we can try this way. > > >>...
2019 Mar 29
0
[PATCH net v4] failover: allow name change on IFF_UP slave interfaces
...t actually care about slave 1197 * name change, as they are only expected to operate 1198 * on master interface directly. 1199 */ 1200 if (dev->flags & IFF_UP && 1201 likely(!(dev->priv_flags & IFF_FAILOVER_SLAVE))) 1202 return -EBUSY; 1203 1204 write_seqcount_begin(&devnet_rename_seq); 1205 1206 if (strncmp(newname, dev->name, IFNAMSIZ) == 0) { 1207 write_seqcount_end(&devnet_rename_seq); 1208 return 0; 1209 } 1210 1211 memcpy(oldname, dev->name, IFNAMSIZ); 1212 1213 err = dev_get_valid_name(net, dev, newname); 121...
2019 Mar 28
0
[PATCH net v3] failover: allow name change on IFF_UP slave interfaces
...* name change, as they are only expected to operate 1199 * on master interface directly. 1200 */ 1201 if (dev->flags & IFF_UP) { 1202 if (likely(!(dev->priv_flags & IFF_FAILOVER_SLAVE))) 1203 return -EBUSY; 1204 reopen_needed = true; 1205 } 1206 1207 write_seqcount_begin(&devnet_rename_seq); 1208 1209 if (strncmp(newname, dev->name, IFNAMSIZ) == 0) { 1210 write_seqcount_end(&devnet_rename_seq); 1211 return 0; 1212 } 1213 1214 memcpy(oldname, dev->name, IFNAMSIZ); 1215 1216 err = dev_get_valid_name(net, dev, newname); 121...
2019 Aug 07
2
[PATCH V4 7/9] vhost: do not use RCU to synchronize MMU notifier with worker
...S; i++) > @@ -362,6 +361,40 @@ static bool vhost_map_range_overlap(struct vhost_uaddr *uaddr, > return !(end < uaddr->uaddr || start > uaddr->uaddr - 1 + uaddr->size); > } > > +static void inline vhost_vq_access_map_begin(struct vhost_virtqueue *vq) > +{ > + write_seqcount_begin(&vq->seq); > +} > + > +static void inline vhost_vq_access_map_end(struct vhost_virtqueue *vq) > +{ > + write_seqcount_end(&vq->seq); > +} The write side of a seqlock only provides write barriers. Access to map = vq->maps[VHOST_ADDR_USED]; Still needs a read si...
2019 Aug 07
2
[PATCH V4 7/9] vhost: do not use RCU to synchronize MMU notifier with worker
...S; i++) > @@ -362,6 +361,40 @@ static bool vhost_map_range_overlap(struct vhost_uaddr *uaddr, > return !(end < uaddr->uaddr || start > uaddr->uaddr - 1 + uaddr->size); > } > > +static void inline vhost_vq_access_map_begin(struct vhost_virtqueue *vq) > +{ > + write_seqcount_begin(&vq->seq); > +} > + > +static void inline vhost_vq_access_map_end(struct vhost_virtqueue *vq) > +{ > + write_seqcount_end(&vq->seq); > +} The write side of a seqlock only provides write barriers. Access to map = vq->maps[VHOST_ADDR_USED]; Still needs a read si...
2012 Jun 06
9
[PATCH] virtio-net: fix a race on 32bit arches
From: Eric Dumazet <edumazet at google.com> commit 3fa2a1df909 (virtio-net: per cpu 64 bit stats (v2)) added a race on 32bit arches. We must use separate syncp for rx and tx path as they can be run at the same time on different cpus. Thus one sequence increment can be lost and readers spin forever. Signed-off-by: Eric Dumazet <edumazet at google.com> Cc: Stephen Hemminger
2012 Jun 06
9
[PATCH] virtio-net: fix a race on 32bit arches
From: Eric Dumazet <edumazet at google.com> commit 3fa2a1df909 (virtio-net: per cpu 64 bit stats (v2)) added a race on 32bit arches. We must use separate syncp for rx and tx path as they can be run at the same time on different cpus. Thus one sequence increment can be lost and readers spin forever. Signed-off-by: Eric Dumazet <edumazet at google.com> Cc: Stephen Hemminger
2019 Aug 07
0
[PATCH V4 7/9] vhost: do not use RCU to synchronize MMU notifier with worker
...for (i = 0; i < VHOST_NUM_ADDRS; i++) @@ -362,6 +361,40 @@ static bool vhost_map_range_overlap(struct vhost_uaddr *uaddr, return !(end < uaddr->uaddr || start > uaddr->uaddr - 1 + uaddr->size); } +static void inline vhost_vq_access_map_begin(struct vhost_virtqueue *vq) +{ + write_seqcount_begin(&vq->seq); +} + +static void inline vhost_vq_access_map_end(struct vhost_virtqueue *vq) +{ + write_seqcount_end(&vq->seq); +} + +static void inline vhost_vq_sync_access(struct vhost_virtqueue *vq) +{ + unsigned int seq; + + /* Make sure any changes to map was done before checking seq...
2019 Mar 21
2
[PATCH net v2] failover: allow name change on IFF_UP slave interfaces
..._name(struct net_device *dev, const char *newname) > BUG_ON(!dev_net(dev)); > > net = dev_net(dev); > - if (dev->flags & IFF_UP) > + if (dev->flags & IFF_UP && > + !(dev->priv_flags & IFF_SLAVE_RENAME_OK)) > return -EBUSY; > > write_seqcount_begin(&devnet_rename_seq); > diff --git a/net/core/failover.c b/net/core/failover.c > index 4a92a98..34c5c87 100644 > --- a/net/core/failover.c > +++ b/net/core/failover.c > @@ -80,14 +80,14 @@ static int failover_slave_register(struct net_device *slave_dev) > goto err_upper_link...
2019 Mar 21
2
[PATCH net v2] failover: allow name change on IFF_UP slave interfaces
..._name(struct net_device *dev, const char *newname) > BUG_ON(!dev_net(dev)); > > net = dev_net(dev); > - if (dev->flags & IFF_UP) > + if (dev->flags & IFF_UP && > + !(dev->priv_flags & IFF_SLAVE_RENAME_OK)) > return -EBUSY; > > write_seqcount_begin(&devnet_rename_seq); > diff --git a/net/core/failover.c b/net/core/failover.c > index 4a92a98..34c5c87 100644 > --- a/net/core/failover.c > +++ b/net/core/failover.c > @@ -80,14 +80,14 @@ static int failover_slave_register(struct net_device *slave_dev) > goto err_upper_link...
2019 Aug 08
3
[PATCH V4 7/9] vhost: do not use RCU to synchronize MMU notifier with worker
...gt;> vhost_uaddr *uaddr, >>> ????? return !(end < uaddr->uaddr || start > uaddr->uaddr - 1 + >>> uaddr->size); >>> ? } >>> ? +static void inline vhost_vq_access_map_begin(struct >>> vhost_virtqueue *vq) >>> +{ >>> +??? write_seqcount_begin(&vq->seq); >>> +} >>> + >>> +static void inline vhost_vq_access_map_end(struct vhost_virtqueue *vq) >>> +{ >>> +??? write_seqcount_end(&vq->seq); >>> +} >> The write side of a seqlock only provides write barriers. Access to &...
2013 Dec 11
0
[RFC][PATCH 2/5] timekeeping: Fix potential lost pv notification of time change
...cycle_interval<<shift) shift--; } @@ -1420,7 +1420,7 @@ static void update_wall_time(void) * Finally, make sure that after the rounding * xtime_nsec isn''t larger than NSEC_PER_SEC */ - action = accumulate_nsecs_to_secs(tk); + action |= accumulate_nsecs_to_secs(tk); write_seqcount_begin(&timekeeper_seq); /* Update clock->cycle_last with the new value */ -- 1.8.3.2
2019 Aug 07
0
[PATCH V4 7/9] vhost: do not use RCU to synchronize MMU notifier with worker
...,40 @@ static bool vhost_map_range_overlap(struct vhost_uaddr *uaddr, >> return !(end < uaddr->uaddr || start > uaddr->uaddr - 1 + uaddr->size); >> } >> >> +static void inline vhost_vq_access_map_begin(struct vhost_virtqueue *vq) >> +{ >> + write_seqcount_begin(&vq->seq); >> +} >> + >> +static void inline vhost_vq_access_map_end(struct vhost_virtqueue *vq) >> +{ >> + write_seqcount_end(&vq->seq); >> +} > The write side of a seqlock only provides write barriers. Access to > > map = vq->maps[VHO...
2019 Aug 07
12
[PATCH V4 0/9] Fixes for metadata accelreation
Hi all: This series try to fix several issues introduced by meta data accelreation series. Please review. Changes from V3: - remove the unnecessary patch Changes from V2: - use seqlck helper to synchronize MMU notifier with vhost worker Changes from V1: - try not use RCU to syncrhonize MMU notifier with vhost worker - set dirty pages after no readers - return -EAGAIN only when we find the
2019 Aug 07
12
[PATCH V4 0/9] Fixes for metadata accelreation
Hi all: This series try to fix several issues introduced by meta data accelreation series. Please review. Changes from V3: - remove the unnecessary patch Changes from V2: - use seqlck helper to synchronize MMU notifier with vhost worker Changes from V1: - try not use RCU to syncrhonize MMU notifier with vhost worker - set dirty pages after no readers - return -EAGAIN only when we find the