From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Mon, 27 Jun 2005 16:13:20 +0200 From: Pavel Machek Subject: Re: [RFC] Fix SMP brokenness for PF_FREEZE and make freezing usable for other purposes Message-ID: <20050627141320.GA4945@atrey.karlin.mff.cuni.cz> References: <20050625025122.GC22393@atrey.karlin.mff.cuni.cz> <20050626023053.GA2871@atrey.karlin.mff.cuni.cz> <20050626030925.GA4156@atrey.karlin.mff.cuni.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org Return-Path: To: Christoph Lameter Cc: Linus Torvalds , linux-mm@kvack.org, linux-kernel@vger.kernel.org, raybry@engr.sgi.com List-ID: Hi! > > It's called "work", and we have the "TIF_xxx" flags for it. That's how > > "need-resched" and "sigpending" are done. There could be a > > "TIF_FREEZEPENDING" thing there too.. > > Ok. Here is yet another version of the patch: > > --- > The current suspend code modifies thread flags from outside the context of process. > This creates a SMP race. > > The patch fixes that by introducing a TIF_FREEZE flag (for all arches). Also > > - Uses a completion handler instead of waiting in a schedule loop in the refrigerator. > > - Introduces a semaphore freezer_sem to provide a way that multiple kernel > subsystems can use the freezing ability without interfering with one another. > > - Include necessary definitions for the migration code if CONFIG_MIGRATE is set. > > - Removes PF_FREEZE > > If this approach is okay then we will need to move the refrigerator() and the > definition of the semaphore and the completion variable out of kernel/power/process.c > into kernel/sched.c (right?). Approach seems okay... Perhaps better place is something like kernel/freezer.c so it stays separate file? It is not really scheduler core, and it is only conditionally compiled... Pavel -- Boycott Kodak -- for their patent abuse against Java. -- 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: aart@kvack.org