Re: PROBLEM: in_atomic() misuse all over the place

From: Joerg Roedel
Date: Sat Jan 31 2009 - 06:45:32 EST


On Tue, Jan 27, 2009 at 06:12:00PM -0600, Robert Hancock wrote:
> I would think that the code that's using it for this purpose should be
> changed to do things differently, such as by changing the functions
> using it to make their caller pass in the proper GFP mask. I don't think
> it was ever intended to be used to select allocation behavior like this,
> only for debug warning checks and such.. Getting rid of in_atomic() and
> creating a in_atomic_warn() that just raises a warning if called
> atomically, might be the best long-term solution.

I also made the mistake of using in_atomic() wrong in one of my last
patch sets. In my case this was pointed out by the reviewers. Is there
some documentation in the kernel tree how and when in_atomic() is used
right? If not I think its worth writing a little file that explains the
important details about the correct use of in_atomic() :-)

Joerg

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/