Re: [Qemu-devel] [PATCH v6 10/15] qht: QEMU's fast, resizable and scalable Hash Table

2016-06-03 Thread Sergey Fedorov
On 03/06/16 14:01, Emilio G. Cota wrote: > On Sun, May 29, 2016 at 22:52:27 +0300, Sergey Fedorov wrote: >>> +/* >>> + * Find the last valid entry in @head, and swap it with @orig[pos], which >>> has >>> + * just been invalidated. >>> + */ >>> +static inline void qht_bucket_fill_hole(struct qht_bu

Re: [Qemu-devel] [PATCH v6 10/15] qht: QEMU's fast, resizable and scalable Hash Table

2016-06-03 Thread Sergey Fedorov
On 03/06/16 12:18, Emilio G. Cota wrote: > On Sun, May 29, 2016 at 22:52:27 +0300, Sergey Fedorov wrote: >> I was just wondering if it could be worthwhile to pass a hash function >> when initializing a QHT. Then we could have variants of qht_insert(), >> qht_remove() and qht_lookup() which does not

Re: [Qemu-devel] [PATCH v6 10/15] qht: QEMU's fast, resizable and scalable Hash Table

2016-06-03 Thread Emilio G. Cota
On Sun, May 29, 2016 at 22:52:27 +0300, Sergey Fedorov wrote: > > +/** > > + * qht_remove - remove a pointer from the hash table > > + * @ht: QHT to remove from > > + * @p: pointer to be removed > > + * @hash: hash corresponding to @p > > + * > > + * Attempting to remove a NULL @p is a bug. > > + *

Re: [Qemu-devel] [PATCH v6 10/15] qht: QEMU's fast, resizable and scalable Hash Table

2016-06-03 Thread Emilio G. Cota
On Sun, May 29, 2016 at 22:52:27 +0300, Sergey Fedorov wrote: > I was just wondering if it could be worthwhile to pass a hash function > when initializing a QHT. Then we could have variants of qht_insert(), > qht_remove() and qht_lookup() which does not require a computed hash > value but call the

Re: [Qemu-devel] [PATCH v6 10/15] qht: QEMU's fast, resizable and scalable Hash Table

2016-06-01 Thread Sergey Fedorov
On 31/05/16 10:46, Alex Bennée wrote: > Sergey Fedorov writes: > >> On 25/05/16 04:13, Emilio G. Cota wrote: >>> diff --git a/include/qemu/qht.h b/include/qemu/qht.h >>> new file mode 100644 >>> index 000..aec60aa >>> --- /dev/null >>> +++ b/include/qemu/qht.h >>> @@ -0,0 +1,183 @@ >> (snip) >

Re: [Qemu-devel] [PATCH v6 10/15] qht: QEMU's fast, resizable and scalable Hash Table

2016-05-31 Thread Alex Bennée
Sergey Fedorov writes: > On 25/05/16 04:13, Emilio G. Cota wrote: >> diff --git a/include/qemu/qht.h b/include/qemu/qht.h >> new file mode 100644 >> index 000..aec60aa >> --- /dev/null >> +++ b/include/qemu/qht.h >> @@ -0,0 +1,183 @@ > (snip) >> +/** >> + * qht_init - Initialize a QHT >> + *

Re: [Qemu-devel] [PATCH v6 10/15] qht: QEMU's fast, resizable and scalable Hash Table

2016-05-29 Thread Sergey Fedorov
On 29/05/16 22:52, Sergey Fedorov wrote: > On 25/05/16 04:13, Emilio G. Cota wrote: >> + >> +/* call with head->lock held */ >> +static bool qht_insert__locked(struct qht *ht, struct qht_map *map, >> + struct qht_bucket *head, void *p, uint32_t >> hash, >> +

Re: [Qemu-devel] [PATCH v6 10/15] qht: QEMU's fast, resizable and scalable Hash Table

2016-05-29 Thread Sergey Fedorov
On 25/05/16 04:13, Emilio G. Cota wrote: > diff --git a/include/qemu/qht.h b/include/qemu/qht.h > new file mode 100644 > index 000..aec60aa > --- /dev/null > +++ b/include/qemu/qht.h > @@ -0,0 +1,183 @@ (snip) > +/** > + * qht_init - Initialize a QHT > + * @ht: QHT to be initialized > + * @n_el

[Qemu-devel] [PATCH v6 10/15] qht: QEMU's fast, resizable and scalable Hash Table

2016-05-24 Thread Emilio G. Cota
This is a fast, scalable chained hash table with optional auto-resizing, allowing reads that are concurrent with reads, and reads/writes that are concurrent with writes to separate buckets. A hash table with these features will be necessary for the scalability of the ongoing MTTCG work; before th