Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2093872pxb; Wed, 9 Feb 2022 10:41:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJxSMrzQ92UQKw28ZecB2FtB837u1GbWEdyYGMYhQlVWUgIjl1PWWOsHTA47RO6I2L3LyPsb X-Received: by 2002:a17:906:e8b:: with SMTP id p11mr3168818ejf.237.1644432066261; Wed, 09 Feb 2022 10:41:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644432066; cv=none; d=google.com; s=arc-20160816; b=0a3ls1YnxrIWpDDjFf6Wg9IhLFuhLK1YCbkP7qJBiRU2nj9VfM/e8nW1F0E8GiBeDt 98+qTmMQb2hptA7z7rOMalOgxW+rX0eIVLm0P2HmHL5Y5BV/9N8Dq7J1wnoXfIfEDuth kkQqwzBX7tKDCbMsW/vpfwDpXKubN2IziYwVxU+ifNsTBbHWVhlHLTSjQsTwr/OwfNlx aebvly2ZuwRAieTw6HVV2JqmCNTq7PVT/G+hPNW4T83rG0lW3YL3JU6fElSPjBrvF8Cv 8hQRiYB6YB8jEvJoBhInyNuOnHB1HsCVaEzA2g2Gb883Sst7UMO24jXoDyAKwYWvMc3x cCww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=QoxB7339BnBkugvaYIedB66T9O8oyGrxlDFYROzaZRk=; b=SeXH/xqXG6uJhSqOK+wLB5BBoz9XuYCiASRTE4DiU+gLlEj/CzjnSFtvidOKnuEZ0Y Db42B16Ja0ZQseFOH8eLFoafkzrn1Qdas+7T80ZBRjp9hxhv2b1HFQQIZSjzIEw9lxlJ szi6Yo6VDjrqgccZFEmmFNSr97de/wX3styHXq4gNqe9J0ExKFkT1LXvOz61oH6GXMS7 Xg5ZdF4gikXre2KrY1Uo7U86MX+Vsbn6dTaahBF2upGREVNBOYzPbY2jSd70Og2bfGl8 jccDCoHA6lWT4pbYXBILr4bb+0utRf3aSytBCzZWCMdQxkp4bYvfbiXUSZgkT1prtRRf 8ldw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=rjJLLrpB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hv22si9085642ejc.346.2022.02.09.10.40.40; Wed, 09 Feb 2022 10:41:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=rjJLLrpB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237701AbiBIQ6V (ORCPT + 99 others); Wed, 9 Feb 2022 11:58:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237605AbiBIQ6G (ORCPT ); Wed, 9 Feb 2022 11:58:06 -0500 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 059BEC05CB87; Wed, 9 Feb 2022 08:58:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1644425890; x=1675961890; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=QoxB7339BnBkugvaYIedB66T9O8oyGrxlDFYROzaZRk=; b=rjJLLrpB9Gnq8IzsA+WruPIGHdYtEE4IaZHEEq9jnIdoIhJKnUK1cVV+ /RpCnLX7qYzRrX2KeF4mFxiqfvXz8E83ETXJxVZG63Tuf2SxR05nHtZbE nID/zrSVW2qZ1r8BKhwfnjYOYdrGbmfXClyQKUpOlN5Lpj0yXfaEZCoUK c=; Received: from unknown (HELO ironmsg-SD-alpha.qualcomm.com) ([10.53.140.30]) by alexa-out-sd-02.qualcomm.com with ESMTP; 09 Feb 2022 08:58:09 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg-SD-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2022 08:58:09 -0800 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Wed, 9 Feb 2022 08:58:09 -0800 Received: from lsbug.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Wed, 9 Feb 2022 08:58:07 -0800 From: Qian Cai To: Theodore Ts'o CC: Jan Kara , "Paul E. McKenney" , "Neeraj Upadhyay" , Joel Fernandes , Boqun Feng , , , , Qian Cai Subject: [RFC PATCH] jbd2: avoid __GFP_ZERO with SLAB_TYPESAFE_BY_RCU Date: Wed, 9 Feb 2022 11:57:42 -0500 Message-ID: <20220209165742.5659-1-quic_qiancai@quicinc.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since the linux-next commit 120aa5e57479 (mm: Check for SLAB_TYPESAFE_BY_RCU and __GFP_ZERO slab allocation), we will get a boot warning. Avoid it by calling synchronize_rcu() before the zeroing. Signed-off-by: Qian Cai --- fs/jbd2/journal.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index c2cf74b01ddb..323112de5921 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -2861,15 +2861,18 @@ static struct journal_head *journal_alloc_journal_head(void) #ifdef CONFIG_JBD2_DEBUG atomic_inc(&nr_journal_heads); #endif - ret = kmem_cache_zalloc(jbd2_journal_head_cache, GFP_NOFS); + ret = kmem_cache_alloc(jbd2_journal_head_cache, GFP_NOFS); if (!ret) { jbd_debug(1, "out of memory for journal_head\n"); pr_notice_ratelimited("ENOMEM in %s, retrying.\n", __func__); - ret = kmem_cache_zalloc(jbd2_journal_head_cache, + ret = kmem_cache_alloc(jbd2_journal_head_cache, GFP_NOFS | __GFP_NOFAIL); } - if (ret) + if (ret) { + synchronize_rcu(); + memset(ret, 0, sizeof(*ret)); spin_lock_init(&ret->b_state_lock); + } return ret; } -- 2.30.2