Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750984AbWJQW4H (ORCPT ); Tue, 17 Oct 2006 18:56:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750999AbWJQW4H (ORCPT ); Tue, 17 Oct 2006 18:56:07 -0400 Received: from c3po.0xdef.net ([217.172.181.57]:33287 "EHLO c3po.0xdef.net") by vger.kernel.org with ESMTP id S1750984AbWJQW4E (ORCPT ); Tue, 17 Oct 2006 18:56:04 -0400 Date: Wed, 18 Oct 2006 00:56:03 +0200 From: Hagen Paul Pfeifer To: Kay Tiong Khoo Cc: linux-kernel@vger.kernel.org Subject: Re: stopping a process during a timer interrupt Message-ID: <20061017225603.GA15846@c3po.0xdef.net> Mail-Followup-To: Hagen Paul Pfeifer , Kay Tiong Khoo , linux-kernel@vger.kernel.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: X-Key-Id: 98350C22 X-Key-Fingerprint: 490F 557B 6C48 6D7E 5706 2EA2 4A22 8D45 9835 0C22 X-GPG-Key: gpg --recv-keys --keyserver wwwkeys.eu.pgp.net 98350C22 User-Agent: Mutt/1.5.11 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 949 Lines: 28 * Kay Tiong Khoo | 2006-10-17 18:18:25 [+0800]: >On a timer interrupt, I tried to stop the current process by changing >it's run state to TASK_STOPPED via set_current_state(TASK_STOPPED). >However, this results in a system hang. > >I can't find a way to stop the current process during an interrupt >context. Does such code exist in the kernel? If not, how does one go >about implementing it from within a kernel module. Take a look at some driver implementations! There you will find some ways how to put a process into a sleep state. Grep for "*->state*TASK_UNINTERRUPTIBLE" and take also a look at the interaction with schedule() and spinlocks. >Thanks. >Kay Tiong Best regards -- Hagen Pfeifer - 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/