From patchwork Fri Sep 16 12:09:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirill A . Shutemov" X-Patchwork-Id: 9335623 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8057F60839 for ; Fri, 16 Sep 2016 12:09:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72B3729F6E for ; Fri, 16 Sep 2016 12:09:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6765729F76; Fri, 16 Sep 2016 12:09:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1975629F6E for ; Fri, 16 Sep 2016 12:09:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934815AbcIPMJK (ORCPT ); Fri, 16 Sep 2016 08:09:10 -0400 Received: from mga04.intel.com ([192.55.52.120]:21721 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757003AbcIPMJJ (ORCPT ); Fri, 16 Sep 2016 08:09:09 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP; 16 Sep 2016 05:09:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,344,1470726000"; d="scan'208";a="1051774680" Received: from unknown (HELO black.fi.intel.com) ([10.237.72.56]) by orsmga002.jf.intel.com with ESMTP; 16 Sep 2016 05:09:04 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 4404310D; Fri, 16 Sep 2016 15:09:03 +0300 (EEST) Date: Fri, 16 Sep 2016 15:09:03 +0300 From: "Kirill A. Shutemov" To: Theodore Ts'o , Andreas Dilger , Jan Kara , Andrew Morton Cc: Alexander Viro , Hugh Dickins , Andrea Arcangeli , Dave Hansen , Vlastimil Babka , Matthew Wilcox , Ross Zwisler , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-block@vger.kernel.org Subject: Re: [PATCHv3 19/41] block: define BIO_MAX_PAGES to HPAGE_PMD_NR if huge page cache enabled Message-ID: <20160916120903.GB72667@black.fi.intel.com> References: <20160915115523.29737-1-kirill.shutemov@linux.intel.com> <20160915115523.29737-20-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160915115523.29737-20-kirill.shutemov@linux.intel.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Sep 15, 2016 at 02:55:01PM +0300, Kirill A. Shutemov wrote: > We are going to do IO a huge page a time. So we need BIO_MAX_PAGES to be > at least HPAGE_PMD_NR. For x86-64, it's 512 pages. 0-DAY reported this: [ 2.555776] PCI: Using configuration type 1 for base access [ 2.870504] HugeTLB registered 2 MB page size, pre-allocated 0 pages [ 2.885252] ------------[ cut here ]------------ [ 2.887501] WARNING: CPU: 0 PID: 1 at mm/slab_common.c:98 kmem_cache_create+0xbc/0x18b [ 2.891987] Modules linked in: [ 2.893538] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.8.0-rc6-00021-gd96a38d #421 [ 2.897164] 00000000 00200246 cef0decc c141aa9e 00000000 c11279b6 cef0dee4 c104990a [ 2.908396] 00000062 c1a820f0 c1b752f4 c1999b09 cef0def8 c104999c 00000009 00000000 [ 2.912555] 00000000 cef0df1c c11279b6 00000000 c1999afe 00001800 6bc01ac0 c1b3d0bc [ 2.916733] Call Trace: [ 2.930981] [] dump_stack+0x74/0xa7 [ 2.933128] [] ? kmem_cache_create+0xbc/0x18b [ 2.935630] [] __warn+0xbc/0xd3 [ 2.937586] [] ? x509_key_init+0xf/0xf [ 2.939837] [] warn_slowpath_null+0x16/0x1b [ 2.942279] [] kmem_cache_create+0xbc/0x18b [ 2.957745] [] ? x509_key_init+0xf/0xf [ 2.960010] [] init_bio+0x58/0x94 [ 2.962048] [] do_one_initcall+0x83/0x103 [ 2.964428] [] ? parse_args+0x1c9/0x29c [ 2.966725] [] ? kernel_init_freeable+0x16f/0x20c [ 2.969400] [] kernel_init_freeable+0x18f/0x20c [ 2.994076] [] kernel_init+0xd/0xd5 [ 2.996185] [] ret_from_kernel_thread+0xe/0x30 [ 2.998748] [] ? rest_init+0xa6/0xa6 [ 3.000968] ---[ end trace 197bc755366f9a86 ]--- [ 3.021244] ACPI: Added _OSI(Module Device) Fix up: diff --git a/block/bio.c b/block/bio.c index aa7354088008..a06bf174cddf 100644 --- a/block/bio.c +++ b/block/bio.c @@ -44,7 +44,8 @@ */ #define BV(x) { .nr_vecs = x, .name = "biovec-"__stringify(x) } static struct biovec_slab bvec_slabs[BVEC_POOL_NR] __read_mostly = { - BV(1), BV(4), BV(16), BV(64), BV(128), BV(BIO_MAX_PAGES), + BV(1), BV(4), BV(16), BV(64), BV(128), + { .nr_vecs = BIO_MAX_PAGES, .name ="biovec-max_pages" }, }; #undef BV