lkml.org 
[lkml]   [2019]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] XArray tests: allocation has to be GFP_ATOMIC under rcu_read_lock
On Tue, Jan 29, 2019 at 07:08:42PM +0800, Li RongQing wrote:
> - XA_BUG_ON(xa, xa_store_index(xa, 1, GFP_KERNEL) != NULL);
> + XA_BUG_ON(xa, xa_store_index(xa, 1, GFP_ATOMIC) != NULL);

Did you try running this change in userspace too? I don't think it'll
work.

I think the right change would be:

+++ b/lib/test_xarray.c
@@ -107,8 +107,11 @@ static noinline void check_xas_retry(struct xarray *xa)
XA_BUG_ON(xa, xas.xa_node != XAS_RESTART);
XA_BUG_ON(xa, xas_next_entry(&xas, ULONG_MAX) != xa_mk_value(0));
XA_BUG_ON(xa, xas.xa_node != NULL);
+ rcu_read_unlock();

XA_BUG_ON(xa, xa_store_index(xa, 1, GFP_KERNEL) != NULL);
+
+ rcu_read_lock();
XA_BUG_ON(xa, !xa_is_internal(xas_reload(&xas)));
xas.xa_node = XAS_RESTART;
XA_BUG_ON(xa, xas_next_entry(&xas, ULONG_MAX) != xa_mk_value(0));
\
 
 \ /
  Last update: 2019-02-03 00:20    [W:0.044 / U:1.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site