📄 libbalancer.h
字号:
/* Copyright (c) 2006 David Santo Orcero irbis@orcero.org *//* http://www.orcero.org/irbis *//* OpenMosix is (c) of Moshe Bar http://www.openmosix.com *//* Mosix is (c) of prof. Barak http://www.mosix.org *//* Each respective trademark is of its own owner *//* All rights reserved. *//* This software is distributed under GPL 2 *//* THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTY IS ASSUMED. *//* NO LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING *//* FROM THE USE OF THIS SOFTWARE WILL BE ACCEPTED. IT CAN BURN *//* YOUR HARD DISK, ERASE ALL YOUR DATA AND BROKE DOWN YOUR *//* MICROWAVE OVEN. YOU ARE ADVISED. */#ifndef _LIBBALANCER_H#define _LIBBALANCER_H//#include <linux/types.h>#include <libmosix.h>/* This is used to travel to another node */int om_goto_node (int baseorder, pid_t pid, char *where);/* migration requests via /proc/nnnnn/om/goto and as baseorder to gotonode */#define DM_BALANCE_DEFAULT (-3) /* perform load balancing by the default algoritm */#define DM_UNKNOWN (-2) /* If you read this, something went wrong */#define DM_NOBALANCE (-1) /* don't perform load balancing */#define DM_GOBACKHOME 0 /* just go back home */#define DM_BALANCE_MOSIX 1 /* perform load balancing by Amnon Barak algoritm */#define DM_BALANCE_RR 2 /* perform load balancing by fork round robin algoritm */#define DM_MANUAL_MIGRATION 3 /* perform a manual migration *//* constants for status report (/proc/hpc/nodes/IP/status) */#define DS_MOSIX_DEF 0x001#define DS_MOSIX_UP 0x002#define DS_STAY 0x004#define DS_LSTAY 0x008#define DS_BLOCK 0x010#define DS_QUIET 0x020#define DS_NOMFS 0x040/* constants for statictics decay - Amnon Barak algoritm */#define DADV_CPU 1 /* a pure CPU task */#define DADV_NOCPU 2 /* a non-computational task */#define DADV_NODECAY 3 /* task of a uniform mix of rapid changes */#define DADV_SLOWDECAY 4 /* task may change its nature over long run */#define DADV_FASTDECAY 5 /* task changes its nature frequently */#define DADV_OWNDECAY 6 /* task defined its own decay policy */#define DADV_POLICY 0x00F /* policy mask */#define DADV_CLEAR 0x010 /* clear statistics: nature is changing */#define DADV_INHERIT 0x020 /* children of same nature */#define DADV_EXEC 0x040 /* maintain advice after exec */#define DADV_EXECONCE 0x080 /* maintain advice after only the next exec */#define DADV_NOINHERIT 0x100 /* cancel inheritance */#define DADV_NOEXEC 0x200 /* cancel advice on exec */#define DADV_NOEXECONCE 0x400 /* cancel DADV_EXECONCE */#define DADV_ENQUIRE 0x1000 /* enquire decay policy */#define DADV_DEFAULT DADV_SLOWDECAY#define DECAY_QUOTIENT 1000 /* quotient for the "decay" argument *//* load information - Amnon Barak algoritm */struct mosix_info{ unsigned long load; unsigned short speed; unsigned short ncpus; unsigned short util; unsigned short status; int64_t mem; int64_t rmem; int64_t tmem;};/* last round robin migration node - Round Robin algoritm */extern int lastnode;#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -