From b96186aed8c0dbde17d58a22118ab36d404aefe6 Mon Sep 17 00:00:00 2001 From: Alexey Marchuk Date: Thu, 9 Apr 2020 07:52:39 +0300 Subject: [PATCH] lib/thread: Cleanup thread structure Remove unused io_device_delete_count field Reorganize the fields so that ones used in the data path are located in the beggining of the structure and occupy 2 cache lines Signed-off-by: Alexey Marchuk Change-Id: I98e22dacb84153e6a10a6ff6d77c1c9dfb14e02b Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1803 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto --- include/spdk_internal/thread.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/include/spdk_internal/thread.h b/include/spdk_internal/thread.h index 54dd9934c..10bc4824c 100644 --- a/include/spdk_internal/thread.h +++ b/include/spdk_internal/thread.h @@ -1,8 +1,8 @@ /*- * BSD LICENSE * - * Copyright (c) Intel Corporation. - * All rights reserved. + * Copyright (c) Intel Corporation. All rights reserved. + * Copyright (c) 2020 Mellanox Technologies LTD. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -92,12 +92,6 @@ enum spdk_thread_state { }; struct spdk_thread { - TAILQ_HEAD(, spdk_io_channel) io_channels; - TAILQ_ENTRY(spdk_thread) tailq; - char name[SPDK_MAX_THREAD_NAME_LEN + 1]; - uint64_t id; - enum spdk_thread_state state; - struct spdk_cpuset cpumask; uint64_t tsc_last; struct spdk_thread_stats stats; /* @@ -117,11 +111,18 @@ struct spdk_thread { * queues) or unregistered. */ TAILQ_HEAD(paused_pollers_head, spdk_poller) paused_pollers; - uint32_t io_device_delete_count; struct spdk_ring *messages; SLIST_HEAD(, spdk_msg) msg_cache; size_t msg_cache_count; spdk_msg_fn critical_msg; + uint64_t id; + enum spdk_thread_state state; + + TAILQ_HEAD(, spdk_io_channel) io_channels; + TAILQ_ENTRY(spdk_thread) tailq; + + char name[SPDK_MAX_THREAD_NAME_LEN + 1]; + struct spdk_cpuset cpumask; uint64_t exit_timeout_tsc; /* User context allocated at the end */