From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754253AbXDSWxM (ORCPT ); Thu, 19 Apr 2007 18:53:12 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754290AbXDSWxM (ORCPT ); Thu, 19 Apr 2007 18:53:12 -0400 Received: from smtp1.linux-foundation.org ([65.172.181.25]:51242 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754253AbXDSWxK (ORCPT ); Thu, 19 Apr 2007 18:53:10 -0400 Date: Thu, 19 Apr 2007 15:52:45 -0700 From: Andrew Morton To: "Eric W. Biederman" Cc: , Oleg Nesterov , Christoph Hellwig , , Hartmut Hackmann , Mauro Carvalho Chehab Subject: Re: [PATCH] saa7134-tvaudio: Convert to kthread API. Message-Id: <20070419155245.6f112d9e.akpm@linux-foundation.org> In-Reply-To: <11769696312493-git-send-email-ebiederm@xmission.com> References: <11769696312493-git-send-email-ebiederm@xmission.com> X-Mailer: Sylpheed version 2.2.7 (GTK+ 2.8.6; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 19 Apr 2007 01:58:58 -0600 "Eric W. Biederman" wrote: > It is my goal to replace all kernel code that handles signals > from user space, calls kernel_thread or calls daemonize. All > of which the kthread_api makes unncessary. Handling signals > from user space is a maintenance problem becuase using a > kernel thread is an implementation detail and if user space > cares it does not allow us to change the implementation. Calling > daemonize is a problem because it has to undo a continually changing > set of state generated by user space, requiring the implemetation > to change continually. kernel_thread is a problem because it > returns a pid_t value. Numeric pids are inherently racy and > in the presence of a pid namespace they are no longer global > making them useless for general use in the kernel. > > So this patch renames the pid member of struct saa7134_thread > started and changes it's type from pid_t to int. All it > has ever been used for is to detect if the kernel thread > is has been started so this works. > > allow_signal(SIGTERM) and the calls to signal_pending have > been removed they are needed for the driver to operation. > > The startup of tvaudio_thread and tvaudio_thread_dep have > been modified to use kthread_run instead of a combination > of kernel_thread and daemonize. > > The result is code that is slightly simpler and more > maintainable. This one also really wants to be converted to full use of the API. ie: use kthread_stop(), kthread_should_stop(), remove all the hand-woven equivalent stuff we have in there. I'll tag this as an -mm-only thing as well, in the hope that someone who can test the changes will be able to find time to address all this.