Hi Minoru, I guess if you change the part of locking page_data_buf to the following, it will be more correct. But I'm not sure if you will get the same problem as which in my patch v3. + pthread_mutex_lock(&info->page_data_mutex); + while (page_data_buf[index].used != FALSE) { + index = (index + 1) % info->num_buffers; + } + page_data_buf[index].used = TRUE; + pthread_mutex_unlock(&info->page_data_mutex); -- Thanks Zhou On 03/07/2016 04:52 PM, Minoru Usui wrote: > Hi, Zhou > >> -----Original Message----- >> From: kexec [mailto:kexec-bounces at lists.infradead.org] On Behalf Of "Zhou, Wenjian/???" >> Sent: Monday, March 07, 2016 5:43 PM >> To: Usui Minoru(?? ?) <min-usui at ti.jp.nec.com> >> Cc: Minfei Huang <mhuang at redhat.com>; kexec at lists.infradead.org >> Subject: Re: [PATCH v3] Improve the performance of --num-threads -d 31 >> >> Hi Minoru, >> >> I got two error dumpfiles by running it less than 100 times. > > Oh, I'm sorry. > Thank you for your test. > > I'm waiting for your v4 patch. > > Thanks > Minoru Usui > > > >> -- >> Thanks >> Zhou >> >> On 03/07/2016 04:22 PM, "Zhou, Wenjian/???" wrote: >>> Hi Minoru, >>> >>> I have test your patch since you post. >>> I can get a failure easily. >>> If you run it several times, the dumpfile it produces may be different from the correct one. >>> >>> + info->current_pfn = pfn + 1; >>> + pthread_mutex_unlock(&info->current_pfn_mutex); >>> + page_flag_buf->pfn = pfn; >>> + page_flag_buf->ready = FLAG_FILLING; >>> The above code should be changed to the following: >>> >>> + info->current_pfn = pfn + 1; >>> + page_flag_buf->pfn = pfn; >>> + page_flag_buf->ready = FLAG_FILLING; >>> + pthread_mutex_unlock(&info->current_pfn_mutex); >>> >>> I haven't run your code with the bug fixed. >>> I'll try now. >>> >>> By the way, with my patch v3, I can't get an error dumpfile until run it by 5000 times. >> >> >> >> _______________________________________________ >> kexec mailing list >> kexec at lists.infradead.org >> http://lists.infradead.org/mailman/listinfo/kexec