lkml.org 
[lkml]   [2016]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH] sched: Avoid that __wait_on_bit_lock() hangs
From
Date
On 08/10/2016 03:46 AM, Oleg Nesterov wrote:
> OK. Could you try another debugging patch below?
>
> Oleg.
> ---
>
> diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
> index e5a3244..9d5f892 100644
> --- a/include/linux/page-flags.h
> +++ b/include/linux/page-flags.h
> @@ -711,6 +711,15 @@ static inline int page_has_private(struct page *page)
> return !!(page->flags & PAGE_FLAGS_PRIVATE);
> }
>
> +void unlock_page(struct page *page);
> +static inline void __ClearPageLocked_x(struct page *page)
> +{
> + if (PageLocked(compound_head(page)))
> + unlock_page(page);
> +}
> +
> +#define __ClearPageLocked(page) __ClearPageLocked_x(page)
> +
> #undef PF_ANY
> #undef PF_HEAD
> #undef PF_NO_TAIL

Hi Oleg,

Are you sure that all __ClearPageLocked() users pass the compound head
to that macro? How about testing the patch below instead?

Thanks,

Bart.

---
include/linux/page-flags.h | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index e5a3244..10d8e63 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -711,6 +711,17 @@ static inline int page_has_private(struct page *page)
return !!(page->flags & PAGE_FLAGS_PRIVATE);
}

+void unlock_page(struct page *page);
+static inline void __ClearPageLocked_x(struct page *page)
+{
+ if (PageLocked(compound_head(page)))
+ unlock_page(page);
+ else
+ __ClearPageLocked(page);
+}
+
+#define __ClearPageLocked(page) __ClearPageLocked_x(page)
+
#undef PF_ANY
#undef PF_HEAD
#undef PF_NO_TAIL
--
2.9.2

\
 
 \ /
  Last update: 2016-08-10 21:21    [W:0.103 / U:9.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site