From patchwork Wed Nov 12 01:47:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirill A. Shutemov" X-Patchwork-Id: 5286461 Return-Path: X-Original-To: patchwork-dri-devel@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 23AD2C11AC for ; Wed, 12 Nov 2014 08:40:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 533D920155 for ; Wed, 12 Nov 2014 08:40:32 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5567520136 for ; Wed, 12 Nov 2014 08:40:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 11C116E36D; Wed, 12 Nov 2014 00:40:28 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from jenni2.inet.fi (mta-out1.inet.fi [62.71.2.227]) by gabe.freedesktop.org (Postfix) with ESMTP id 88BBE6E1A0 for ; Tue, 11 Nov 2014 17:47:22 -0800 (PST) Received: from node.shutemov.name (80.220.224.16) by jenni2.inet.fi (8.5.142.08) id 5462939B0001CDE3; Wed, 12 Nov 2014 03:47:09 +0200 Received: by node.shutemov.name (Postfix, from userid 1000) id 7DFB640E10; Wed, 12 Nov 2014 03:47:03 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=shutemov.name; s=default; t=1415756823; bh=MjpGNaFWbx4OYoeGNb0/lPKcwizkCb0htq6SV8b7VCY=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=XrAu2X+ZDrWygGnR+TWZA7+05fjsoLPnyq4eeVJThn8KAoBCtPGCmMmK1fOoFK2uS RYsydLykcbWe4GF/Cf3ManHynbvNjl5yLYs9rmUskNB/6UbELm2DCjIe4o/fH1wQ+B OKAKDzc1/QFdryoElbh0Dgz9+DKzF8sNW0bzcjLY= Date: Wed, 12 Nov 2014 03:47:03 +0200 From: "Kirill A. Shutemov" To: Andrew Morton Subject: Re: [Bug 87891] New: kernel BUG at mm/slab.c:2625! Message-ID: <20141112014703.GB17446@node.dhcp.inet.fi> References: <20141111153120.9131c8e1459415afff8645bc@linux-foundation.org> <20141111164913.3616531c21c91499871c46de@linux-foundation.org> <20141112012241.GA17446@node.dhcp.inet.fi> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20141112012241.GA17446@node.dhcp.inet.fi> User-Agent: Mutt/1.5.23.1 (2014-03-12) X-Mailman-Approved-At: Wed, 12 Nov 2014 00:40:27 -0800 Cc: Tetsuo Handa , bugzilla-daemon@bugzilla.kernel.org, linux-mm@kvack.org, Mel Gorman , Ming Lei , Johannes Weiner , luke-jr+linuxbugs@utopios.org, dri-devel@lists.freedesktop.org, Pekka Enberg , David Rientjes , Joonsoo Kim , Christoph Lameter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 Wed, Nov 12, 2014 at 03:22:41AM +0200, Kirill A. Shutemov wrote: > On Tue, Nov 11, 2014 at 04:49:13PM -0800, Andrew Morton wrote: > > On Tue, 11 Nov 2014 18:36:28 -0600 (CST) Christoph Lameter wrote: > > > > > On Tue, 11 Nov 2014, Andrew Morton wrote: > > > > > > > There's no point in doing > > > > > > > > #define GFP_SLAB_BUG_MASK (__GFP_DMA32|__GFP_HIGHMEM|~__GFP_BITS_MASK) > > > > > > > > because __GFP_DMA32|__GFP_HIGHMEM are already part of ~__GFP_BITS_MASK. > > > > > > ?? ~__GFP_BITS_MASK means bits 25 to 31 are set. > > > > > > __GFP_DMA32 is bit 2 and __GFP_HIGHMEM is bit 1. > > > > Ah, yes, OK. > > > > I suppose it's possible that __GFP_HIGHMEM was set. > > > > do_huge_pmd_anonymous_page > > ->pte_alloc_one > > ->alloc_pages(__userpte_alloc_gfp==__GFP_HIGHMEM) > > do_huge_pmd_anonymous_page > alloc_hugepage_vma > alloc_pages_vma(GFP_TRANSHUGE) > > GFP_TRANSHUGE contains GFP_HIGHUSER_MOVABLE, which has __GFP_HIGHMEM. Looks like it's reasonable to sanitize flags in shrink_slab() by dropping flags incompatible with slab expectation. Like this: diff --git a/mm/vmscan.c b/mm/vmscan.c index dcb47074ae03..eb165d29c5e5 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -369,6 +369,8 @@ unsigned long shrink_slab(struct shrink_control *shrinkctl, if (nr_pages_scanned == 0) nr_pages_scanned = SWAP_CLUSTER_MAX; + shrinkctl->gfp_mask &= ~(__GFP_DMA32 | __GFP_HIGHMEM); + if (!down_read_trylock(&shrinker_rwsem)) { /* * If we would return 0, our callers would understand that we