event: Repack struct spdk_reactor
Get all of the important stuff into the first cache line. Change-Id: I5bbfb031bb1d693019abb9e5145579d0b867eaf5 Signed-off-by: Ben Walker <benjamin.walker@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/465994 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com>
This commit is contained in:
parent
3cba062b86
commit
7f9c41bee0
@ -66,18 +66,21 @@ struct spdk_lw_thread {
|
||||
};
|
||||
|
||||
struct spdk_reactor {
|
||||
/* Logical core number for this reactor. */
|
||||
uint32_t lcore;
|
||||
|
||||
/* Lightweight threads running on this reactor */
|
||||
TAILQ_HEAD(, spdk_lw_thread) threads;
|
||||
|
||||
/* The last known rusage values */
|
||||
struct rusage rusage;
|
||||
/* Logical core number for this reactor. */
|
||||
uint32_t lcore;
|
||||
|
||||
struct {
|
||||
uint32_t is_valid : 1;
|
||||
uint32_t reserved : 31;
|
||||
} flags;
|
||||
|
||||
struct spdk_ring *events;
|
||||
|
||||
bool is_valid;
|
||||
/* The last known rusage values */
|
||||
struct rusage rusage;
|
||||
} __attribute__((aligned(64)));
|
||||
|
||||
static struct spdk_reactor *g_reactors;
|
||||
@ -92,7 +95,7 @@ static void
|
||||
spdk_reactor_construct(struct spdk_reactor *reactor, uint32_t lcore)
|
||||
{
|
||||
reactor->lcore = lcore;
|
||||
reactor->is_valid = true;
|
||||
reactor->flags.is_valid = true;
|
||||
|
||||
TAILQ_INIT(&reactor->threads);
|
||||
|
||||
@ -112,7 +115,7 @@ spdk_reactor_get(uint32_t lcore)
|
||||
|
||||
reactor = &g_reactors[lcore];
|
||||
|
||||
if (reactor->is_valid == false) {
|
||||
if (reactor->flags.is_valid == false) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user