From patchwork Sun Oct 27 11:51:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 3099331 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 930A3BF924 for ; Sun, 27 Oct 2013 11:52:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C08012022D for ; Sun, 27 Oct 2013 11:52:10 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C5A4720216 for ; Sun, 27 Oct 2013 11:52:09 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VaOt3-0000GW-S6; Sun, 27 Oct 2013 11:52:06 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VaOt1-0006AM-HB; Sun, 27 Oct 2013 11:52:03 +0000 Received: from mail-pb0-x236.google.com ([2607:f8b0:400e:c01::236]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VaOsy-00069L-4Y for linux-arm-kernel@lists.infradead.org; Sun, 27 Oct 2013 11:52:00 +0000 Received: by mail-pb0-f54.google.com with SMTP id ro8so1897152pbb.27 for ; Sun, 27 Oct 2013 04:51:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-type:content-transfer-encoding; bh=0rudZ5AWHrGeIAo1MjgyHGAWlTAd73P41Z1Vq7SCxgU=; b=Mtm8S+/8Qk7FygVosptmbqWOCA5OPdCG7UhwhJ87oZaFPSimL2JO+OTuWLVHpBmYwj vN3j+IpRVg0O5f2ePGKsuSayAto7/kHFrzHtUJPB3NLbthv3OTCiqg5Q27QqstkjqYqu 3L+/9ALEK7wRCipJl20AzNhGqCkRWRexvkZ7B+cnKHmrSLUkrphZulHbeThrNxMR+0y3 hxe6ok3KXlvjhIzsNL+Zza/KtKBY/Zw6HiOFqn2xJaa+uui3z6ohfJYgXfV4aXuIG0K7 nM313tBLc+5lu7h04EH9chRrT8Ts8lsBcL43GXBUavDbVqj0DkGWWhcq7hpvBm0Ncu0o SFzA== X-Received: by 10.66.11.202 with SMTP id s10mr20335123pab.86.1382874693932; Sun, 27 Oct 2013 04:51:33 -0700 (PDT) Received: from tom-ThinkPad-T410 ([183.49.44.131]) by mx.google.com with ESMTPSA id f8sm21617398pbe.43.2013.10.27.04.51.28 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 27 Oct 2013 04:51:33 -0700 (PDT) Date: Sun, 27 Oct 2013 19:51:15 +0800 From: Ming Lei To: Will Deacon Subject: Re: ARM/kirkwood: v3.12-rc6: kernel BUG at mm/util.c:390! Message-ID: <20131027195115.208f40f3@tom-ThinkPad-T410> In-Reply-To: <20131026143617.GA14034@mudshark.cambridge.arm.com> References: <20131024200730.GB17447@blackmetal.musicnaut.iki.fi> <20131026143617.GA14034@mudshark.cambridge.arm.com> Organization: Ming X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131027_075200_262049_1BED7FAB X-CRM114-Status: GOOD ( 14.51 ) X-Spam-Score: -2.0 (--) Cc: Jens Axboe , Russell King - ARM Linux , gmbnomis@gmail.com, Aaro Koskinen , catalin.marinas@arm.com, "linux-kernel@vger.kernel.org" , "James E.J. Bottomley" , FUJITA Tomonori , "linux-mm@kvack.org" , Tejun Heo , Andrew Morton , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Sat, 26 Oct 2013 15:36:17 +0100 Will Deacon wrote: > On Thu, Oct 24, 2013 at 09:07:30PM +0100, Aaro Koskinen wrote: > > > [ 36.477203] Backtrace: > > [ 36.535603] [] (page_mapping+0x0/0x50) from [] (flush_kernel_dcache_page+0x14/0x98) > > [ 36.661070] [] (flush_kernel_dcache_page+0x0/0x98) from [] (sg_miter_stop+0xc8/0x10c) > > [ 36.792813] r4:df8a9a64 r3:00000003 > > [ 36.857524] [] (sg_miter_stop+0x0/0x10c) from [] (sg_miter_next+0x14/0x13c) > > ... assumedly for scatter/gather DMA. How is your block driver allocating > its buffers? If you're using the DMA API, I can't see how this would happen. Lots of SCSI commands(inquiry, ...) pass kmalloc buffer to block layer, then the sg buffer copy helpers and flush_kernel_dcache_page() may see slab page. That has been here from commit b1adaf65ba03( [SCSI] block: add sg buffer copy helper functions). So how about letting below patch to workaround the issue? Thanks, diff --git a/lib/scatterlist.c b/lib/scatterlist.c index a685c8a..eea8806 100644 --- a/lib/scatterlist.c +++ b/lib/scatterlist.c @@ -577,7 +577,7 @@ void sg_miter_stop(struct sg_mapping_iter *miter) miter->__offset += miter->consumed; miter->__remaining -= miter->consumed; - if (miter->__flags & SG_MITER_TO_SG) + if ((miter->__flags & SG_MITER_TO_SG) && !PageSlab(page)) flush_kernel_dcache_page(miter->page); if (miter->__flags & SG_MITER_ATOMIC) {