Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 27 Mar 2003 14:14:03 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 27 Mar 2003 14:14:03 -0500 Received: from neon-gw-l3.transmeta.com ([63.209.4.196]:36102 "EHLO neon-gw.transmeta.com") by vger.kernel.org with ESMTP id ; Thu, 27 Mar 2003 14:14:00 -0500 Date: Thu, 27 Mar 2003 11:22:55 -0800 (PST) From: Linus Torvalds To: "David S. Miller" cc: dane@aiinet.com, , , , , , , , Subject: Re: BUG or not? GFP_KERNEL with interrupts disabled. In-Reply-To: <20030327.111012.23672715.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 948 Lines: 28 On Thu, 27 Mar 2003, David S. Miller wrote: > > Let's codify this "in_atomic() || irqs_disabled()" test into a macro > that everyone can use to test sleepability, ok? Well, I really don't want people to act dynamically differently depending on whether they can sleep or not. That makes static sanity-testing impossible. So I really think that the only really valid use of the above is on one single place: might_sleep(). Which right now doesn't do the "irqs_disabled()" test, but otherwise looks good. So the code should really just say if (gfp_mask & __GFP_WAIT) might_sleep(); and might_sleep() should be updated. Anybody want to try that and see whether things break horribly? Linus - 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/