From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD542C2D0A3 for ; Wed, 4 Nov 2020 02:36:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8485622264 for ; Wed, 4 Nov 2020 02:36:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="wHXo56TL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729958AbgKDCgP (ORCPT ); Tue, 3 Nov 2020 21:36:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728582AbgKDCgP (ORCPT ); Tue, 3 Nov 2020 21:36:15 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB5BEC061A4D; Tue, 3 Nov 2020 18:36:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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; bh=hx1MzWTXdeEOxgEkbR+wZtVBswYPWYPzzP51xACphZ8=; b=wHXo56TLGfXXsvN4PGIA7lqw1L mlc2SznGv7CFGKAMLwOc0i5Lz/H1P3HznLlV9ambuv03R0MCBafKRUSRe8gdLAlxBkVcPU79kTJBP +mUtdmocJcUsakQQxxKwrvXN1K1Db6Ke3eV6xH8L0Yijnt/cr+o7x5QkMtOWydK1LmtWeZuwWH63Z 9f4ZvCbP4odCFBBwP5wyZpbL61BusKMmnYgxIWMD+FkrdQGCzFFUvMYkcIG2XvEx4XsGK9hqC/sTW LeljmphmCrtR7UTSGPOfGj/ihC/XECI2l5rKqE4yg2uKQ4sccJUqN5MdIxkLpsmfjlV9EILQTy0lS Gy7Oh96A==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1ka8ee-0002tw-El; Wed, 04 Nov 2020 02:36:08 +0000 Date: Wed, 4 Nov 2020 02:36:08 +0000 From: Matthew Wilcox To: "xiaofeng.yan" Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, dledford@redhat.com, jgg@ziepe.ca, oulijun@huawei.com, yanxiaofeng7@jd.com Subject: Re: [PATCH 1/2] [xarry]:Fixed an issue with memory allocated using the GFP_KERNEL flag in spinlocks Message-ID: <20201104023608.GK27442@casper.infradead.org> References: <20201104023213.760-1-xiaofeng.yan2012@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201104023213.760-1-xiaofeng.yan2012@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 04, 2020 at 10:32:12AM +0800, xiaofeng.yan wrote: > xa_lock_irq(xa); > - curr = __xa_store(xa, index, entry, gfp); > + curr = __xa_store(xa, index, entry, GFP_ATOMIC); > xa_unlock_irq(xa); You haven't actually seen a bug, have you? You just read the code wrongly. void *__xa_store(struct xarray *xa, unsigned long index, void *entry, gfp_t gfp) ... } while (__xas_nomem(&xas, gfp)); ... if (gfpflags_allow_blocking(gfp)) { xas_unlock_type(xas, lock_type); xas->xa_alloc = kmem_cache_alloc(radix_tree_node_cachep, gfp); xas_lock_type(xas, lock_type);