diff options
Diffstat (limited to 'debian/patches/libpager-singlethreaded.patch')
-rw-r--r-- | debian/patches/libpager-singlethreaded.patch | 67 |
1 files changed, 56 insertions, 11 deletions
diff --git a/debian/patches/libpager-singlethreaded.patch b/debian/patches/libpager-singlethreaded.patch index b515dc51..f03ba024 100644 --- a/debian/patches/libpager-singlethreaded.patch +++ b/debian/patches/libpager-singlethreaded.patch @@ -1,16 +1,42 @@ -commit 840c3b15ddf9d58cff1ce458cc3fddab3e368254 +commit 18fa27d294185abc9db774f02008f484280ddb33 Author: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Sun Apr 27 09:16:40 2014 +0200 - libpager: make libpager single-threaded + XXX libpager: make libpager single-threaded - * console/pager.c ( - * ext2fs/pager.c - * libdiskfs/disk-pager.c - * storeio/pager.c + Previously, libpager used multiple threads to service requests to + memory objects. This has proven to be problematic, as paging requests + often arrive in batches, resulting in the creation of many hundred + threads. - * libpager/Makefile: Likewise. - * libpager/chg-compl.c: Likewise. + Furthermore, the semantic of paging requests requires that the + requests to an object processed in the order the messages were + delivered. This was implemented using sequence barriers in + _pager_wait_for_seqno, _pager_release_seqno, and + _pager_update_seqno{,_p}. + + Unfortunately, this means that not only do we create too many threads, + but worse, all but one thread processing requests to an object are + asleep most of the time. + + Previous attempts to introduce a fixed upper bound on the number of + threads failed because ext2fs (fatfs) used two kinds of pagers managed + by the same thread pool. This has been fixed in XXX (YYY). + + Use a single thread to service paging requests. This removes the need + for the sequence barriers, remove that code. + + This prevents paging-related thread-storms. It also seems to actually + increase the performance of the whole system, as indicated by slightly + faster Hurd package builds. + + * console/pager.c (service_paging_requests): Use a single thread. + * ext2fs/pager.c (service_paging_requests): Likewise. + * fatfs/pager.c (service_paging_requests): Likewise. + * libdiskfs/disk-pager.c (service_paging_requests): Likewise. + * storeio/pager.c (service_paging_requests): Likewise. + * libpager/chg-compl.c: Remove calls to _pager_wait_for_seqno, + _pager_release_seqno, _pager_update_seqno, and _pager_update_seqno_p. * libpager/data-request.c: Likewise. * libpager/data-return.c: Likewise. * libpager/data-unlock.c: Likewise. @@ -21,10 +47,10 @@ Date: Sun Apr 27 09:16:40 2014 +0200 * libpager/object-init.c: Likewise. * libpager/object-terminate.c: Likewise. * libpager/pager-create.c: Likewise. - * libpager/priv.h: Likewise. - * libpager/seqnos.c: Likewise. * libpager/stubs.c: Likewise. + * libpager/priv.h (struct pager): Drop fields seqno and waitingforseqno. * libpager/seqnos.c: Remove unused file. + * libpager/Makefile (SRCS): Drop seqnos.c. diff --git a/console/pager.c b/console/pager.c index 87c36f0..e40ae45 100644 @@ -47,7 +73,7 @@ index 87c36f0..e40ae45 100644 } diff --git a/ext2fs/pager.c b/ext2fs/pager.c -index f3e9489..febde8f 100644 +index 017efcc..92e9178 100644 --- a/ext2fs/pager.c +++ b/ext2fs/pager.c @@ -1198,11 +1198,9 @@ static void * @@ -65,6 +91,25 @@ index f3e9489..febde8f 100644 /* Not reached. */ return NULL; } +diff --git a/fatfs/pager.c b/fatfs/pager.c +index f855ecf..623b8d4 100644 +--- a/fatfs/pager.c ++++ b/fatfs/pager.c +@@ -762,11 +762,9 @@ static void * + service_paging_requests (void *arg) + { + struct port_bucket *pager_bucket = arg; +- ports_manage_port_operations_multithread (pager_bucket, +- pager_demuxer, +- 1000, +- 0, +- NULL); ++ ports_manage_port_operations_one_thread (pager_bucket, ++ pager_demuxer, ++ 0); + /* Not reached. */ + return NULL; + } diff --git a/libdiskfs/disk-pager.c b/libdiskfs/disk-pager.c index 9a0d9d8..6746d4c 100644 --- a/libdiskfs/disk-pager.c |