Commit b96186ae authored by Alexey Marchuk's avatar Alexey Marchuk Committed by Tomasz Zawadzki
Browse files

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: default avatarAlexey Marchuk <alexeymar@mellanox.com>
Change-Id: I98e22dacb84153e6a10a6ff6d77c1c9dfb14e02b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1803


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 237ef4c6
Loading
Loading
Loading
Loading
+10 −9
Original line number Diff line number Diff line
/*-
 *   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 */