Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2338922imm; Mon, 28 May 2018 06:20:12 -0700 (PDT) X-Google-Smtp-Source: AB8JxZod/JeocMo5pr3nsU4Z+yPACEswuReksf4Oo2GXpNWS/NuoxbKuJbxFjNU80cLOBMcXNZev X-Received: by 2002:a65:65ce:: with SMTP id y14-v6mr10491436pgv.270.1527513612433; Mon, 28 May 2018 06:20:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527513612; cv=none; d=google.com; s=arc-20160816; b=TxpJFVQvnaAlZHhlEzJDS4FiMjN4VfCx8p4b2YC58faOxCfDEjzP0s7AyU7D9Ucgdt 0WDK6DVtBJuvrxJ5vTiz/64EfTprYW+NK0DKVOUV7aKLKuNxpiE47Nzqx+8lKYgluoVl B5p74xKQOEtBUdVpts5NL5oUWA9SvhYIBCaofYd+euE1YRwIdso7krmUbl6B7T+du6tF 2cWmIzWzxuvXfKdr6b2VSHZRr9/Z29ZEU9jjSkIcGuP1s3fnu/B7df2GLAPo+VB0GLel pX3EvjlfaoPSEfMt0oZ9DqVazEoXoPuor4+fG+Ygl3epu1I9O+EcXejYxk3he/0KeTfB b/Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=2BgGk+YI+Uk9UgCKueEICOA9+ncVZJIiptjj8V1eYZc=; b=cylTtUug8a/zE4plYJcF/zfssWDtSUAkmdRiTJoJcjlljri2ob5yClCQYuSAnF72vp 5ZRUzBEUZmiNMCwImJ12d1CsARKvcpxfalNw5EQ1XBETqI94rWde8iDdU+n/j8go/VMT QWarz7AKxwLGphPYAZyS1eD+JKaPhJZz2x2FKl9mnYf3GnUp5KrJmkCJbDd8O/ldAnp1 acTDhOmffjr8V/D3S8pkw2u+UAxklJPDbyCKteTcrj9pfjycfKW2GdOHzDkkqiqybKSR ieREFcS5gd2jmpmRnxOJPWHCGwuo++mVgfJlQ9JS2iqnMbvYhACJoCMW/cXCxQCU5s53 mb9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Y8b8Ko8I; 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 m11-v6si29697427pls.497.2018.05.28.06.19.57; Mon, 28 May 2018 06:20:12 -0700 (PDT) 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=pass header.i=@kernel.org header.s=default header.b=Y8b8Ko8I; 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 S1425081AbeE1NTR (ORCPT + 99 others); Mon, 28 May 2018 09:19:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:39364 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163240AbeE1Ktm (ORCPT ); Mon, 28 May 2018 06:49:42 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A11C82086D; Mon, 28 May 2018 10:49:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527504582; bh=YZRVpKcNz7m3lqrAlMWhjE7QX4FL3a5VI+FBMNjxEzI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y8b8Ko8IPLmyIxoMivvM4mGZ7UPKhNknjhwkR7KvJjKrnbInedzyrHbAxPxIM3gr7 7Bc+2AN36QCd1g0VAnkuP6N3wZ+ME3rwsorOYszHGzLnApouJl39P+UDqzi7LS6UF+ l2+lzL4GfLKyC51kAbl/2haHhcA+sPQJGdJ+7XvQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jeff Mahoney , David Sterba , Sasha Levin Subject: [PATCH 4.14 191/496] btrfs: use kvzalloc to allocate btrfs_fs_info Date: Mon, 28 May 2018 11:59:36 +0200 Message-Id: <20180528100327.993313441@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100319.498712256@linuxfoundation.org> References: <20180528100319.498712256@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jeff Mahoney [ Upstream commit a8fd1f71749387c9a1053a83ff1c16287499a4e7 ] The srcu_struct in btrfs_fs_info scales in size with NR_CPUS. On kernels built with NR_CPUS=8192, this can result in kmalloc failures that prevent mounting. There is work in progress to try to resolve this for every user of srcu_struct but using kvzalloc will work around the failures until that is complete. As an example with NR_CPUS=512 on x86_64: the overall size of subvol_srcu is 3460 bytes, fs_info is 6496. Signed-off-by: Jeff Mahoney Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/ctree.h | 2 +- fs/btrfs/super.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -2969,7 +2969,7 @@ static inline void free_fs_info(struct b kfree(fs_info->super_copy); kfree(fs_info->super_for_commit); security_free_mnt_opts(&fs_info->security_opts); - kfree(fs_info); + kvfree(fs_info); } /* tree mod log functions from ctree.c */ --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -1581,7 +1581,7 @@ static struct dentry *btrfs_mount(struct * it for searching for existing supers, so this lets us do that and * then open_ctree will properly initialize everything later. */ - fs_info = kzalloc(sizeof(struct btrfs_fs_info), GFP_KERNEL); + fs_info = kvzalloc(sizeof(struct btrfs_fs_info), GFP_KERNEL); if (!fs_info) { error = -ENOMEM; goto error_sec_opts;