HZ 和 CONFIG_HZ 宏定义的位置:
实际上在 linux-2.6.x/include/asm/param.h 定义了HZ的值:
/*
* arch/arm/include/asm/param.h
*
* Copyright (C) 1995-1999 Russell King
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef __ASM_PARAM_H
#define __ASM_PARAM_H
#ifdef __KERNEL__
# define HZ
CONFIG_HZ /* Internal kernel timer frequency */
# define USER_HZ 100 /* User interfaces are in "ticks" */
# define CLOCKS_PER_SEC (USER_HZ) /* like times() */
#else
# define HZ 100
#endif
#define EXEC_PAGESIZE 4096
#ifndef NOGROUP
#define NOGROUP (-1)
#endif
/* max length of hostname */
#define MAXHOSTNAMELEN 64
#endif
CONFIG_HZ的值可以在make menuconfig时设置,表示每秒钟定时器发生中断的次数,默认值是250。
本文介绍了Linux内核2.6.x版本中HZ和CONFIG_HZ宏的定义位置,它们位于arch/arm/include/asm/param.h文件中。HZ的值在内核配置时可以通过CONFIG_HZ设定,表示内部定时器频率,而USER_HZ为用户接口频率,通常设置为100。默认情况下,CONFIG_HZ设为250,意味着每秒定时器中断250次。
75





