From patchwork Thu May 10 20:07:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laura Abbott X-Patchwork-Id: 8523 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 5D25423E9A for ; Thu, 10 May 2012 20:07:50 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id 279E4A18845 for ; Thu, 10 May 2012 20:07:50 +0000 (UTC) Received: by mail-yx0-f180.google.com with SMTP id q6so2382190yen.11 for ; Thu, 10 May 2012 13:07:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :x-ironport-av:message-id:date:from:user-agent:mime-version:to :subject:x-beenthere:x-mailman-version:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :content-transfer-encoding:content-type:sender:errors-to :x-gm-message-state; bh=AasBYdHmnk57W8ZLtd9s/omAbuI500hjY3cQhS0wN6I=; b=m0jpIemQ0FJZCFKbyeF7PK+88BgDMptw/GTri+IxDZwE5npQwYBuXa41AE+4ezzL5g ZSIwvEw4t6ll1Yg10Zh2X8b/smPfOYupq9BAuDTUgLiLR32+sC92sPZScHktrRCGnmUM qEDmuOf/8NNod8a1nq8MMaP14hshJTbhLwmW44EH6kV+14JiJ3jF/RQaAI8P7qhCdZCi p2ZdMX4s8AiuYw7e+N3JaxB+cgLfJQdXH4IvWIzWsqoZS9wp/W+8L+p1V6DS7gmmchWW mglTTK/gxo3bex+uw1/HCs3iPM3LB2CNehQ6X+FqWQ1VsyOQ7hsb2D7RjWeJyJCn+zoz Hk3Q== Received: by 10.42.122.76 with SMTP id m12mr1248021icr.38.1336680469583; Thu, 10 May 2012 13:07:49 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.73.147 with SMTP id q19csp123546ibj; Thu, 10 May 2012 13:07:48 -0700 (PDT) Received: by 10.204.143.140 with SMTP id v12mr3445348bku.98.1336680467814; Thu, 10 May 2012 13:07:47 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id gu13si6140419bkc.79.2012.05.10.13.07.46; Thu, 10 May 2012 13:07:47 -0700 (PDT) Received-SPF: neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) client-ip=91.189.95.16; Authentication-Results: mx.google.com; spf=neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) smtp.mail=linaro-mm-sig-bounces@lists.linaro.org Received: from localhost ([127.0.0.1] helo=mombin.canonical.com) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SSZeK-0001Mz-90; Thu, 10 May 2012 20:07:44 +0000 Received: from wolverine01.qualcomm.com ([199.106.114.254]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SSZeJ-0001MM-Ib for linaro-mm-sig@lists.linaro.org; Thu, 10 May 2012 20:07:43 +0000 X-IronPort-AV: E=McAfee;i="5400,1158,6707"; a="189663205" Received: from pdmz-css-vrrp.qualcomm.com (HELO mostmsg01.qualcomm.com) ([199.106.114.130]) by wolverine01.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 10 May 2012 13:07:41 -0700 Received: from [10.46.166.175] (pdmz-snip-v218.qualcomm.com [192.168.218.1]) by mostmsg01.qualcomm.com (Postfix) with ESMTPA id 3B28210004CA; Thu, 10 May 2012 13:07:41 -0700 (PDT) Message-ID: <4FAC200D.2080306@codeaurora.org> Date: Thu, 10 May 2012 13:07:41 -0700 From: Laura Abbott User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120420 Thunderbird/12.0 MIME-Version: 1.0 To: linaro-mm-sig@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Marek Szyprowski , Michal Nazarewicz Subject: [Linaro-mm-sig] Bad use of highmem with buffer_migrate_page? X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Unified memory management interest group." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQmdbkPE7GtbWzrHdilIagjC+iK03/E+5q3yeyjk1f7zBKROh5CAsvJGSlkQX5LVTxJ8a7NR Hi, I did a backport of the Contiguous Memory Allocator to a 3.0.8 tree. I wrote fairly simple test case that, in 1MB chunks, allocs up to 40MB from a reserved area, maps, writes, unmaps and then frees in an infinite loop. When running this with another program in parallel to put some stress on the filesystem, I hit data aborts in the filesystem/journal layer, although not always the same backtrace. As an example: [] (__ext4_check_dir_entry+0x20/0x184) from [] (add_dirent_to_buf+0x70/0x2ac) [] (add_dirent_to_buf+0x70/0x2ac) from [] (ext4_add_entry+0xd8/0x4bc) [] (ext4_add_entry+0xd8/0x4bc) from [] (ext4_add_nondir+0x14/0x64) [] (ext4_add_nondir+0x14/0x64) from [] (ext4_create+0xd8/0x120) [] (ext4_create+0xd8/0x120) from [] (vfs_create+0x74/0xa4) [] (vfs_create+0x74/0xa4) from [] (do_last+0x588/0x8d4) [] (do_last+0x588/0x8d4) from [] (path_openat+0xc4/0x394) [] (path_openat+0xc4/0x394) from [] (do_filp_open+0x30/0x7c) [] (do_filp_open+0x30/0x7c) from [] (do_sys_open+0xd8/0x174) [] (do_sys_open+0xd8/0x174) from [] (ret_fast_syscall+0x0/0x30) Every panic had the same issue where a struct buffer_head [1] had a b_data that was unexpectedly NULL. During the course of CMA, buffer_migrate_page could be called to migrate from a CMA page to a new page. buffer_migrate_page calls set_bh_page[2] to set the new page for the buffer_head. If the new page is a highmem page though, the bh->b_data ends up as NULL, which could produce the panics seen above. This seems to indicate that highmem pages are not not appropriate for use as pages to migrate to. The following made the problem go away for me: Does this seem like an actual issue or is this an artifact of my backport to 3.0? I'm not familiar enough with the filesystem layer to be able to tell where highmem can actually be used. Thanks, Laura [1] http://lxr.free-electrons.com/source/include/linux/buffer_head.h#L59 [2] http://lxr.free-electrons.com/source/fs/buffer.c?v=3.0#L1441 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5753,7 +5753,7 @@ static struct page * __alloc_contig_migrate_alloc(struct page *page, unsigned long private, int **resultp) { - return alloc_page(GFP_HIGHUSER_MOVABLE); + return alloc_page(GFP_USER | __GFP_MOVABLE); }