search for: read_lock

Displaying 20 results from an estimated 88 matches for "read_lock".

2017 Nov 17
0
[nbdkit PATCH 3/6] connections: Add read/write lock over client I/O
...1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/connections.c b/src/connections.c index dada9aa..dd43a9a 100644 --- a/src/connections.c +++ b/src/connections.c @@ -62,6 +62,8 @@ /* Connection structure. */ struct connection { pthread_mutex_t request_lock; + pthread_mutex_t read_lock; + pthread_mutex_t write_lock; void *handle; void *crypto_session; @@ -206,6 +208,8 @@ new_connection (int sockin, int sockout) conn->sockin = sockin; conn->sockout = sockout; pthread_mutex_init (&conn->request_lock, NULL); + pthread_mutex_init (&conn->read_loc...
2017 Nov 17
8
[RFC nbdkit PATCH 0/6] Enable full parallel request handling
I want to make my nbd forwarding plugin fully parallel - but to do that, I first need to make nbdkit itself fully parallel ;) With this series, I was finally able to demonstrate out-of-order responses when using qemu-io (which is great at sending back-to-back requests prior to waiting for responses) coupled with the nbd file plugin (which has a great feature of rdelay and wdelay, to make it
2017 Nov 17
2
Re: [nbdkit PATCH 3/6] connections: Add read/write lock over client I/O
...> > diff --git a/src/connections.c b/src/connections.c > index dada9aa..dd43a9a 100644 > --- a/src/connections.c > +++ b/src/connections.c > @@ -62,6 +62,8 @@ > /* Connection structure. */ > struct connection { > pthread_mutex_t request_lock; > + pthread_mutex_t read_lock; > + pthread_mutex_t write_lock; > void *handle; > void *crypto_session; > > @@ -206,6 +208,8 @@ new_connection (int sockin, int sockout) > conn->sockin = sockin; > conn->sockout = sockout; > pthread_mutex_init (&conn->request_lock, NULL); >...
2007 Apr 18
1
[Bridge] [PATCH] bridge use read_lock when scanning device list
On 2.6.1, bridge is using rtnl_shlock which is equivalent to rtnl_lock when all it really needs to do is read_lock(&dev_base_lock). diff -Nru a/net/bridge/br_if.c b/net/bridge/br_if.c --- a/net/bridge/br_if.c Mon Jan 12 13:45:44 2004 +++ b/net/bridge/br_if.c Mon Jan 12 13:45:44 2004 @@ -252,12 +252,12 @@ struct net_device *dev; int i = 0; - rtnl_shlock(); + read_lock(&dev_base_lock); for (dev...
2018 Apr 12
3
[PATCH nbdkit 0/2] connections: Protect open and close callbacks with the request lock.
I'm fairly sure that these bugs which appear in the Python plugin: https://bugzilla.redhat.com/show_bug.cgi?id=1566516 https://bugzilla.redhat.com/show_bug.cgi?id=1566522 are really bugs in the SERIALIZE_ALL_REQUESTS thread model. See the first patch for the full explanation. The second patch is a fix for a race condition which is probably nudged into being by the first patch. Now this
2008 Oct 07
6
A race condition introduced by changeset 15175: Re-init hypercall stubs page after HVM save/restore
For an SMP Linux HVM guest with PV drivers inserted, when we do save/restore (or LiveMigration) for the guest, it might panic after it''s restored. The panic point is inside ap_suspend(): .... while (info->do_spin) { cpu_relax(); read_lock(&suspend_lock); HYPERVISOR_yield(); ----> guest might panic on the invocation of this function. read_unlock(&suspend_lock); } ... The root cause is: ap might be invoking the hypercall while bsp is asking the hypervisor to re-initialize the hypercall page when th...
2010 Aug 04
6
[PATCH -v2 0/3] jbd2 scalability patches
This version fixes three bugs in the 2nd patch of this series that caused kernel BUG when the system was under race. We weren't accounting with t_oustanding_credits correctly, and there were race conditions caused by the fact the I had overlooked the fact that __jbd2_log_wait_for_space() and jbd2_get_transaction() requires j_state_lock to be write locked. Theodore Ts'o (3): jbd2: Use
2017 Nov 20
10
[nbdkit PATCH v2 0/8] Support parallel transactions within single connection
I've posted some of these patches or ideas before; but now I'm confident enough with the series that it should be ready to push; at any rate, I can now run test-socket-activation in a tight loop without triggering any crashes or hangs. With this in place, I'm going back to work on making the nbd forwarder wort with the parallel thread model. Eric Blake (8): sockets: Use
2018 Apr 19
3
[nbdkit PATCH 0/2] Fix testsuite deadlocks during close
Commit 9e6d990f exposed a pre-existing deadlock between the nbd plugin as client and parallel nbdkit as server. Prior to that commit, the deadlock was "resolved" because we unloaded the .so in parallel to a .close callback that never completed (yes, it's nasty that it usually? let the testsuite pass), but now we correctly refuse to unload a plugin that has not returned from .close,
2018 Aug 02
0
[net-next, v6, 6/7] net-sysfs: Add interface for Rx queue(s) map per Tx queue
...ote: > > On Tue, Jul 10, 2018 at 07:28:49PM -0700, Nambiar, Amritha wrote: > >> With this patch series, I introduced static_key for XPS maps > >> (xps_needed), so static_key_slow_inc() is used to switch branches. The > >> definition of static_key_slow_inc() has cpus_read_lock in place. In the > >> virtio_net driver, XPS queues are initialized after setting the > >> queue:cpu affinity in virtnet_set_affinity() which is already protected > >> within cpus_read_lock. Hence, the warning here trying to acquire > >> cpus_read_lock when it is...
2018 Apr 19
0
[nbdkit PATCH 2/2] nbd: Don't read after client sends NBD_CMD_DISC
...ions(-) diff --git a/src/connections.c b/src/connections.c index 46f2cd4..6c1f8cd 100644 --- a/src/connections.c +++ b/src/connections.c @@ -1056,8 +1056,9 @@ recv_request_send_reply (struct connection *conn) /* Read the request packet. */ { ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&conn->read_lock); - if (get_status (conn) < 0) - return -1; + r = get_status (conn); + if (r <= 0) + return r; r = conn->recv (conn, &request, sizeof request); if (r == -1) { nbdkit_error ("read request: %m"); -- 2.14.3
2004 Nov 10
2
Reset Statistics?
2010 Jan 04
0
[RFC 03/12 RESEND PATCH] Btrfs: Reorder __btrfs_map_block to make code more efficient.
...ulti_bio *multi = NULL; - if (multi_ret && !(rw & (1 << BIO_RW))) - stripes_allocated = 1; -again: - if (multi_ret) { - multi = kzalloc(btrfs_multi_bio_size(stripes_allocated), - GFP_NOFS); - if (!multi) - return -ENOMEM; - - atomic_set(&multi->error, 0); - } - read_lock(&em_tree->lock); em = lookup_extent_mapping(em_tree, logical, *length); read_unlock(&em_tree->lock); @@ -2663,27 +2649,6 @@ again: map = (struct map_lookup *)em->bdev; offset = logical - em->start; - if (mirror_num > map->num_stripes) - mirror_num = 0; - - /* if...
2019 Sep 19
1
[PATCH nbdkit] server: Remove tricksy initialization of struct b_conn_handle.
...lush = -1; + h->is_rotational = -1; + h->can_trim = -1; + h->can_zero = -1; + h->can_fast_zero = -1; + h->can_fua = -1; + h->can_multi_conn = -1; + h->can_extents = -1; + h->can_cache = -1; +} + struct connection { pthread_mutex_t request_lock; pthread_mutex_t read_lock; -- 2.23.0
2019 Aug 09
0
[RFC PATCH v6 27/92] kvm: introspection: use page track
...access *__kvmi_get_gfn_access(struct kvmi *ikvm, + const gfn_t gfn) +{ + return radix_tree_lookup(&ikvm->access_tree, gfn); +} + +static int kvmi_get_gfn_access(struct kvmi *ikvm, const gfn_t gfn, + u8 *access) +{ + struct kvmi_mem_access *m; + + *access = full_access; + + read_lock(&ikvm->access_tree_lock); + m = __kvmi_get_gfn_access(ikvm, gfn); + if (m) + *access = m->access; + read_unlock(&ikvm->access_tree_lock); + + return m ? 0 : -1; +} + +static bool kvmi_restricted_access(struct kvmi *ikvm, gpa_t gpa, u8 access) +{ + u8 allowed_access; + int err; + +...
2006 Jul 25
0
[Bug 495] New: Netfilter Connection Tracking Race Condition in Kernel 2.4.x
...-- linux-2.4.32/net/ipv4/netfilter/ip_conntrack_core.c.orig 2005-04-03 18:42:20.000000000 -0700 +++ linux-2.4.32/net/ipv4/netfilter/ip_conntrack_core.c 2006-07-24 13:23:25.000000000 -0700 @@ -777,6 +777,14 @@ /* look for tuple match */ h = ip_conntrack_find_get(&tuple, NULL); if (!h) { + READ_LOCK(&ip_conntrack_lock); + h = LIST_FIND(&unconfirmed, conntrack_tuple_cmp, + struct ip_conntrack_tuple_hash *, &tuple, NULL); + if (h) + atomic_inc(&h->ctrack->ct_general.use); + READ_UNLOCK(&ip_conntrack_lock); + } + if (!h) { h = init_conntrack(&tuple, p...
2023 Nov 17
0
TSIG error with server: tsig verify failure - Failed DNS update with exit code 5
...16 20:21:05 camus samba[30387]: /usr/local/samba/sbin/samba_dnsupdate: control: <NONE> <27>Nov 16 20:21:05 camus samba[30387]: /usr/local/samba/sbin/samba_dnsupdate: <27>Nov 16 20:21:05 camus samba[30387]: /usr/local/samba/sbin/samba_dnsupdate: ldb: ldb_trace_request: (tdb)->read_lock <27>Nov 16 20:21:05 camus samba[30387]: /usr/local/samba/sbin/samba_dnsupdate: ldb: ldb_trace_next_request: (tdb)->search <27>Nov 16 20:21:05 camus samba[30387]: /usr/local/samba/sbin/samba_dnsupdate: ldb: Added timed event "ldb_kv_callback": 0x55875bb6e3a0 <27>Nov...
2007 Apr 18
0
[Bridge] [PATCH] (4/4) bridge forwarding table RCU
Convert the bridge forwarding database over to using RCU. This avoids a read_lock and atomic_inc/dec in the fast path of output. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> diff -Nru a/include/linux/list.h b/include/linux/list.h --- a/include/linux/list.h 2004-07-28 15:30:04 -07:00 +++ b/include/linux/list.h 2004-07-28 15:30:04 -07:00 @@ -678,6 +678,24 @@...
2007 Apr 18
0
[Bridge] [PATCH] (4/11) bridge - ioctl cleanup and consolidation
...v_open; diff -Nru a/net/bridge/br_if.c b/net/bridge/br_if.c --- a/net/bridge/br_if.c 2004-05-20 10:51:05 -07:00 +++ b/net/bridge/br_if.c 2004-05-20 10:51:05 -07:00 @@ -309,34 +309,6 @@ return 0; } -int br_get_bridge_ifindices(int *indices, int num) -{ - struct net_device *dev; - int i = 0; - - read_lock(&dev_base_lock); - for (dev = dev_base; dev && i < num; dev = dev->next) { - if (dev->priv_flags & IFF_EBRIDGE) - indices[i++] = dev->ifindex; - } - read_unlock(&dev_base_lock); - - return i; -} - -void br_get_port_ifindices(struct net_bridge *br, int *ifindices,...
2018 Aug 03
0
[net-next, v6, 6/7] net-sysfs: Add interface for Rx queue(s) map per Tx queue
...2018 at 07:28:49PM -0700, Nambiar, Amritha wrote: > > > >> With this patch series, I introduced static_key for XPS maps > > > >> (xps_needed), so static_key_slow_inc() is used to switch branches. The > > > >> definition of static_key_slow_inc() has cpus_read_lock in place. In the > > > >> virtio_net driver, XPS queues are initialized after setting the > > > >> queue:cpu affinity in virtnet_set_affinity() which is already protected > > > >> within cpus_read_lock. Hence, the warning here trying to acquire > >...