win-pvdrivers

annotate liblfds.6/src/single_dir_for_windows_kernel/stack_internal.h @ 1106:2d392ecdd366

Fix race is xenvbd causing 30 second freeze under high load
author James Harper <james.harper@bendigoit.com.au>
date Tue Nov 11 23:08:11 2014 +1100 (2014-11-11)
parents 6300617040e0
children
rev   line source
james@766 1 /***** the library wide include file *****/
james@766 2 #include "liblfds_internal.h"
james@766 3
james@766 4 /***** pragmas *****/
james@766 5
james@766 6 /***** defines *****/
james@766 7 #define STACK_POINTER 0
james@766 8 #define STACK_COUNTER 1
james@766 9 #define STACK_PAC_SIZE 2
james@766 10
james@766 11 /***** structures *****/
james@766 12 #pragma pack( push, ALIGN_DOUBLE_POINTER )
james@766 13
james@766 14 struct stack_state
james@766 15 {
james@766 16 // TRD : must come first for alignment
james@766 17 struct stack_element
james@766 18 *volatile top[STACK_PAC_SIZE];
james@766 19
james@766 20 atom_t
james@766 21 aba_counter;
james@766 22
james@766 23 struct freelist_state
james@766 24 *fs;
james@766 25 };
james@766 26
james@766 27 struct stack_element
james@766 28 {
james@766 29 struct stack_element
james@766 30 *next[STACK_PAC_SIZE];
james@766 31
james@766 32 struct freelist_element
james@766 33 *fe;
james@766 34
james@766 35 void
james@766 36 *user_data;
james@766 37 };
james@766 38
james@766 39 #pragma pack( pop )
james@766 40
james@766 41 /***** private prototypes *****/
james@766 42 int stack_internal_freelist_init_function( void **user_data, void *user_state );
james@766 43 void stack_internal_freelist_delete_function( void *user_data, void *user_state );
james@766 44
james@766 45 void stack_internal_new_element_from_freelist( struct stack_state *ss, struct stack_element *se[STACK_PAC_SIZE], void *user_data );
james@766 46 void stack_internal_new_element( struct stack_state *ss, struct stack_element *se[STACK_PAC_SIZE], void *user_data );
james@766 47 void stack_internal_init_element( struct stack_state *ss, struct stack_element *se[STACK_PAC_SIZE], struct freelist_element *fe, void *user_data );
james@766 48
james@766 49 void stack_internal_push( struct stack_state *ss, struct stack_element *se[STACK_PAC_SIZE] );
james@766 50