Hi Erick!
Posting my answers to your questions to the public bug-hurd@gnu.org
mailing list,
http://www.gnu.org/software/hurd/mailing_lists/bug-hurd.html, so that
others can join the discussions and/or learn from the answers given.
On Wed, 07 May 2014 23:49:19 -0500, Erick Mendoza
* libtrivfs/trivfs.h (struct trivfs_peropen): Use refcount_t for field
refcnt.
(struct trivfs_control): Remove unused field lock.
* libtrivfs/cntl-create.c (trivfs_create_control): Drop the mutex
initialization.
* libtrivfs/io-reauthenticate.c (trivfs_S_io_reauthenticate): Adjust
accordingly.
*
* libports/ports.h (struct port_info): Use the new type.
* libports/lookup-port.c: No need to lock _ports_lock anymore.
* libports/bucket-iterate.c: Likewise.
* libports/complete-deallocate.c: Check if someone reacquired a
reference through a hash table lookup.
* libports/create-internal.c: Use
Previously, the superblock was mmaped and a pointer stored in sblock
by map_hypermetadata. This memory is backed by our disk pager.
This is rather unfortunate, as this means that whenever we read a
value from that location, we might generate a request our disk pager.
This amplifies the so-called
* ext2fs/pager.c (enable_caching, disable_caching): Iterate over the
pager class instead of over both pager buckets.
---
ext2fs/pager.c | 6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/ext2fs/pager.c b/ext2fs/pager.c
index 017efcc..6328f3b 100644
--- a/ext2fs/pager.c
+++
Previously, libports used a hash table per port bucket. This makes
looking up a port difficult if one does not know the port bucket, as
one has to iterate over all buckets and do a hash table lookup each.
Having to iterate over the buckets makes it necessary to keep a list
of all buckets, which
* fatfs/pager.c (enable_caching, disable_caching): Iterate over the
pager class instead of over both pager buckets.
---
fatfs/pager.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/fatfs/pager.c b/fatfs/pager.c
index f855ecf..7aa5c5e 100644
--- a/fatfs/pager.c
+++
libihash uses open addressing. Previously, quadratic probing in both
directions was used to resolve collisions. Quadratic probing might
result in a less efficient use of caches.
Also, prime numbers of the form 4 * i + 3 were used as array sizes.
This was used in combination with the integer
* libihash/ihash.h (HURD_IHASH_MAX_LOAD_DEFAULT): Set to 75.
---
libihash/ihash.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libihash/ihash.h b/libihash/ihash.h
index 3ca5ec3..6bdc925 100644
--- a/libihash/ihash.h
+++ b/libihash/ihash.h
@@ -94,7 +94,7 @@ typedef struct
* include/refcount.h: New file.
---
include/refcount.h | 174 +
1 file changed, 174 insertions(+)
create mode 100644 include/refcount.h
diff --git a/include/refcount.h b/include/refcount.h
new file mode 100644
index 000..0a9ed8e
---
Well, why? :)
Justus Winter, le Mon 12 May 2014 12:05:46 +0200, a écrit :
* libihash/ihash.h (HURD_IHASH_MAX_LOAD_DEFAULT): Set to 75.
---
libihash/ihash.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libihash/ihash.h b/libihash/ihash.h
index 3ca5ec3..6bdc925 100644
The performance of hash tables depend critically on a low number of
hash collisions. As the table fills up, the chance of collisions
necessarily raises.
Previously, libihash resized the hash table when the load exceeded
80%. This seems a bit optimistic (e. g. java.util.Hashtable uses 75%
as
Justus Winter, le Mon 12 May 2014 12:35:08 +0200, a écrit :
The performance of hash tables depend critically on a low number of
hash collisions. As the table fills up, the chance of collisions
necessarily raises.
Previously, libihash resized the hash table when the load exceeded
80%. This
Justus Winter, le Mon 12 May 2014 12:05:39 +0200, a écrit :
Previously, the superblock was mmaped and a pointer stored in sblock
by map_hypermetadata. This memory is backed by our disk pager.
This is rather unfortunate, as this means that whenever we read a
value from that location, we
Justus Winter, le Mon 12 May 2014 12:05:41 +0200, a écrit :
+ const union _references op = { .refs = { .hard = 1 } };
+ refcounts_t r = __atomic_add_fetch (ref, op.rc, __ATOMIC_RELAXED);
Mmm, I don't think it is allowed by C to write into a field and read
from another field. The legacy Hurd
Justus Winter, le Mon 12 May 2014 12:05:42 +0200, a écrit :
- pthread_mutex_lock (_ports_lock);
pthread_mutex_lock (_ports_htable_lock);
if (_ports_htable.nr_items == 0)
@@ -60,13 +59,12 @@ _ports_bucket_class_iterate (struct port_bucket *bucket,
if ((bucket == NULL ||
On Tue, May 13, 2014 at 12:23:48AM +0200, Samuel Thibault wrote:
Justus Winter, le Mon 12 May 2014 12:05:41 +0200, a écrit :
+ const union _references op = { .refs = { .hard = 1 } };
+ refcounts_t r = __atomic_add_fetch (ref, op.rc, __ATOMIC_RELAXED);
Mmm, I don't think it is allowed by
Justus Winter, le Mon 12 May 2014 12:05:48 +0200, a écrit :
* ext2fs/pager.c (enable_caching, disable_caching): Iterate over the
pager class instead of over both pager buckets.
Mmm, did you check the actual implementation of ports_class_iterate?
It seems that it just iterates over one bucket,
Justus Winter, le Mon 12 May 2014 12:05:49 +0200, a écrit :
* fatfs/pager.c (enable_caching, disable_caching): Iterate over the
pager class instead of over both pager buckets.
Ditto.
---
fatfs/pager.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git
Richard Braun, le Tue 13 May 2014 00:36:44 +0200, a écrit :
On Tue, May 13, 2014 at 12:23:48AM +0200, Samuel Thibault wrote:
Justus Winter, le Mon 12 May 2014 12:05:41 +0200, a écrit :
+ const union _references op = { .refs = { .hard = 1 } };
+ refcounts_t r = __atomic_add_fetch (ref,
Samuel Thibault, le Tue 13 May 2014 00:37:37 +0200, a écrit :
Justus Winter, le Mon 12 May 2014 12:05:48 +0200, a écrit :
* ext2fs/pager.c (enable_caching, disable_caching): Iterate over the
pager class instead of over both pager buckets.
Mmm, did you check the actual implementation of
Justus Winter, le Mon 12 May 2014 12:05:40 +0200, a écrit :
Previously, libports used a hash table per port bucket. This makes
looking up a port difficult if one does not know the port bucket, as
one has to iterate over all buckets and do a hash table lookup each.
But conversely, this makes
Justus Winter, le Mon 12 May 2014 12:05:41 +0200, a écrit :
+/* An opaque type. You must not access these values directly. */
+typedef uint64_t refcounts_t;
+
+/* Instead, the functions manipulating refcounts_t values write the
+ results into this kind of objects. */
+struct references
23 matches
Mail list logo