Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965165AbXAJWoH (ORCPT ); Wed, 10 Jan 2007 17:44:07 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S965167AbXAJWoH (ORCPT ); Wed, 10 Jan 2007 17:44:07 -0500 Received: from smtp.osdl.org ([65.172.181.24]:59917 "EHLO smtp.osdl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965165AbXAJWoE (ORCPT ); Wed, 10 Jan 2007 17:44:04 -0500 Date: Wed, 10 Jan 2007 14:43:56 -0800 (PST) From: Linus Torvalds To: Geert Uytterhoeven cc: Peter Zijlstra , Andrew Morton , Al Viro , Linux Kernel Development , Linux/m68k Subject: Re: [PATCH] mm: pagefault_{disable,enable}() In-Reply-To: Message-ID: References: <200612071659.kB7GxGHa030259@hera.kernel.org> 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: 1559 Lines: 41 On Wed, 10 Jan 2007, Geert Uytterhoeven wrote: > > > The REAL problem seems to be that the m68k preempt.h (or rather, to be > > exact, asm/thread_info.h) doesn't do things right, and while it exposes > > "inc_preempt_count()", it doesn't expose enough information to actually > > use it. > > > > I think your "current_thread_info()" is broken. > > But struct task_struct is defined in , which cannot be included > in due to include recursion hell. But why do you need "struct task_struct" at all? The reason this doesn't happen on other platforms is that they don't use "struct task_struct". They use "struct thread_info", which is where the preemption counter is. The problem on m68k i sthat broken indirection through "current", which is unnecessary. Isn't the thread structure on the stack on m68k too? So you could do what x86 does, and just do movel %a7,%d0 andl $STACK_MASK,%d0 or something, and thus go directly to the thread-info rather than load it off the task pointer. Or, if worst comes to worst, you can just hardcode the offset of the thread-info pointer in the "struct task_struct". It's the second word after "state". Ugly, but less so than forcing everybody who does NOT want to have that big dependency to get it. 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/