Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp2145339ima; Sat, 2 Feb 2019 15:20:22 -0800 (PST) X-Google-Smtp-Source: ALg8bN5Nju9y4i+tof9EHs07ZtZg8UoienDOYVoqkU0++mmWEbvGPppKJljLjc/Ij4HVs4+jp0KE X-Received: by 2002:a62:5658:: with SMTP id k85mr44822635pfb.231.1549149622352; Sat, 02 Feb 2019 15:20:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549149622; cv=none; d=google.com; s=arc-20160816; b=ER7QZlU3GHlFIuAufcIU7t7bgJSBss1xPiBrSr5fXopRFdwUNsb/6dyF5N/cuQBNdn PzfeREJIoHKJZxiNFre1Dly+s6lZvSX0y4AwQ52S0s9jeVDIINOk4O9N5xdelntL+tJx EDVNFkntUEFkKuXgCTLFMlZinJF681RLE+qJfFCr4Q1CKv0KIVu2+gVhIX1aTd7vPuQQ ySS2VMVIV7OVaygAelo6FRR/FovVzP6BEJ9XiOCJvXDbzkkkCloaxUes8MEf5xD+z2Vy tgroBpjW5b9ISGLT94TcV0SABKW2bXLm45dCSDUXg5TIZSuruc98AFkDXdvi85Fj2cn5 kC4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=QHfuQxucmqZgc7hoYtVZKtpcSP8kkrGOwNmfYkDUJsc=; b=Hib3p3YB0V8j0fx264pdexuvS4vqMsX+4FlaTZ5zr4RAZ6N1+Ah6NpQkV9prO6l7Al OvIYCksenyaB+OzaNGJ04Uv/bXAzAY6dkCfrQ4tjE8uKT4eBdrfYfti6yVqy4QwlUchM 62yK67HTWlZslf039MmTRqH/8JaGZv88QVn6qq5z6E1EMMbOvYCb7VGh0yBy+RSqOyCo W60CocLhepxnGiXm5tbrK6PXSSP2teoUonl43zmKFmkvdDxPl+oXmTACK1k1u9WNSz5l 1ZEb8spGORLCYiiBJInsA++3Z0M1ARzhH00APFOXJTrnJm51Cu7JHY74h99HFAEcA30Q GXEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=aEcIDTtd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r207si12465543pfc.179.2019.02.02.15.19.54; Sat, 02 Feb 2019 15:20:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=aEcIDTtd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727088AbfBBXTs (ORCPT + 99 others); Sat, 2 Feb 2019 18:19:48 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:44258 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726945AbfBBXTr (ORCPT ); Sat, 2 Feb 2019 18:19:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=QHfuQxucmqZgc7hoYtVZKtpcSP8kkrGOwNmfYkDUJsc=; b=aEcIDTtdLtmcbOHo0b7nxVxOW OHPf0/ol77FLmDKqbIFyLdKvyUS130MXyBnGWA1noOB/lv4vkgMcqamfPpt1NWAX4Mk9kudb+MQsM 2h1bxdRtH6xdevg/dW/5foVotZt9XsZa2BnRBrvMQbMpuFPAI4tLCVemIFBoHUjOh4azYZpyYrhBZ oRKnUxCmDcAAZOwU4Vlwo2erNbuTdQk5K3xNEt3c1oq+v5Gn4/yEEIn0GK6GN5BBemF4uKi7A8EUt t1UvTmk7UiCQqE1i3sx0DCp4kEudF75rswMq3+FjBDZaNOZAXA+WaCpSuffZl9g09QNnzxaNJaG2/ pF4dwPHAA==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gq4Zc-0006Im-UH; Sat, 02 Feb 2019 23:19:44 +0000 Date: Sat, 2 Feb 2019 15:19:44 -0800 From: Matthew Wilcox To: Li RongQing Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] XArray tests: allocation has to be GFP_ATOMIC under rcu_read_lock Message-ID: <20190202231944.GB13285@bombadil.infradead.org> References: <1548760122-13000-1-git-send-email-lirongqing@baidu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1548760122-13000-1-git-send-email-lirongqing@baidu.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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));