search for: watch_mutex

Displaying 18 results from an estimated 18 matches for "watch_mutex".

2012 Sep 25
2
[PATCH V2] libxenstore: filter watch events in libxenstore when we unwatch
...e/xs.c index b951015..df89e37 100644 --- a/tools/xenstore/xs.c +++ b/tools/xenstore/xs.c @@ -753,6 +753,19 @@ bool xs_watch(struct xs_handle *h, const char *path, const char *token) ARRAY_SIZE(iov), NULL)); } + +/* Clear the pipe token if there are no more pending watchs. + * We suppose the watch_mutex is already taken. + */ +static void xs_clear_watch_pipe(struct xs_handle *h) +{ + char c; + + if (list_empty(&h->watch_list) && (h->watch_pipe[0] != -1)) + while (read(h->watch_pipe[0], &c, 1) != 1) + continue; +} + /* Find out what node change was on (will block if not...
2012 Dec 14
1
[PATCH V4] libxenstore: filter watch events in libxenstore when we unwatch
...utex_lock(m) ((void)0) @@ -247,6 +251,8 @@ static struct xs_handle *get_handle(const char *connect_to) /* Watch pipe is allocated on demand in xs_fileno(). */ h->watch_pipe[0] = h->watch_pipe[1] = -1; + h->unwatch_filter = false; + #ifdef USE_PTHREAD pthread_mutex_init(&h->watch_mutex, NULL); pthread_cond_init(&h->watch_condvar, NULL); @@ -287,6 +293,9 @@ struct xs_handle *xs_open(unsigned long flags) if (!xsh && !(flags & XS_OPEN_SOCKETONLY)) xsh = get_handle(xs_domain_dev()); + if (xsh && (flags & XS_UNWATCH_FILTER)) + xsh->unwatch_f...
2012 Dec 14
1
[PATCH V5] libxenstore: filter watch events in libxenstore when we unwatch
...utex_lock(m) ((void)0) @@ -247,6 +251,8 @@ static struct xs_handle *get_handle(const char *connect_to) /* Watch pipe is allocated on demand in xs_fileno(). */ h->watch_pipe[0] = h->watch_pipe[1] = -1; + h->unwatch_filter = false; + #ifdef USE_PTHREAD pthread_mutex_init(&h->watch_mutex, NULL); pthread_cond_init(&h->watch_condvar, NULL); @@ -287,6 +293,9 @@ struct xs_handle *xs_open(unsigned long flags) if (!xsh && !(flags & XS_OPEN_SOCKETONLY)) xsh = get_handle(xs_domain_dev()); + if (xsh && (flags & XS_UNWATCH_FILTER)) + xsh->unwatch_f...
2012 Dec 13
4
[PATCH V3] libxenstore: filter watch events in libxenstore when we unwatch
...mutex_lock(m) ((void)0) @@ -247,6 +251,8 @@ static struct xs_handle *get_handle(const char *connect_to) /* Watch pipe is allocated on demand in xs_fileno(). */ h->watch_pipe[0] = h->watch_pipe[1] = -1; + h->unwatch_safe = false; + #ifdef USE_PTHREAD pthread_mutex_init(&h->watch_mutex, NULL); pthread_cond_init(&h->watch_condvar, NULL); @@ -287,6 +293,9 @@ struct xs_handle *xs_open(unsigned long flags) if (!xsh && !(flags & XS_OPEN_SOCKETONLY)) xsh = get_handle(xs_domain_dev()); + if (xsh && (flags & XS_UNWATCH_SAFE)) + xsh->unwatch_saf...
2012 Sep 19
5
[PATCH] libxenstore: filter watch events in libxenstore when we unwatch
...iov[1].iov_base = (char *)token; iov[1].iov_len = strlen(token) + 1; - return xs_bool(xs_talkv(h, XBT_NULL, XS_UNWATCH, iov, + res = xs_bool(xs_talkv(h, XBT_NULL, XS_UNWATCH, iov, ARRAY_SIZE(iov), NULL)); + + /* Filter the watch list to remove potential message */ + mutex_lock(&h->watch_mutex); + + if (list_empty(&h->watch_list)) { + mutex_unlock(&h->watch_mutex); + return res; + } + + list_for_each_entry_safe(msg, tmsg, &h->watch_list, list) { + assert(msg->hdr.type == XS_WATCH_EVENT); + + strings = msg->body; + num_strings = xs_count_strings(strings, ms...
2013 Sep 12
6
[PATCH] RFC xen: suppress Coverity warnings about atomic_read and atomic_set.
Coverity generates false positives when read_atomic() and write_atomic() are called with pointers to objects smaller than 64 bits (because it can''t see that the 64-bit access in the switych statement is dead code). I don''t want to automatically suppress all ofthose, because read_atomic() and write_atomic() could still be called with mis-cast pointers, but for atomic_t accessors
2007 Apr 23
27
[PATCH 00/25] xen: Xen implementation for paravirt_ops
Hi Andi, This series of patches implements the Xen paravirt-ops interface. It applies to 2.6.21-rc7 + your patches + the last batch of pv_ops patches I posted. This patch generally restricts itself to Xen-specific parts of the tree, though it does make a few small changes elsewhere. These patches include: - some helper routines for allocating address space and walking pagetables - Xen
2007 Apr 23
27
[PATCH 00/25] xen: Xen implementation for paravirt_ops
Hi Andi, This series of patches implements the Xen paravirt-ops interface. It applies to 2.6.21-rc7 + your patches + the last batch of pv_ops patches I posted. This patch generally restricts itself to Xen-specific parts of the tree, though it does make a few small changes elsewhere. These patches include: - some helper routines for allocating address space and walking pagetables - Xen
2007 May 11
30
[patch 00/28]xen: Xen implementation for paravirt_ops
Hi Andi, This series of patches implements the Xen paravirt-ops interface. It applies to 2.6.21-git13 + patches-2.6.21-git7-070507-1.tar.gz (I think "unwinder" is the only patch which doesn't apply to git13, and the sched-clock patches are the only ones which this series actually needs). Changes since the last posting: - More netfront review and cleanup - Added ability to
2007 May 11
30
[patch 00/28]xen: Xen implementation for paravirt_ops
Hi Andi, This series of patches implements the Xen paravirt-ops interface. It applies to 2.6.21-git13 + patches-2.6.21-git7-070507-1.tar.gz (I think "unwinder" is the only patch which doesn't apply to git13, and the sched-clock patches are the only ones which this series actually needs). Changes since the last posting: - More netfront review and cleanup - Added ability to
2007 May 11
30
[patch 00/28]xen: Xen implementation for paravirt_ops
Hi Andi, This series of patches implements the Xen paravirt-ops interface. It applies to 2.6.21-git13 + patches-2.6.21-git7-070507-1.tar.gz (I think "unwinder" is the only patch which doesn't apply to git13, and the sched-clock patches are the only ones which this series actually needs). Changes since the last posting: - More netfront review and cleanup - Added ability to
2007 May 22
35
[patch 00/33] xen: Xen paravirt_ops implementation
Hi, This is the Xen implementation for the paravirt_ops interface. The series is based on 2.6.22-rc1-mm1, and I think its ready to be cooked in -mm with a view to being merged in 2.6.23. The first part of the series is some small changes to the core kernel. Apart from the new code added in "Allocate and free vmalloc areas" (posted many times before), they are simply a few one-liners
2007 May 22
35
[patch 00/33] xen: Xen paravirt_ops implementation
Hi, This is the Xen implementation for the paravirt_ops interface. The series is based on 2.6.22-rc1-mm1, and I think its ready to be cooked in -mm with a view to being merged in 2.6.23. The first part of the series is some small changes to the core kernel. Apart from the new code added in "Allocate and free vmalloc areas" (posted many times before), they are simply a few one-liners
2007 May 22
35
[patch 00/33] xen: Xen paravirt_ops implementation
Hi, This is the Xen implementation for the paravirt_ops interface. The series is based on 2.6.22-rc1-mm1, and I think its ready to be cooked in -mm with a view to being merged in 2.6.23. The first part of the series is some small changes to the core kernel. Apart from the new code added in "Allocate and free vmalloc areas" (posted many times before), they are simply a few one-liners
2007 May 04
31
[patch 00/29] xen: Xen implementation for paravirt_ops
Hi Andi, This series of patches implements the Xen paravirt-ops interface. It applies to 2.6.21-git3 + ff patches-2.6.21-git3-070501-1.tar.gz. Changes since the last posting: - reviews of xenbus (me), netfront (hch, rusty, herbert xu) and blockfront (hch), with most comments addressed. Netfront review revealed a couple of real bugs, and the code for all three is looking cleaner
2007 May 04
31
[patch 00/29] xen: Xen implementation for paravirt_ops
Hi Andi, This series of patches implements the Xen paravirt-ops interface. It applies to 2.6.21-git3 + ff patches-2.6.21-git3-070501-1.tar.gz. Changes since the last posting: - reviews of xenbus (me), netfront (hch, rusty, herbert xu) and blockfront (hch), with most comments addressed. Netfront review revealed a couple of real bugs, and the code for all three is looking cleaner
2007 Apr 29
33
[patch 00/32] xen: Xen implementation for paravirt_ops
Hi Andi, This series of patches implements the Xen paravirt-ops interface. It applies to 2.6.21 + 2.6.21-070428-1 + the patches I've posted over the last couple of days. Changes since the last posting: - update per review comments - comment each file - comment barrier use - use common cpu sibling setup - fixed a few minor bugs, specifically a traceirq mismatch warning - some
2007 Apr 29
33
[patch 00/32] xen: Xen implementation for paravirt_ops
Hi Andi, This series of patches implements the Xen paravirt-ops interface. It applies to 2.6.21 + 2.6.21-070428-1 + the patches I've posted over the last couple of days. Changes since the last posting: - update per review comments - comment each file - comment barrier use - use common cpu sibling setup - fixed a few minor bugs, specifically a traceirq mismatch warning - some