From 1dbf68c21a2bbc7b454c1a742c1e3ff00bb85829 Mon Sep 17 00:00:00 2001 From: Zhou Wenjian Date: Fri, 18 Mar 2016 13:36:57 +0800 Subject: [PATCH] remove sem --- makedumpfile.c | 8 ++++---- makedumpfile.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/makedumpfile.c b/makedumpfile.c index 2b0864a..8de5e1d 100644 --- a/makedumpfile.c +++ b/makedumpfile.c @@ -7211,7 +7211,7 @@ kdump_thread_function_cyclic(void *arg) { page_flag_buf->pfn = pfn; page_flag_buf->ready = FLAG_FILLING; pthread_mutex_unlock(&info->current_pfn_mutex); - sem_post(&info->page_flag_buf_sem); +// sem_post(&info->page_flag_buf_sem); if (pfn >= cycle->end_pfn) { info->current_pfn = cycle->end_pfn; @@ -7370,7 +7370,7 @@ write_kdump_pages_parallel_cyclic(struct cache_data *cd_header, page_buf_num = info->num_buffers; page_data_buf = info->page_data_buf; pthread_mutex_init(&info->page_data_mutex, NULL); - sem_init(&info->page_flag_buf_sem, 0, 0); +// sem_init(&info->page_flag_buf_sem, 0, 0); for (i = 0; i < page_buf_num; i++) page_data_buf[i].used = FALSE; @@ -7405,7 +7405,7 @@ write_kdump_pages_parallel_cyclic(struct cache_data *cd_header, * The main thread is the consumer. It will find the next pfn and write it into file. * The next pfn is smallest pfn in all page_flag_buf. */ - sem_wait(&info->page_flag_buf_sem); +// sem_wait(&info->page_flag_buf_sem); gettimeofday(&last, NULL); while (1) { current_pfn = end_pfn; @@ -7532,7 +7532,7 @@ out: } } - sem_destroy(&info->page_flag_buf_sem); +// sem_destroy(&info->page_flag_buf_sem); pthread_rwlock_destroy(&info->usemmap_rwlock); pthread_mutex_destroy(&info->filter_mutex); pthread_mutex_destroy(&info->current_pfn_mutex); diff --git a/makedumpfile.h b/makedumpfile.h index 4b315c0..7627286 100644 --- a/makedumpfile.h +++ b/makedumpfile.h @@ -44,7 +44,7 @@ #include "print_info.h" #include "sadump_mod.h" #include -#include +//#include /* * Result of command @@ -1302,7 +1302,7 @@ struct DumpInfo { struct thread_args *kdump_thread_args; struct page_data *page_data_buf; struct page_flag **page_flag_buf; - sem_t page_flag_buf_sem; +// sem_t page_flag_buf_sem; pthread_rwlock_t usemmap_rwlock; mdf_pfn_t current_pfn; pthread_mutex_t current_pfn_mutex; -- 1.8.3.1