search for: write_lock

Displaying 20 results from an estimated 110 matches for "write_lock".

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 17
0
[nbdkit PATCH 3/6] connections: Add read/write lock over client I/O
...(+), 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_lock, NULL); + pthread_mutex_init...
2012 Sep 17
0
[PATCH] Btrfs: do not hold the write_lock on the extent tree while logging V2
..., args.src, args.start_slot, args.nr, LOG_INODE_ALL); - if (ret) + if (ret) { + free_extent_map(em); continue; + } btrfs_release_path(path); args.nr = 0; } ret = log_one_extent(trans, inode, root, em, path, dst_path, &args); + free_extent_map(em); + write_lock(&tree->lock); } + WARN_ON(!list_empty(&extents)); + write_unlock(&tree->lock); if (!ret && args.nr) ret = copy_items(trans, inode, dst_path, args.src, args.start_slot, args.nr, LOG_INODE_ALL); btrfs_release_path(path); - WARN_ON(!list_empty(&extents));...
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
...ions.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-&gt...
2006 Apr 27
4
Sessions Problems
Hi to group! I am new to ROR! I am facing problems on sessions. First I created the one session variable. after that I created the other one. after moving to three pages the session was destroyed automatically. What is the reason please help me! Thnaks and Regards, -Kumar Varma -- Posted via http://www.ruby-forum.com/.
2017 Nov 21
6
[nbdkit PATCH v2 0/4] enable parallel nbd forwarding
With this, I am finally able to get the nbd plugin to do out-of-order responses to the client. Once this series goes in, we should be ready for Rich to cut a release. Eric Blake (4): nbd: Split reading into separate thread nbd: Protect writes with mutex nbd: Enable parallel handling tests: Test parallel nbd behavior plugins/nbd/nbd.c | 217
2019 Mar 08
2
[PATCH nbdkit] Minimal implementation of NBD Structured Replies.
...24,12 +1245,123 @@ nbd_errno (int error) } } +static int +send_simple_reply (struct connection *conn, + uint64_t handle, uint16_t cmd, + const char *buf, uint32_t count, + uint32_t error) +{ + ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&conn->write_lock); + struct simple_reply reply; + int r; + + reply.magic = htobe32 (NBD_SIMPLE_REPLY_MAGIC); + reply.handle = handle; + reply.error = htobe32 (nbd_errno (error)); + + r = conn->send (conn, &reply, sizeof reply); + if (r == -1) { + nbdkit_error ("write reply: %s: %m", name_...
2019 Sep 24
0
[PATCH nbdkit 3/4] common/protocol: Update nbd-protocol.h so it matches libnbd’s copy.
...htobe16 (eflags); diff --git a/server/protocol.c b/server/protocol.c index 8df5ed5..89fbdfa 100644 --- a/server/protocol.c +++ b/server/protocol.c @@ -367,7 +367,7 @@ send_simple_reply (struct connection *conn, uint32_t error) { ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&conn->write_lock); - struct simple_reply reply; + struct nbd_simple_reply reply; int r; int f = (cmd == NBD_CMD_READ && !error) ? SEND_MORE : 0; @@ -404,8 +404,8 @@ send_structured_reply_read (struct connection *conn, * that yet we acquire the lock for the whole function. */ ACQUIRE_LOC...
2020 Sep 22
1
[PATCH] kernel/resource: Fix use of ternary condition in release_mem_region_adjustable
...,7 @@ void release_mem_region_adjustable(resource_size_t start, resource_size_t size) * similarly). */ retry: - new_res = alloc_resource(GFP_KERNEL | alloc_nofail ? __GFP_NOFAIL : 0); + new_res = alloc_resource(GFP_KERNEL | (alloc_nofail ? __GFP_NOFAIL : 0)); p = &parent->child; write_lock(&resource_lock); base-commit: 40ee82f47bf297e31d0c47547cd8f24ede52415a -- 2.28.0
2019 Apr 23
0
[nbdkit PATCH 4/4] plugins: Utilize ACQUIRE_LOCK_FOR_CURRENT_SCOPE
...nclude "protocol.h" #include "byte-swapping.h" +#include "cleanup.h" static char *sockname = NULL; static char *export = NULL; @@ -266,14 +267,13 @@ nbd_request_raw (struct handle *h, uint16_t flags, uint16_t type, }; int r; - pthread_mutex_lock (&h->write_lock); + ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&h->write_lock); nbdkit_debug ("sending request type %d (%s), flags %#x, offset %#" PRIx64 ", count %#x, cookie %#" PRIx64, type, name_of_nbd_cmd(type), flags, offset, count, cookie); r = write_f...
2019 Mar 08
0
Re: [PATCH nbdkit] Minimal implementation of NBD Structured Replies.
...+ * in chunks, we'll be able to grab the write lock for each chunk, > + * allowing other threads to interleave replies. As we're not doing > + * that yet we acquire the lock for the whole function. > + */ Fair enough. > + ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&conn->write_lock); > + struct structured_reply reply; > + struct structured_reply_offset_data offset_data; > + int r; > + > + assert (cmd == NBD_CMD_READ); > + > + reply.magic = htobe32 (NBD_STRUCTURED_REPLY_MAGIC); > + reply.handle = handle; > + reply.flags = htobe16 (NBD_REPLY_FL...
2011 Jan 26
0
[PATCH 2/3] jbd2: Remove barrier feature conditional flag (or: always issue flushes)
...urn ret; } diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 48ce561..7379829 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3704,10 +3704,6 @@ static void ext4_init_journal_params(struct super_block *sb, journal_t *journal) journal->j_max_batch_time = sbi->s_max_batch_time; write_lock(&journal->j_state_lock); - if (test_opt(sb, BARRIER)) - journal->j_flags |= JBD2_BARRIER; - else - journal->j_flags &= ~JBD2_BARRIER; if (test_opt(sb, DATA_ERR_ABORT)) journal->j_flags |= JBD2_ABORT_ON_SYNCDATA_ERR; else @@ -3899,9 +3895,6 @@ static int ext4_load_journa...
2011 Feb 12
3
[PATCH] fix uncheck memory allocations
...*inode, u64 start, u64 end, testend = 0; } while (1) { - if (!split) + if (!split) { split = alloc_extent_map(GFP_NOFS); - if (!split2) + BUG_ON(!split || IS_ERR(split)); + } + if (!split2) { split2 = alloc_extent_map(GFP_NOFS); + BUG_ON(!split2 || IS_ERR(split2)); + } write_lock(&em_tree->lock); em = lookup_extent_mapping(em_tree, start, len); diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index c9bc0af..40bbe00 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -287,6 +287,7 @@ static noinline int add_async_extent(struct async_cow *cow, struct async_ext...
2007 Mar 23
7
Multiple servers for one index
...writing to the same index. Using a DRb service is not an option since this would create a single point of failure. I tried using Ferret::Store::FSDirectory to create a write lock on the the index directory with code somewhat like this one: [...] dir = Ferret::Store::FSDirectory.new(INDEX_PATH) write_lock = dir.make_lock("lock") write_lock.obtain index << {:id => id, :type => ''create_test_type''}\ index.flush write_lock.release [...] but it makes the processes freezes or raise a Ferret::Store::Lock::LockError in my different attempts. I tried to play with In...
2007 Nov 21
2
File locking problems and duplicate emails with the snarf plugin
Two weeks ago we switched all our IMAP users (around 25,000) from the Washington IMAP server to Dovecot, and since then there have been several occasions when reading new email just hangs, and duplicate emails appear. We are using the 'snarf' plugin to copy new email to the inbox, and it looks as though the problems are caused by file locking. We have been using the Washington IMAP server
2018 Nov 08
1
[nbdkit PATCH] nbd: Fix race during close
...dle) nbd_request_raw (h, 0, NBD_CMD_DISC, 0, 0, 0, NULL); shutdown (h->fd, SHUT_WR); } - close (h->fd); if ((errno = pthread_join (h->reader, NULL))) nbdkit_debug ("failed to join reader thread: %m"); + close (h->fd); pthread_mutex_destroy (&h->write_lock); pthread_mutex_destroy (&h->trans_lock); free (h); -- 2.17.2
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
2019 May 25
0
[nbdkit PATCH 2/2] nbd: Add shared=true parameter
...; + +/* The per-connection handle */ +struct handle { + /* These fields are read-only once initialized */ + int fd; + int flags; + int64_t size; + bool structured; + bool extents; + pthread_t reader; + + /* Prevents concurrent threads from interleaving writes to server */ + pthread_mutex_t write_lock; + + pthread_mutex_t trans_lock; /* Covers access to all fields below */ + struct transaction *trans; + uint64_t unique; + bool dead; +}; + /* Connect to server via absolute name of Unix socket */ static char *sockname; @@ -73,9 +104,18 @@ static const char *export; /* Number of retries */...
2019 May 30
0
[nbdkit PATCH 3/4] nbd: Use libnbd 0.1
...t size; - bool structured; - bool extents; + struct nbd_handle *nbd; + int fd; /* Cache of nbd_aio_get_fd */ + int fds[2]; /* Pipe for kicking the reader thread */ + bool readonly; pthread_t reader; - /* Prevents concurrent threads from interleaving writes to server */ - pthread_mutex_t write_lock; - - pthread_mutex_t trans_lock; /* Covers access to all fields below */ - struct transaction *trans; - uint64_t unique; - bool dead; + pthread_mutex_t trans_lock; /* Covers access to trans list */ + struct transaction *trans; /* List of pending transactions */ }; /* Connect to server via...