makedumpfile: Fix a bug when multi-threads feature meets enospace
Subsystems (2)
PATCH 1/1 makedumpfile: Fix a bug when multi-threads feature meets enospace
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{}.
--- makedumpfile.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
makedumpfile.c +3 -1
@@ -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 ();
Signature · 7 lines
1.8.3.1 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
ping...
Quoted 39 lines · Zhou Wenjian
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 <[email protected]>--- makedumpfile.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)makedumpfile.c +3
-1@@ -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 ();
Signature · 8 lines
Thanks Zhou _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 makedumpfile: Fix a bug when multi-threads feature meets enospace
Quoted 7 lines
-----Original Message-----
From: Tachibana Masaki(橘 正樹)
Sent: Friday, February 09, 2018 8:05 PM
To: Zhou Wenjian <[email protected]>
Cc: [email protected]; Hayashi Masahiko(林 正彦) <[email protected]>
Subject: RE: [PATCH] makedumpfile: Fix a bug when multi-threads feature meets enospace
Quoted 69 lines
Hi Zhou,
Sorry for the late reply.
Makedumpfile team are busy now for another development. I'll reply in about a week.Thanks
tachibanaQuoted 60 lines
-----Original Message-----
From: kexec [mailto:[email protected]] On Behalf Of Zhou Wenjian
Sent: Thursday, February 08, 2018 8:53 PM
To: [email protected]
Cc: Kumagai Atsushi <[email protected]>; Suzuki Keiichirou <[email protected]>
Subject: Re: [PATCH] makedumpfile: Fix a bug when multi-threads feature meets enospaceping...
Quoted 29 lines · Zhou Wenjian
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 <[email protected]>--- makedumpfile.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)makedumpfile.c +1
-0@@ -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);makedumpfile.c kdump_thread_function_cyclic(void *arg) { · line 7743
Quoted 10 lines
makedumpfile.c +2
-1while (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
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Hi Zhou-san
I will forward Tachibana's mail.
Thank you
Quoted 83 lines
-----Original Message-----
From: Hayashi Masahiko(林 正彦)
Sent: Friday, February 09, 2018 8:24 PM
To: Zhou Wenjian <[email protected]>
Cc: [email protected]
Subject: FW: [PATCH] makedumpfile: Fix a bug when multi-threads feature meets enospaceQuoted 76 lines
-----Original Message-----
From: Tachibana Masaki(橘 正樹)
Sent: Friday, February 09, 2018 8:05 PM
To: Zhou Wenjian <[email protected]>
Cc: [email protected]; Hayashi Masahiko(林 正彦) <[email protected]>
Subject: RE: [PATCH] makedumpfile: Fix a bug when multi-threads feature meets enospaceHi Zhou,
Sorry for the late reply.
Makedumpfile team are busy now for another development. I'll reply in about a week.Thanks
tachibanaQuoted 60 lines
-----Original Message-----
From: kexec [mailto:[email protected]] On Behalf Of Zhou Wenjian
Sent: Thursday, February 08, 2018 8:53 PM
To: [email protected]
Cc: Kumagai Atsushi <[email protected]>; Suzuki Keiichirou <[email protected]>
Subject: Re: [PATCH] makedumpfile: Fix a bug when multi-threads feature meets enospaceping...
Quoted 29 lines · Zhou Wenjian
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 <[email protected]>--- makedumpfile.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)makedumpfile.c +1
-0@@ -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);makedumpfile.c kdump_thread_function_cyclic(void *arg) { · line 7743
Quoted 10 lines
makedumpfile.c +2
-1while (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
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
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
Quoted 56 lines
-----Original Message-----
From: kexec [mailto:[email protected]] On Behalf Of Zhou Wenjian
Sent: Thursday, February 08, 2018 8:53 PM
To: [email protected]
Cc: KumagaiAtsushi()<[email protected]>; SuzukiKeiichirou()<[email protected]>
Subject: Re: [PATCH] makedumpfile: Fix a bug when multi-threads feature meets enospaceping...
Quoted 29 lines · Zhou Wenjian
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 <[email protected]>--- makedumpfile.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)makedumpfile.c +1
-0@@ -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);makedumpfile.c kdump_thread_function_cyclic(void *arg) { · line 7743
Quoted 10 lines
makedumpfile.c +2
-1while (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
Quoted 4 lines
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Hi Tachibana,
Thanks for your reply.
And I do appreciate Kumagai-san's help these years.
Quoted 81 lines · Masaki Tachibana
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
tachibanaQuoted 55 lines
-----Original Message-----
From: kexec [mailto:[email protected]] On Behalf Of Zhou Wenjian
Sent: Thursday, February 08, 2018 8:53 PM
To: [email protected]
Cc: KumagaiAtsushi()<[email protected]>; SuzukiKeiichirou()<[email protected]>
Subject: Re: [PATCH] makedumpfile: Fix a bug when multi-threads feature meets enospaceping...
Quoted 29 lines · Zhou Wenjian
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 <[email protected]>--- makedumpfile.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)makedumpfile.c +1
-0@@ -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);makedumpfile.c kdump_thread_function_cyclic(void *arg) { · line 7743
Quoted 10 lines
makedumpfile.c +2
-1while (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
ZhouQuoted 4 lines
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Signature · 8 lines
Thanks Zhou _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec