From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755449AbYDJDYK (ORCPT ); Wed, 9 Apr 2008 23:24:10 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752406AbYDJDX7 (ORCPT ); Wed, 9 Apr 2008 23:23:59 -0400 Received: from ozlabs.org ([203.10.76.45]:56346 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752076AbYDJDX6 (ORCPT ); Wed, 9 Apr 2008 23:23:58 -0400 To: CC: Paul Mackerras , , , , Linux-Arch From: Benjamin Herrenschmidt Date: Thu, 10 Apr 2008 13:22:56 +1000 Subject: [PATCH 1/2] Add thread_info_cache_init() to all archs Message-Id: <20080410032354.90CB1DDF0F@ozlabs.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some architecture need to maintain a kmem cache for thread info structures. (next patch adds that to powerpc to fix an alignment problem). There is no good arch callback to use to initialize that cache that I can find, so this adds a new one and adds an empty macro for when it's not implemented. Signed-off-by: Benjamin Herrenschmidt --- So we have the choice here between: - the ifdef on the func name that I did, consistent with what I did before for iomap, which iirc Linus liked - add some more ARCH_HAS_* or HAVE_* (yuck) - add an empty definition to all archs .h (pain in the neck but I can do it, though it will be an annoying patch to keep around) - do a weak function (will slightly bloat everybody for no good reason) So unless there is strong complaints, I'd like to stick to my current approach. include/linux/sched.h | 4 ++++ init/main.c | 1 + 2 files changed, 5 insertions(+) --- linux-work.orig/init/main.c 2008-04-10 13:11:06.000000000 +1000 +++ linux-work/init/main.c 2008-04-10 13:11:19.000000000 +1000 @@ -623,6 +623,7 @@ asmlinkage void __init start_kernel(void if (efi_enabled) efi_enter_virtual_mode(); #endif + thread_info_cache_init(); fork_init(num_physpages); proc_caches_init(); buffer_init(); Index: linux-work/include/linux/sched.h =================================================================== --- linux-work.orig/include/linux/sched.h 2008-04-10 13:11:44.000000000 +1000 +++ linux-work/include/linux/sched.h 2008-04-10 13:12:05.000000000 +1000 @@ -1893,6 +1893,10 @@ static inline unsigned long *end_of_stac #endif +#ifndef thread_info_cache_init +#define thread_info_cache_init do { } while(0) +#endif + /* set thread flags in other task's structures * - see asm/thread_info.h for TIF_xxxx flags available */