Use the Block Transfer Engine in the Altix SN2 SHub for background zeroing Index: linux-2.6.10/arch/ia64/sn/kernel/bte.c =================================================================== --- linux-2.6.10.orig/arch/ia64/sn/kernel/bte.c 2005-02-03 17:13:07.000000000 -0800 +++ linux-2.6.10/arch/ia64/sn/kernel/bte.c 2005-02-03 18:11:45.000000000 -0800 @@ -3,7 +3,9 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved. + * + * Support for zeroing pages, Christoph Lameter, SGI, December 2004. */ #include @@ -20,6 +22,8 @@ #include #include #include +#include +#include #include @@ -30,7 +34,7 @@ /* two interfaces on two btes */ #define MAX_INTERFACES_TO_TRY 4 -static struct bteinfo_s *bte_if_on_node(nasid_t nasid, int interface) +static inline struct bteinfo_s *bte_if_on_node(nasid_t nasid, int interface) { nodepda_t *tmp_nodepda; @@ -199,6 +203,7 @@ retry_bteop: } while ((transfer_stat = *bte->most_rcnt_na) == BTE_WORD_BUSY) { + cpu_relax(); if (ia64_get_itc() > itc_end) { BTE_PRINTK(("BTE timeout nasid 0x%x bte%d IBLS = 0x%lx na 0x%lx\n", NASID_GET(bte->bte_base_addr), bte->bte_num, @@ -449,5 +454,25 @@ void bte_init_node(nodepda_t * mynodepda mynodepda->bte_if[i].cleanup_active = 0; mynodepda->bte_if[i].bh_error = 0; } +} + +static int bte_start_bzero(void *p, unsigned long len) +{ + + /* Check limitations. + 1. System must be running (weird things happen during bootup) + 2. Size >64KB. Smaller requests cause too much bte traffic + */ + if (len >= BTE_MAX_XFER || len < 60000 || system_state != SYSTEM_RUNNING) + return EINVAL; + + return bte_zero(ia64_tpa(p), len, 0, NULL); +} + +static struct zero_driver bte_bzero = { + .start = bte_start_bzero, +}; +void sn_bte_bzero_init(void) { + register_zero_driver(&bte_bzero); } Index: linux-2.6.10/arch/ia64/sn/kernel/setup.c =================================================================== --- linux-2.6.10.orig/arch/ia64/sn/kernel/setup.c 2005-02-03 13:33:33.000000000 -0800 +++ linux-2.6.10/arch/ia64/sn/kernel/setup.c 2005-02-03 18:08:26.000000000 -0800 @@ -251,6 +251,7 @@ void __init sn_setup(char **cmdline_p) int pxm; int major = sn_sal_rev_major(), minor = sn_sal_rev_minor(); extern void sn_cpu_init(void); + extern void sn_bte_bzero_init(void); /* * If the generic code has enabled vga console support - lets @@ -341,6 +342,7 @@ void __init sn_setup(char **cmdline_p) screen_info = sn_screen_info; sn_timer_init(); + sn_bte_bzero_init(); } /**