[arch-commits] Commit in memcached/trunk (3 files)

Dan McGee dan at nymeria.archlinux.org
Sun Apr 20 01:24:33 UTC 2014


    Date: Sunday, April 20, 2014 @ 03:24:33
  Author: dan
Revision: 211561

upgpkg: memcached 1.4.18-1

Added:
  memcached/trunk/0001-don-t-drop-to-a-condition-without-holding-the-lock.patch
  memcached/trunk/0002-flag-crawler-as-running-during-the-request-to-run.patch
Modified:
  memcached/trunk/PKGBUILD

---------------------------------------------------------------+
 0001-don-t-drop-to-a-condition-without-holding-the-lock.patch |   35 +++++++++
 0002-flag-crawler-as-running-during-the-request-to-run.patch  |   38 ++++++++++
 PKGBUILD                                                      |   14 ++-
 3 files changed, 83 insertions(+), 4 deletions(-)

Added: 0001-don-t-drop-to-a-condition-without-holding-the-lock.patch
===================================================================
--- 0001-don-t-drop-to-a-condition-without-holding-the-lock.patch	                        (rev 0)
+++ 0001-don-t-drop-to-a-condition-without-holding-the-lock.patch	2014-04-20 01:24:33 UTC (rev 211561)
@@ -0,0 +1,35 @@
+From 9d635fa7f46f000d23663e0be3a900d2c51a3ed8 Mon Sep 17 00:00:00 2001
+From: dormando <dormando at rydia.net>
+Date: Sat, 19 Apr 2014 12:15:29 -0700
+Subject: [PATCH 1/2] don't drop to a condition without holding the lock
+
+I am a moran. How do you even thread.
+---
+ items.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/items.c b/items.c
+index 688ad03..3e2f71f 100644
+--- a/items.c
++++ b/items.c
+@@ -764,6 +764,7 @@ static void item_crawler_evaluate(item *search, uint32_t hv, int i) {
+ static void *item_crawler_thread(void *arg) {
+     int i;
+ 
++    pthread_mutex_lock(&lru_crawler_lock);
+     if (settings.verbose > 2)
+         fprintf(stderr, "Starting LRU crawler background thread\n");
+     while (do_run_lru_crawler_thread) {
+@@ -827,8 +828,8 @@ static void *item_crawler_thread(void *arg) {
+     STATS_LOCK();
+     stats.lru_crawler_running = false;
+     STATS_UNLOCK();
+-    pthread_mutex_unlock(&lru_crawler_lock);
+     }
++    pthread_mutex_unlock(&lru_crawler_lock);
+     if (settings.verbose > 2)
+         fprintf(stderr, "LRU crawler thread stopping\n");
+ 
+-- 
+1.9.2
+

Added: 0002-flag-crawler-as-running-during-the-request-to-run.patch
===================================================================
--- 0002-flag-crawler-as-running-during-the-request-to-run.patch	                        (rev 0)
+++ 0002-flag-crawler-as-running-during-the-request-to-run.patch	2014-04-20 01:24:33 UTC (rev 211561)
@@ -0,0 +1,38 @@
+From d8b1047620a54443f6bdca7f0dc5ee3b4d99378e Mon Sep 17 00:00:00 2001
+From: dormando <dormando at rydia.net>
+Date: Sat, 19 Apr 2014 16:03:28 -0700
+Subject: [PATCH 2/2] flag crawler as running during the request to run
+
+... so there's no race to tell if it's running if you check after the command
+exits.
+---
+ items.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/items.c b/items.c
+index 3e2f71f..6261503 100644
+--- a/items.c
++++ b/items.c
+@@ -769,9 +769,6 @@ static void *item_crawler_thread(void *arg) {
+         fprintf(stderr, "Starting LRU crawler background thread\n");
+     while (do_run_lru_crawler_thread) {
+     pthread_cond_wait(&lru_crawler_cond, &lru_crawler_lock);
+-    STATS_LOCK();
+-    stats.lru_crawler_running = true;
+-    STATS_UNLOCK();
+ 
+     while (crawler_count) {
+         item *search = NULL;
+@@ -918,6 +915,9 @@ enum crawler_result_type lru_crawler_crawl(char *slabs) {
+     }
+     pthread_mutex_unlock(&cache_lock);
+     pthread_cond_signal(&lru_crawler_cond);
++    STATS_LOCK();
++    stats.lru_crawler_running = true;
++    STATS_UNLOCK();
+     pthread_mutex_unlock(&lru_crawler_lock);
+     return CRAWLER_OK;
+ }
+-- 
+1.9.2
+

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2014-04-19 21:10:15 UTC (rev 211560)
+++ PKGBUILD	2014-04-20 01:24:33 UTC (rev 211561)
@@ -3,7 +3,7 @@
 # Contributor: Michael Irwin <6d6469 at gmail.com>
 
 pkgname=memcached
-pkgver=1.4.17
+pkgver=1.4.18
 pkgrel=1
 pkgdesc="A distributed memory object caching system"
 arch=(i686 x86_64)
@@ -13,12 +13,18 @@
 optdepends=('perl: for memcached-tool usage')
 install=memcached.install
 source=(http://www.memcached.org/files/$pkgname-$pkgver.tar.gz
-		memcached.service)
-sha256sums=('d9173ef6d99ba798c982ea4566cb4f0e64eb23859fdbf9926a89999d8cdc0458'
-            'e768a48192aefa2e2f443c86b3c085043005ffc313da40f3074c060a18c8359d')
+        memcached.service
+        0001-don-t-drop-to-a-condition-without-holding-the-lock.patch
+        0002-flag-crawler-as-running-during-the-request-to-run.patch)
+sha256sums=('6a5cc8d0874f13c5043d741af83fbdc4c681316d32b8313c0dbc82ca96f97439'
+            'e768a48192aefa2e2f443c86b3c085043005ffc313da40f3074c060a18c8359d'
+            'dc25b5128e4b5f21d2a2d6186517139281e2e3bfc6142eaa72ef5840dbfc1236'
+            '07f959563571125248914392fb2a1e3f75a8692f5724c7ed98f0f16737801527')
 
 build() {
   cd "$srcdir/$pkgname-$pkgver"
+  patch -Np1 < ../0001-don-t-drop-to-a-condition-without-holding-the-lock.patch
+  patch -Np1 < ../0002-flag-crawler-as-running-during-the-request-to-run.patch
   ./configure --prefix=/usr
   make
 }




More information about the arch-commits mailing list