linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] XArray tests: allocation has to be GFP_ATOMIC under rcu_read_lock
@ 2019-01-29 11:08 Li RongQing
  2019-02-02 23:19 ` Matthew Wilcox
  0 siblings, 1 reply; 4+ messages in thread
From: Li RongQing @ 2019-01-29 11:08 UTC (permalink / raw)
  To: linux-kernel, willy

Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
 lib/test_xarray.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/test_xarray.c b/lib/test_xarray.c
index c596a957f764..5b671c83b73d 100644
--- a/lib/test_xarray.c
+++ b/lib/test_xarray.c
@@ -108,7 +108,7 @@ static noinline void check_xas_retry(struct xarray *xa)
 	XA_BUG_ON(xa, xas_next_entry(&xas, ULONG_MAX) != xa_mk_value(0));
 	XA_BUG_ON(xa, xas.xa_node != NULL);
 
-	XA_BUG_ON(xa, xa_store_index(xa, 1, GFP_KERNEL) != NULL);
+	XA_BUG_ON(xa, xa_store_index(xa, 1, GFP_ATOMIC) != NULL);
 	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));
-- 
2.16.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] XArray tests: allocation has to be GFP_ATOMIC under rcu_read_lock
  2019-01-29 11:08 [PATCH] XArray tests: allocation has to be GFP_ATOMIC under rcu_read_lock Li RongQing
@ 2019-02-02 23:19 ` Matthew Wilcox
  2019-02-11  3:55   ` 答复: " Li,Rongqing
  0 siblings, 1 reply; 4+ messages in thread
From: Matthew Wilcox @ 2019-02-02 23:19 UTC (permalink / raw)
  To: Li RongQing; +Cc: linux-kernel

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));


^ permalink raw reply	[flat|nested] 4+ messages in thread

* 答复: [PATCH] XArray tests: allocation has to be GFP_ATOMIC under rcu_read_lock
  2019-02-02 23:19 ` Matthew Wilcox
@ 2019-02-11  3:55   ` Li,Rongqing
  2019-02-11  4:19     ` Matthew Wilcox
  0 siblings, 1 reply; 4+ messages in thread
From: Li,Rongqing @ 2019-02-11  3:55 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: linux-kernel



> -----邮件原件-----
> 发件人: Matthew Wilcox [mailto:willy@infradead.org]
> 发送时间: 2019年2月3日 7:20
> 收件人: Li,Rongqing <lirongqing@baidu.com>
> 抄送: linux-kernel@vger.kernel.org
> 主题: Re: [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:
> 

Could you send this patch?

Thanks

-Li RongQing 


> +++ 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));


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 答复: [PATCH] XArray tests: allocation has to be GFP_ATOMIC under rcu_read_lock
  2019-02-11  3:55   ` 答复: " Li,Rongqing
@ 2019-02-11  4:19     ` Matthew Wilcox
  0 siblings, 0 replies; 4+ messages in thread
From: Matthew Wilcox @ 2019-02-11  4:19 UTC (permalink / raw)
  To: Li,Rongqing; +Cc: linux-kernel

On Mon, Feb 11, 2019 at 03:55:53AM +0000, Li,Rongqing wrote:
> Could you send this patch?

I put it in
http://git.infradead.org/users/willy/linux-dax.git/shortlog/refs/heads/xarray
which is included in linux-next.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-02-11  4:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-29 11:08 [PATCH] XArray tests: allocation has to be GFP_ATOMIC under rcu_read_lock Li RongQing
2019-02-02 23:19 ` Matthew Wilcox
2019-02-11  3:55   ` 答复: " Li,Rongqing
2019-02-11  4:19     ` Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).