Compare commits

...
Author SHA1 Message Date
Ondřej Surý 366af278e6 fixup! WIP: Rewrite qpcache to use cds_lfht 2025-03-21 01:56:48 +01:00
Ondřej Surý b508821601 WIP: Rewrite qpcache to use cds_lfht 2025-03-21 01:56:03 +01:00
3 changed files with 453 additions and 524 deletions
+6 -1
View File
@@ -32,6 +32,7 @@
#define NODE_LOCK(l, t, tp) \
{ \
STRONG_RWLOCK_CHECK(*tp == isc_rwlocktype_none); \
rcu_read_lock(); \
RWLOCK((l), (t)); \
*tp = t; \
}
@@ -39,6 +40,7 @@
{ \
STRONG_RWLOCK_CHECK(*tp != isc_rwlocktype_none); \
RWUNLOCK(l, *tp); \
rcu_read_unlock(); \
*tp = isc_rwlocktype_none; \
}
#define NODE_RDLOCK(l, tp) NODE_LOCK(l, isc_rwlocktype_read, tp);
@@ -46,10 +48,13 @@
#define NODE_TRYLOCK(l, t, tp) \
({ \
STRONG_RWLOCK_CHECK(*tp == isc_rwlocktype_none); \
rcu_read_lock(); \
isc_result_t _result = isc_rwlock_trylock(l, t); \
if (_result == ISC_R_SUCCESS) { \
*tp = t; \
}; \
} else { \
rcu_read_unlock(); \
} \
_result; \
})
#define NODE_TRYRDLOCK(l, tp) NODE_TRYLOCK(l, isc_rwlocktype_read, tp)
+26 -15
View File
@@ -43,6 +43,8 @@
#include <stdbool.h>
#include <urcu/rculfhash.h>
#include <isc/atomic.h>
#include <isc/heap.h>
#include <isc/stdtime.h>
@@ -103,22 +105,31 @@ struct dns_slabheader {
*/
union {
struct dns_slabheader *next;
struct dns_slabheader *up;
};
/*%<
* If this is the top header for an rdataset, 'next' points
* to the top header for the next rdataset (i.e., the next type).
*
* Otherwise 'up' points up to the header whose down pointer points at
* this header.
*/
struct {
struct cds_lfht_node ht_node;
struct rcu_head rcu_head;
};
struct {
union {
struct dns_slabheader *next;
struct dns_slabheader *up;
};
/*%<
* If this is the top header for an rdataset, 'next'
* points to the top header for the next rdataset (i.e.,
* the next type).
*
* Otherwise 'up' points up to the header whose down
* pointer points at this header.
*/
struct dns_slabheader *down;
/*%<
* Points to the header for the next older version of
* this rdataset.
*/
struct dns_slabheader *down;
/*%<
* Points to the header for the next older version of
* this rdataset.
*/
};
};
dns_db_t *db;
dns_dbnode_t *node;
+421 -508
View File
File diff suppressed because it is too large Load Diff