From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail191.messagelabs.com (mail191.messagelabs.com [216.82.242.19]) by kanga.kvack.org (Postfix) with ESMTP id 4145D6B0055 for ; Fri, 12 Jun 2009 11:05:20 -0400 (EDT) Date: Fri, 12 Jun 2009 08:04:49 -0700 (PDT) From: Linus Torvalds Subject: Re: [PATCH v2] slab,slub: ignore __GFP_WAIT if we're booting or suspending In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org To: Pekka J Enberg Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, mingo@elte.hu, npiggin@suse.de, benh@kernel.crashing.org, akpm@linux-foundation.org, cl@linux-foundation.org List-ID: On Fri, 12 Jun 2009, Pekka J Enberg wrote: > > + if (system_state != SYSTEM_RUNNING) > + local_flags &= ~__GFP_WAIT; > + > + might_sleep_if(local_flags & __GFP_WAIT); This is pointless. You're doing the "might_sleep_if()" way too late. At that point, you've already lost 99% of all coverage, since now none of the cases of just finding a free slab entry on the list will ever trigger that "might_sleep()" case. So you need to do this _early_, at the entry-point, not late, at cache re-fill time. So rather than removing the might_sleep_if() at the early point, and then moving it to this late stage (because you only do the local_flags fixups late), you need to move the local-flags fixup early instead, and do the might_sleep_it() there. The whole point of "might_sleep()" is that it triggers every time if something is called in the wrong context - not just for the cases where it actually _does_ sleep. Linus -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org