Use the Block Transfer Engine in the Altix SN2 SHub for background zeroing Signed-off-by: Christoph Lameter Index: linux-2.6.16-rc1-mm3/arch/ia64/sn/kernel/bte.c =================================================================== --- linux-2.6.16-rc1-mm3.orig/arch/ia64/sn/kernel/bte.c 2006-01-16 23:44:47.000000000 -0800 +++ linux-2.6.16-rc1-mm3/arch/ia64/sn/kernel/bte.c 2006-01-26 22:16:29.000000000 -0800 @@ -3,7 +3,9 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2000-2006 Silicon Graphics, Inc. All Rights Reserved. + * + * Support for zeroing pages, Christoph Lameter, SGI, January 2006. */ #include @@ -20,6 +22,7 @@ #include #include #include +#include #include @@ -473,5 +476,20 @@ void bte_init_node(nodepda_t * mynodepda mynodepda->bte_if[i].cleanup_active = 0; mynodepda->bte_if[i].bh_error = 0; } +} + +static int bte_zero_func(void *p, unsigned long len) +{ + if (len >= BTE_MAX_XFER || system_state != SYSTEM_RUNNING) + return EINVAL; + + return bte_zero(ia64_tpa(p), len, 0, NULL); +} + +static struct zero_driver bte_bzero = { + .zero_func = bte_zero_func, +}; +void sn_bte_bzero_init(void) { + register_zero_driver(&bte_bzero); } Index: linux-2.6.16-rc1-mm3/arch/ia64/sn/kernel/setup.c =================================================================== --- linux-2.6.16-rc1-mm3.orig/arch/ia64/sn/kernel/setup.c 2006-01-26 22:14:12.000000000 -0800 +++ linux-2.6.16-rc1-mm3/arch/ia64/sn/kernel/setup.c 2006-01-26 22:15:42.000000000 -0800 @@ -386,6 +386,7 @@ void __init sn_setup(char **cmdline_p) long status, ticks_per_sec, drift; u32 version = sn_sal_rev(); extern void sn_cpu_init(void); + extern void sn_bte_bzero_init(void); ia64_sn_plat_set_error_handling_features(); // obsolete ia64_sn_set_os_feature(OSF_MCA_SLV_TO_OS_INIT_SLV); @@ -489,6 +490,7 @@ void __init sn_setup(char **cmdline_p) screen_info = sn_screen_info; sn_timer_init(); + sn_bte_bzero_init(); /* * set pm_power_off to a SAL call to allow