[PATCH] makedumpfile: Fix a bug when multi-threads feature meets enospace

Masaki Tachibana mas-tachibana at vf.jp.nec.com
Thu Feb 15 18:45:33 PST 2018


Hi,

Atsushi Kumagai has retired, so other members will maintain makedumpfile.


Wenjian

Sorry for the late reply.
Your patch looks good to me.
I'll merge it into V1.6.4.

Thanks
tachibana


> -----Original Message-----
> From: kexec [mailto:kexec-bounces at lists.infradead.org] On Behalf Of Zhou Wenjian
> Sent: Thursday, February 08, 2018 8:53 PM
> To: kexec at lists.infradead.org
> Cc: Kumagai Atsushi() <ats-kumagai at wm.jp.nec.com>; Suzuki Keiichirou() <kei-suzuki at xr.jp.nec.com>
> Subject: Re: [PATCH] makedumpfile: Fix a bug when multi-threads feature meets enospace
> 
> ping...
> 
> 
> On 01/29/2018 08:54 PM, Zhou Wenjian wrote:
> > Currently, when multi-threads feature meets enospace error,
> > the main thread will call pthread_join(). However, there is one
> > thread doing while{} and won't stop.
> >
> >                  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);
> >
> > Then makedumpfile hangs.
> >
> > This patch add a cancel point in while{}.
> >
> > Signed-off-by: Zhou Wenjian <zhouwj.fi at gmail.com>
> > ---
> >   makedumpfile.c | 4 +++-
> >   1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/makedumpfile.c b/makedumpfile.c
> > index ed138d3..f7ad50c 100644
> > --- a/makedumpfile.c
> > +++ b/makedumpfile.c
> > @@ -7731,11 +7731,13 @@ kdump_thread_function_cyclic(void *arg) {
> >   		buf_ready = FALSE;
> >
> >   		pthread_mutex_lock(&info->page_data_mutex);
> > +		pthread_cleanup_push(pthread_mutex_unlock, &info->page_data_mutex);
> >   		while (page_data_buf[index].used != FALSE) {
> > +			pthread_testcancel();
> >   			index = (index + 1) % info->num_buffers;
> >   		}
> >   		page_data_buf[index].used = TRUE;
> > -		pthread_mutex_unlock(&info->page_data_mutex);
> > +		pthread_cleanup_pop(1);
> >
> >   		while (buf_ready == FALSE) {
> >   			pthread_testcancel();
> 
> --
> Thanks
> Zhou
> 
> 
> _______________________________________________
> kexec mailing list
> kexec at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec





More information about the kexec mailing list