Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932391Ab2FOPzD (ORCPT ); Fri, 15 Jun 2012 11:55:03 -0400 Received: from Chamillionaire.breakpoint.cc ([80.244.247.6]:43425 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757030Ab2FOPzA (ORCPT ); Fri, 15 Jun 2012 11:55:00 -0400 Date: Fri, 15 Jun 2012 17:54:32 +0200 From: Sebastian Andrzej Siewior To: Mel Gorman Cc: Andrew Morton , Linux-MM , Linux-Netdev , LKML , David Miller , Neil Brown , Peter Zijlstra , Mike Christie , Eric B Munson Subject: [PATCH 02.5] mm: sl[au]b: first remove PFMEMALLOC flag then SLAB flag Message-ID: <20120615155432.GA5498@breakpoint.cc> References: <1337266231-8031-1-git-send-email-mgorman@suse.de> <1337266231-8031-3-git-send-email-mgorman@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1337266231-8031-3-git-send-email-mgorman@suse.de> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1846 Lines: 57 From: Sebastian Andrzej Siewior If we first remove the SLAB flag followed by the PFMEMALLOC flag then the removal of the latter will trigger the VM_BUG_ON() as it can be seen in | kernel BUG at include/linux/page-flags.h:474! | invalid opcode: 0000 [#1] PREEMPT SMP | Call Trace: | [] slab_destroy+0x27/0x70 | [] drain_freelist+0x55/0x90 | [] __cache_shrink+0x6e/0x90 | [] ? acpi_sleep_init+0xcf/0xcf | [] kmem_cache_shrink+0x2d/0x40 because the SLAB flag is gone. This patch simply changes the order. Signed-off-by: Sebastian Andrzej Siewior --- mm/slab.c | 2 +- mm/slub.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/slab.c b/mm/slab.c index 00c601b..b1a39f7 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -2007,8 +2007,8 @@ static void kmem_freepages(struct kmem_cache *cachep, void *addr) NR_SLAB_UNRECLAIMABLE, nr_freed); while (i--) { BUG_ON(!PageSlab(page)); - __ClearPageSlab(page); __ClearPageSlabPfmemalloc(page); + __ClearPageSlab(page); page++; } if (current->reclaim_state) diff --git a/mm/slub.c b/mm/slub.c index f8cbec4..d753146 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1417,8 +1417,8 @@ static void __free_slab(struct kmem_cache *s, struct page *page) NR_SLAB_RECLAIMABLE : NR_SLAB_UNRECLAIMABLE, -pages); - __ClearPageSlab(page); __ClearPageSlabPfmemalloc(page); + __ClearPageSlab(page); reset_page_mapcount(page); if (current->reclaim_state) current->reclaim_state->reclaimed_slab += pages; -- 1.7.10 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/