summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-04-26 14:48:58 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-04-26 14:48:58 +0200
commit3d6bb4ff40ff5a45182f3f3fc0b35e09821d8068 (patch)
tree6ac38d3471186ef12e0c608cdfc74ba74cc8e1d3 /debian
parentdc60b6a78774294793387879800a0544bc780698 (diff)
more patches
Diffstat (limited to 'debian')
-rw-r--r--debian/patches/ext2fs-simplify-expression.patch22
-rw-r--r--debian/patches/libdiskfs-default-sync-interval.patch28
-rw-r--r--debian/patches/libports-reduce-overhead.patch91
-rw-r--r--debian/patches/libports-termination-workaround.patch38
-rw-r--r--debian/patches/series7
5 files changed, 185 insertions, 1 deletions
diff --git a/debian/patches/ext2fs-simplify-expression.patch b/debian/patches/ext2fs-simplify-expression.patch
new file mode 100644
index 00000000..a8c59d7a
--- /dev/null
+++ b/debian/patches/ext2fs-simplify-expression.patch
@@ -0,0 +1,22 @@
+commit 716360ea1ad789678c0395d19b65d073546a5be5
+Author: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Sat Apr 26 12:30:06 2014 +0200
+
+ ext2fs: simplify expression
+
+ * ext2fs/pager.c (add_pager_max_prot): Simplify expression.
+
+diff --git a/ext2fs/pager.c b/ext2fs/pager.c
+index 6e99c83..9116b8c 100644
+--- a/ext2fs/pager.c
++++ b/ext2fs/pager.c
+@@ -1453,8 +1453,7 @@ diskfs_max_user_pager_prot ()
+ if (upi->type == FILE_DATA)
+ max_prot |= upi->max_prot;
+ /* Stop iterating if MAX_PROT is as filled as it's going to get. */
+- return
+- (max_prot == (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE)) ? 1 : 0;
++ return max_prot == (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
+ }
+
+ disable_caching (); /* Make any silly pagers go away. */
diff --git a/debian/patches/libdiskfs-default-sync-interval.patch b/debian/patches/libdiskfs-default-sync-interval.patch
new file mode 100644
index 00000000..d17c692b
--- /dev/null
+++ b/debian/patches/libdiskfs-default-sync-interval.patch
@@ -0,0 +1,28 @@
+commit d1ce071b40e990af1dd2ad4d980c832518c72b0a
+Author: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Sat Apr 26 13:16:23 2014 +0200
+
+ libdiskfs: set the default sync interval to 30 seconds
+
+ The default sync interval has been changed in 9e55fdd7 from 30 to 5
+ seconds. This change was not reflected in the documentation.
+
+ At least for current hardware, using 30 seconds instead of just 5
+ alleviates the thread-storm problem. Make 30 seconds the default
+ again.
+
+ * libdiskfs/priv.h (DEFAULT_SYNC_INTERVAL): Set to 30 seconds.
+
+diff --git a/libdiskfs/priv.h b/libdiskfs/priv.h
+index 4363a00..2ac3c9e 100644
+--- a/libdiskfs/priv.h
++++ b/libdiskfs/priv.h
+@@ -63,7 +63,7 @@ extern const struct argp_option diskfs_common_options[];
+ #define OPT_INHERIT_DIR_GROUP 604 /* --inherit-dir-group */
+
+ /* Common value for diskfs_common_options and diskfs_default_sync_interval. */
+-#define DEFAULT_SYNC_INTERVAL 5
++#define DEFAULT_SYNC_INTERVAL 30
+ #define DEFAULT_SYNC_INTERVAL_STRING STRINGIFY(DEFAULT_SYNC_INTERVAL)
+ #define STRINGIFY(x) STRINGIFY_1(x)
+ #define STRINGIFY_1(x) #x
diff --git a/debian/patches/libports-reduce-overhead.patch b/debian/patches/libports-reduce-overhead.patch
new file mode 100644
index 00000000..624e2672
--- /dev/null
+++ b/debian/patches/libports-reduce-overhead.patch
@@ -0,0 +1,91 @@
+commit a7c6b5d7b1b669355439361a2a8eecf52dc78538
+Author: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Sat Apr 26 12:20:20 2014 +0200
+
+ libports: reduce malloc overhead in _ports_bucket_class_iterate
+
+ _ports_bucket_class_iterate creates a snapshot of the buckets hash
+ table. This is done so that the lock protecting the hash table can be
+ released while we iterate over the snapshot.
+
+ Formerly, a linked list was used to store the snapshot. As the
+ maximal number of items is known, using an array is much simpler.
+
+ _ports_bucket_class_iterate implements both ports_bucket_iterate and
+ ports_class_iterate. For this change might make ports_class_iterate
+ less efficient memory-wise if the number of ports belonging to the
+ class is low with respect to the number of ports in the bucket.
+ However, the array representation is more compact. Furthermore a
+ survey of the Hurd code revealed that ports_class_iterate is rarely
+ used, while ports_bucket_iterate is used more often, most prominently
+ in paging code.
+
+ * libports/bucket-iterate.c (_ports_bucket_class_iterate): Use an
+ array instead of a linked list.
+
+diff --git a/libports/bucket-iterate.c b/libports/bucket-iterate.c
+index dc1c7b1..8e6bdc4 100644
+--- a/libports/bucket-iterate.c
++++ b/libports/bucket-iterate.c
+@@ -31,40 +31,45 @@ _ports_bucket_class_iterate (struct port_bucket *bucket,
+ {
+ /* This is obscenely ineffecient. ihash and ports need to cooperate
+ more closely to do it efficiently. */
+- struct item
+- {
+- struct item *next;
+- void *p;
+- } *list = 0;
+- struct item *i, *nxt;
++ void **p;
++ size_t i, n;
+ error_t err;
+
+ pthread_mutex_lock (&_ports_lock);
++
++ if (bucket->htable.nr_items == 0)
++ {
++ pthread_mutex_unlock (&_ports_lock);
++ return 0;
++ }
++
++ p = malloc (bucket->htable.nr_items * sizeof *p);
++ if (p == NULL)
++ return ENOMEM;
++
++ n = 0;
+ HURD_IHASH_ITERATE (&bucket->htable, arg)
+ {
+ struct port_info *const pi = arg;
+- struct item *j;
+
+ if (class == 0 || pi->class == class)
+ {
+- j = malloc (sizeof (struct item));
+- j->next = list;
+- j->p = pi;
+- list = j;
+ pi->refcnt++;
++ p[n] = pi;
++ n++;
+ }
+ }
+ pthread_mutex_unlock (&_ports_lock);
+
+ err = 0;
+- for (i = list; i; i = nxt)
++ for (i = 0; i < n; i++)
+ {
+ if (!err)
+- err = (*fun)(i->p);
+- ports_port_deref (i->p);
+- nxt = i->next;
+- free (i);
++ err = (*fun)(p[i]);
++ ports_port_deref (p[i]);
+ }
++
++ free (p);
+ return err;
+ }
+
diff --git a/debian/patches/libports-termination-workaround.patch b/debian/patches/libports-termination-workaround.patch
new file mode 100644
index 00000000..196ca7b0
--- /dev/null
+++ b/debian/patches/libports-termination-workaround.patch
@@ -0,0 +1,38 @@
+commit cf01d40fb9e540c21138d40b8d3d5a4d1ac683c6
+Author: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Thu Apr 17 15:43:11 2014 +0200
+
+ libports: work around bugs in server termination
+
+ Some servers use ports_manage_port_operations_one_thread to process
+ requests and terminate when it returns. Since many of them don't detach
+ before shutting down, a client may receive an error if its request
+ arrived while the server is shutting down. Prevent those spurious errors
+ by forcing ports_manage_port_operations_one_thread not to return.
+
+ This is the same change as 235491231bdd1fd93507c835767503f047e10b91
+ introduced for ports_manage_port_operations_multithread.
+
+ * libports/manage-one-thread.c
+ (ports_manage_port_operations_one_thread): Force timeout to 0.
+
+diff --git a/libports/manage-one-thread.c b/libports/manage-one-thread.c
+index 4ea740b..cbd2df7 100644
+--- a/libports/manage-one-thread.c
++++ b/libports/manage-one-thread.c
+@@ -85,7 +85,14 @@ ports_manage_port_operations_one_thread (struct port_bucket *bucket,
+
+ return status;
+ }
+-
++
++ /* XXX It is currently unsafe for most servers to terminate based on
++ inactivity because a request may arrive after a server has
++ started shutting down, causing the client to receive an error.
++ Prevent the service loop from terminating by setting TIMEOUT to
++ zero. */
++ timeout = 0;
++
+ do
+ err = mach_msg_server_timeout (internal_demuxer, 0, bucket->portset,
+ timeout ? MACH_RCV_TIMEOUT : 0, timeout);
diff --git a/debian/patches/series b/debian/patches/series
index 976e621c..25902f4e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -41,6 +41,11 @@ xkb-compat.patch
xxx-fix-build.patch
mach-defpager-protected-payload.patch
-#ext2fs-fix-inum-type.patch
+
+libdiskfs-default-sync-interval.patch
+libports-termination-workaround.patch
+libports-reduce-overhead.patch
+ext2fs-simplify-expression.patch
+ext2fs-fix-inum-type.patch
#ext2fs-cache-superblock.patch
#libpager-threading-rework.patch