--- linux-2.6.11-rc1/arch/parisc/kernel/sys_parisc32.c 2005-01-14 12:35:41 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/arch/parisc/kernel/sys_parisc32.c 2005-01-15 11:27:52 +0100 @@ -665,6 +665,7 @@ asmlinkage int sys32_sysinfo(struct sysi do { seq = read_seqbegin(&xtime_lock); + /* requires vx virtualization */ val.uptime = jiffies / HZ; val.loads[0] = avenrun[0] << (SI_LOAD_SHIFT - FSHIFT); --- linux-2.6.11-rc1/arch/sh/kernel/kgdb_stub.c 2004-08-14 12:54:51 +0200 +++ linux-2.6.11-rc1-vs1.9.4-rc2/arch/sh/kernel/kgdb_stub.c 2005-01-15 11:27:52 +0100 @@ -412,7 +412,7 @@ static struct task_struct *get_thread(in if (pid == PID_MAX) pid = 0; /* First check via PID */ - thread = find_task_by_pid(pid); + thread = find_task_by_real_pid(pid); if (thread) return thread; --- linux-2.6.11-rc1/drivers/char/tty_io.c 2005-01-14 12:35:46 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/drivers/char/tty_io.c 2005-01-15 11:27:52 +0100 @@ -2112,13 +2113,16 @@ static int tiocsctty(struct tty_struct * static int tiocgpgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t __user *p) { + pid_t pgrp; /* * (tty == real_tty) is a cheap way of * testing if the tty is NOT a master pty. */ if (tty == real_tty && current->signal->tty != real_tty) return -ENOTTY; - return put_user(real_tty->pgrp, p); + + pgrp = vx_map_pid(real_tty->pgrp); + return put_user(pgrp, p); } static int tiocspgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t __user *p) --- linux-2.6.11-rc1/drivers/char/tty_io.c 2005-01-14 12:35:46 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/drivers/char/tty_io.c 2005-01-15 11:27:52 +0100 @@ -2136,6 +2140,8 @@ static int tiocspgrp(struct tty_struct * return -ENOTTY; if (get_user(pgrp, p)) return -EFAULT; + + pgrp = vx_rmap_pid(pgrp); if (pgrp < 0) return -EINVAL; if (session_of_pgrp(pgrp) != current->signal->session) --- linux-2.6.11-rc1/fs/fcntl.c 2004-12-25 01:55:20 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/fs/fcntl.c 2005-01-15 11:27:52 +0100 @@ -489,7 +494,7 @@ void send_sigio(struct fown_struct *fown read_lock(&tasklist_lock); if (pid > 0) { - p = find_task_by_pid(pid); + p = find_task_by_real_pid(pid); if (p) { send_sigio_to_task(p, fown, fd, band); } --- linux-2.6.11-rc1/fs/fcntl.c 2004-12-25 01:55:20 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/fs/fcntl.c 2005-01-15 11:27:52 +0100 @@ -524,7 +529,7 @@ int send_sigurg(struct fown_struct *fown read_lock(&tasklist_lock); if (pid > 0) { - p = find_task_by_pid(pid); + p = find_task_by_real_pid(pid); if (p) { send_sigurg_to_task(p, fown); } --- linux-2.6.11-rc1/fs/open.c 2005-01-14 12:35:55 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/fs/open.c 2005-01-15 11:27:52 +0100 @@ -41,6 +44,8 @@ int vfs_statfs(struct super_block *sb, s if (retval == 0 && buf->f_frsize == 0) buf->f_frsize = buf->f_bsize; } + if (!vx_check(0, VX_ADMIN|VX_WATCH)) + vx_vsi_statfs(sb, buf); } return retval; } --- linux-2.6.11-rc1/fs/proc/array.c 2005-01-14 12:35:55 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/fs/proc/array.c 2005-01-15 11:27:52 +0100 @@ -158,8 +163,13 @@ static inline char * task_state(struct t { struct group_info *group_info; int g; + pid_t pid, ptgid, tppid, tgid; read_lock(&tasklist_lock); + tgid = vx_map_tgid(p->tgid); + pid = vx_map_pid(p->pid); + ptgid = vx_map_pid(p->group_leader->real_parent->tgid); + tppid = vx_map_pid(p->parent->pid); buffer += sprintf(buffer, "State:\t%s\n" "SleepAVG:\t%lu%%\n" --- linux-2.6.11-rc1/fs/proc/array.c 2005-01-14 12:35:55 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/fs/proc/array.c 2005-01-15 11:27:52 +0100 @@ -171,9 +181,8 @@ static inline char * task_state(struct t "Gid:\t%d\t%d\t%d\t%d\n", get_task_state(p), (p->sleep_avg/1024)*100/(1020000000/1024), - p->tgid, - p->pid, pid_alive(p) ? p->group_leader->real_parent->tgid : 0, - pid_alive(p) && p->ptrace ? p->parent->pid : 0, + tgid, pid, (pid > 1) ? ptgid : 0, + pid_alive(p) && p->ptrace ? tppid : 0, p->uid, p->euid, p->suid, p->fsuid, p->gid, p->egid, p->sgid, p->fsgid); read_unlock(&tasklist_lock); --- linux-2.6.11-rc1/fs/proc/array.c 2005-01-14 12:35:55 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/fs/proc/array.c 2005-01-15 11:27:52 +0100 @@ -309,7 +355,7 @@ static int do_task_stat(struct task_stru sigset_t sigign, sigcatch; char state; int res; - pid_t ppid, pgid = -1, sid = -1; + pid_t pid, ppid, pgid = -1, sid = -1; int num_threads = 0; struct mm_struct *mm; unsigned long long start_time; --- linux-2.6.11-rc1/fs/proc/array.c 2005-01-14 12:35:55 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/fs/proc/array.c 2005-01-15 11:27:52 +0100 @@ -373,7 +419,11 @@ static int do_task_stat(struct task_stru stime = cputime_add(stime, task->signal->stime); } } - ppid = pid_alive(task) ? task->group_leader->real_parent->tgid : 0; + pid = vx_info_map_pid(task->vx_info, pid_alive(task) ? task->pid : 0); + ppid = (!(pid > 1)) ? 0 : vx_info_map_tgid(task->vx_info, + task->group_leader->real_parent->tgid); + pgid = vx_info_map_pid(task->vx_info, pgid); + read_unlock(&tasklist_lock); if (!whole || num_threads<2) --- linux-2.6.11-rc1/fs/proc/array.c 2005-01-14 12:35:55 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/fs/proc/array.c 2005-01-15 11:27:52 +0100 @@ -394,13 +444,25 @@ static int do_task_stat(struct task_stru /* convert timespec -> nsec*/ start_time = (unsigned long long)task->start_time.tv_sec * NSEC_PER_SEC + task->start_time.tv_nsec; + /* convert nsec -> ticks */ start_time = nsec_to_clock_t(start_time); + /* fixup start time for virt uptime */ + if (vx_flags(VXF_VIRT_UPTIME, 0)) { + unsigned long long bias = + current->vx_info->cvirt.bias_clock; + + if (start_time > bias) + start_time -= bias; + else + start_time = 0; + } + res = sprintf(buffer,"%d (%s) %c %d %d %d %d %d %lu %lu \ %lu %lu %lu %lu %lu %ld %ld %ld %ld %d %ld %llu %lu %ld %lu %lu %lu %lu %lu \ %lu %lu %lu %lu %lu %lu %lu %lu %d %d %lu %lu\n", - task->pid, + pid, tcomm, state, ppid, --- linux-2.6.11-rc1/fs/proc/base.c 2005-01-14 12:35:55 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/fs/proc/base.c 2005-01-15 12:25:57 +0100 @@ -1561,6 +1590,8 @@ struct dentry *proc_pid_lookup(struct in goto out; } return NULL; +out_drop_task: + put_task_struct(task); out: return ERR_PTR(-ENOENT); } --- linux-2.6.11-rc1/fs/proc/base.c 2005-01-14 12:35:55 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/fs/proc/base.c 2005-01-15 12:25:57 +0100 @@ -1576,6 +1607,8 @@ static struct dentry *proc_task_lookup(s tid = name_to_int(dentry); if (tid == ~0U) goto out; + if (vx_current_initpid(tid)) + goto out; read_lock(&tasklist_lock); task = find_task_by_pid(tid); --- linux-2.6.11-rc1/fs/proc/base.c 2005-01-14 12:35:55 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/fs/proc/base.c 2005-01-15 12:25:57 +0100 @@ -1627,7 +1662,7 @@ static int get_tgid_list(int index, unsi read_lock(&tasklist_lock); p = NULL; if (version) { - p = find_task_by_pid(version); + p = find_task_by_real_pid(version); if (p && !thread_group_leader(p)) p = NULL; } --- linux-2.6.11-rc1/fs/proc/base.c 2005-01-14 12:35:55 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/fs/proc/base.c 2005-01-15 12:25:57 +0100 @@ -1639,11 +1674,14 @@ static int get_tgid_list(int index, unsi for ( ; p != &init_task; p = next_task(p)) { int tgid = p->pid; + if (!pid_alive(p)) continue; + if (!vx_check(vx_task_xid(p), VX_WATCH|VX_IDENT)) + continue; if (--index >= 0) continue; - tgids[nr_tgids] = tgid; + tgids[nr_tgids] = vx_map_tgid(tgid); nr_tgids++; if (nr_tgids >= PROC_MAXPIDS) break; --- linux-2.6.11-rc1/fs/proc/base.c 2005-01-14 12:35:55 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/fs/proc/base.c 2005-01-15 12:25:57 +0100 @@ -1673,9 +1711,11 @@ static int get_tid_list(int index, unsig if (pid_alive(task)) do { int tid = task->pid; + if (!vx_check(vx_task_xid(task), VX_WATCH|VX_IDENT)) + continue; if (--index >= 0) continue; - tids[nr_tids] = tid; + tids[nr_tids] = vx_map_pid(tid); nr_tids++; if (nr_tids >= PROC_MAXPIDS) break; --- linux-2.6.11-rc1/fs/proc/proc_misc.c 2005-01-14 12:35:55 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/fs/proc/proc_misc.c 2005-01-15 12:29:17 +0100 @@ -81,17 +83,32 @@ static int proc_calc_metrics(char *page, static int loadavg_read_proc(char *page, char **start, off_t off, int count, int *eof, void *data) { + unsigned int running, threads; int a, b, c; int len; - a = avenrun[0] + (FIXED_1/200); - b = avenrun[1] + (FIXED_1/200); - c = avenrun[2] + (FIXED_1/200); - len = sprintf(page,"%d.%02d %d.%02d %d.%02d %ld/%d %d\n", + if (vx_flags(VXF_VIRT_LOAD, 0)) { + struct vx_info *vxi = current->vx_info; + + a = vxi->cvirt.load[0] + (FIXED_1/200); + b = vxi->cvirt.load[1] + (FIXED_1/200); + c = vxi->cvirt.load[2] + (FIXED_1/200); + + running = atomic_read(&vxi->cvirt.nr_running); + threads = atomic_read(&vxi->cvirt.nr_threads); + } else { + a = avenrun[0] + (FIXED_1/200); + b = avenrun[1] + (FIXED_1/200); + c = avenrun[2] + (FIXED_1/200); + + running = nr_running(); + threads = nr_threads; + } + len = sprintf(page,"%d.%02d %d.%02d %d.%02d %d/%d %d\n", LOAD_INT(a), LOAD_FRAC(a), LOAD_INT(b), LOAD_FRAC(b), LOAD_INT(c), LOAD_FRAC(c), - nr_running(), nr_threads, last_pid); + running, threads, last_pid); return proc_calc_metrics(page, start, off, count, eof, len); } --- linux-2.6.11-rc1/fs/proc/proc_misc.c 2005-01-14 12:35:55 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/fs/proc/proc_misc.c 2005-01-15 12:29:17 +0100 @@ -105,6 +122,9 @@ static int uptime_read_proc(char *page, do_posix_clock_monotonic_gettime(&uptime); cputime_to_timespec(idletime, &idle); + if (vx_flags(VXF_VIRT_UPTIME, 0)) + vx_vsi_uptime(&uptime, &idle); + len = sprintf(page,"%lu.%02lu %lu.%02lu\n", (unsigned long) uptime.tv_sec, (uptime.tv_nsec / (NSEC_PER_SEC / 100)), --- linux-2.6.11-rc1/include/linux/sched.h 2005-01-14 12:35:58 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/include/linux/sched.h 2005-01-15 11:27:52 +0100 @@ -798,13 +810,19 @@ extern struct task_struct init_task; extern struct mm_struct init_mm; -#define find_task_by_pid(nr) find_task_by_pid_type(PIDTYPE_PID, nr) + +#define find_task_by_real_pid(nr) \ + find_task_by_pid_type(PIDTYPE_PID, nr) +#define find_task_by_pid(nr) \ + find_task_by_pid_type(PIDTYPE_PID, \ + vx_rmap_pid(nr)) + extern struct task_struct *find_task_by_pid_type(int type, int pid); extern void set_special_pids(pid_t session, pid_t pgrp); extern void __set_special_pids(pid_t session, pid_t pgrp); /* per-UID process charging. */ -extern struct user_struct * alloc_uid(uid_t); +extern struct user_struct * alloc_uid(xid_t, uid_t); static inline struct user_struct *get_uid(struct user_struct *u) { atomic_inc(&u->__count); --- linux-2.6.11-rc1/include/linux/vserver/cvirt.h 1970-01-01 01:00:00 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/include/linux/vserver/cvirt.h 2005-01-15 11:27:52 +0100 @@ -0,0 +1,18 @@ +#ifndef _VX_CVIRT_H +#define _VX_CVIRT_H + +#ifdef __KERNEL__ + +struct timespec; + +void vx_vsi_uptime(struct timespec *, struct timespec *); + + +struct vx_info; + +void vx_update_load(struct vx_info *); + +#endif /* __KERNEL__ */ +#else /* _VX_CVIRT_H */ +#warning duplicate inclusion +#endif /* _VX_CVIRT_H */ --- linux-2.6.11-rc1/include/linux/vserver/debug_cmd.h 1970-01-01 01:00:00 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/include/linux/vserver/debug_cmd.h 2005-01-15 11:27:52 +0100 @@ -0,0 +1,14 @@ +#ifndef _VX_DEBUG_CMD_H +#define _VX_DEBUG_CMD_H + + +/* debug commands */ + +#define VCMD_dump_history VC_CMD(DEBUG, 1, 0) + +#ifdef __KERNEL__ + +extern int vc_dump_history(uint32_t); + +#endif /* __KERNEL__ */ +#endif /* _VX_DEBUG_CMD_H */ --- linux-2.6.11-rc1/kernel/kthread.c 2005-01-14 12:36:00 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/kernel/kthread.c 2005-01-15 11:27:52 +0100 @@ -114,7 +114,7 @@ static void keventd_create_kthread(void create->result = ERR_PTR(pid); } else { wait_for_completion(&create->started); - create->result = find_task_by_pid(pid); + create->result = find_task_by_real_pid(pid); } complete(&create->done); } --- linux-2.6.11-rc1/kernel/posix-timers.c 2005-01-14 12:36:00 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/kernel/posix-timers.c 2005-01-15 11:27:52 +0100 @@ -469,7 +470,7 @@ static inline struct task_struct * good_ struct task_struct *rtn = current->group_leader; if ((event->sigev_notify & SIGEV_THREAD_ID ) && - (!(rtn = find_task_by_pid(event->sigev_notify_thread_id)) || + (!(rtn = find_task_by_real_pid(event->sigev_notify_thread_id)) || rtn->tgid != current->tgid || (event->sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_SIGNAL)) return NULL; --- linux-2.6.11-rc1/kernel/sys.c 2005-01-14 12:36:01 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/kernel/sys.c 2005-01-15 12:54:14 +0100 @@ -947,14 +958,17 @@ asmlinkage long sys_setpgid(pid_t pid, p { struct task_struct *p; int err = -EINVAL; + pid_t rpgid; if (!pid) - pid = current->pid; + pid = vx_map_pid(current->pid); if (!pgid) pgid = pid; if (pgid < 0) return -EINVAL; + rpgid = vx_rmap_pid(pgid); + /* From this point forward we keep holding onto the tasklist lock * so that our parent does not change from under us. -DaveM */ --- linux-2.6.11-rc1/kernel/sys.c 2005-01-14 12:36:01 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/kernel/sys.c 2005-01-15 12:54:14 +0100 @@ -989,22 +1003,22 @@ asmlinkage long sys_setpgid(pid_t pid, p if (pgid != pid) { struct task_struct *p; - do_each_task_pid(pgid, PIDTYPE_PGID, p) { + do_each_task_pid(rpgid, PIDTYPE_PGID, p) { if (p->signal->session == current->signal->session) goto ok_pgid; - } while_each_task_pid(pgid, PIDTYPE_PGID, p); + } while_each_task_pid(rpgid, PIDTYPE_PGID, p); goto out; } ok_pgid: - err = security_task_setpgid(p, pgid); + err = security_task_setpgid(p, rpgid); if (err) goto out; - if (process_group(p) != pgid) { + if (process_group(p) != rpgid) { detach_pid(p, PIDTYPE_PGID); - p->signal->pgrp = pgid; - attach_pid(p, PIDTYPE_PGID, pgid); + p->signal->pgrp = rpgid; + attach_pid(p, PIDTYPE_PGID, rpgid); } err = 0; --- linux-2.6.11-rc1/kernel/sys.c 2005-01-14 12:36:01 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/kernel/sys.c 2005-01-15 12:54:14 +0100 @@ -1017,7 +1031,7 @@ out: asmlinkage long sys_getpgid(pid_t pid) { if (!pid) { - return process_group(current); + return vx_rmap_pid(process_group(current)); } else { int retval; struct task_struct *p; --- linux-2.6.11-rc1/kernel/sys.c 2005-01-14 12:36:01 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/kernel/sys.c 2005-01-15 12:54:14 +0100 @@ -1029,7 +1043,7 @@ asmlinkage long sys_getpgid(pid_t pid) if (p) { retval = security_task_getpgid(p); if (!retval) - retval = process_group(p); + retval = vx_rmap_pid(process_group(p)); } read_unlock(&tasklist_lock); return retval; --- linux-2.6.11-rc1/kernel/timer.c 2005-01-14 12:36:01 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/kernel/timer.c 2005-01-15 11:27:52 +0100 @@ -966,7 +976,7 @@ asmlinkage unsigned long sys_alarm(unsig */ asmlinkage long sys_getpid(void) { - return current->tgid; + return vx_map_tgid(current->tgid); } /* --- linux-2.6.11-rc1/kernel/timer.c 2005-01-14 12:36:01 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/kernel/timer.c 2005-01-15 11:27:52 +0100 @@ -1010,7 +1020,7 @@ asmlinkage long sys_getppid(void) #endif break; } - return pid; + return vx_map_pid(pid); } asmlinkage long sys_getuid(void) --- linux-2.6.11-rc1/kernel/timer.c 2005-01-14 12:36:01 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/kernel/timer.c 2005-01-15 11:27:52 +0100 @@ -1218,6 +1228,8 @@ asmlinkage long sys_sysinfo(struct sysin tp.tv_nsec = tp.tv_nsec - NSEC_PER_SEC; tp.tv_sec++; } + if (vx_flags(VXF_VIRT_UPTIME, 0)) + vx_vsi_uptime(&tp, NULL); val.uptime = tp.tv_sec + (tp.tv_nsec ? 1 : 0); val.loads[0] = avenrun[0] << (SI_LOAD_SHIFT - FSHIFT); --- linux-2.6.11-rc1/kernel/timer.c 2005-01-14 12:36:01 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/kernel/timer.c 2005-01-15 11:27:52 +0100 @@ -1227,6 +1239,9 @@ asmlinkage long sys_sysinfo(struct sysin val.procs = nr_threads; } while (read_seqretry(&xtime_lock, seq)); +/* if (vx_flags(VXF_VIRT_CPU, 0)) + vx_vsi_cpu(val); +*/ si_meminfo(&val); si_swapinfo(&val); --- linux-2.6.11-rc1/kernel/vserver/cvirt.c 1970-01-01 01:00:00 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/kernel/vserver/cvirt.c 2005-01-15 11:27:52 +0100 @@ -0,0 +1,97 @@ +/* + * linux/kernel/vserver/cvirt.c + * + * Virtual Server: Context Virtualization + * + * Copyright (C) 2004 Herbert Pötzl + * + * V0.01 broken out from limit.c + * + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + + +void vx_vsi_uptime(struct timespec *uptime, struct timespec *idle) +{ + struct vx_info *vxi = current->vx_info; + + set_normalized_timespec(uptime, + uptime->tv_sec - vxi->cvirt.bias_uptime.tv_sec, + uptime->tv_nsec - vxi->cvirt.bias_uptime.tv_nsec); + if (!idle) + return; + set_normalized_timespec(idle, + idle->tv_sec - vxi->cvirt.bias_idle.tv_sec, + idle->tv_nsec - vxi->cvirt.bias_idle.tv_nsec); + return; +} + +uint64_t vx_idle_jiffies(void) +{ + return init_task.utime + init_task.stime; +} + + + +static inline uint32_t __update_loadavg(uint32_t load, + int wsize, int delta, int n) +{ + unsigned long long calc, prev; + + /* just set it to n */ + if (unlikely(delta >= wsize)) + return (n << FSHIFT); + + calc = delta * n; + calc <<= FSHIFT; + prev = (wsize - delta); + prev *= load; + calc += prev; + do_div(calc, wsize); + return calc; +} + + +void vx_update_load(struct vx_info *vxi) +{ + uint32_t now, last, delta; + unsigned int nr_running, nr_uninterruptible; + unsigned int total; + + spin_lock(&vxi->cvirt.load_lock); + + now = jiffies; + last = vxi->cvirt.load_last; + delta = now - last; + + if (delta < 5*HZ) + goto out; + + nr_running = atomic_read(&vxi->cvirt.nr_running); + nr_uninterruptible = atomic_read(&vxi->cvirt.nr_uninterruptible); + total = nr_running + nr_uninterruptible; + + vxi->cvirt.load[0] = __update_loadavg(vxi->cvirt.load[0], + 60*HZ, delta, total); + vxi->cvirt.load[1] = __update_loadavg(vxi->cvirt.load[1], + 5*60*HZ, delta, total); + vxi->cvirt.load[2] = __update_loadavg(vxi->cvirt.load[2], + 15*60*HZ, delta, total); + + vxi->cvirt.load_last = now; +out: + atomic_inc(&vxi->cvirt.load_updates); + spin_unlock(&vxi->cvirt.load_lock); +} + + + --- linux-2.6.11-rc1/mm/page_alloc.c 2005-01-14 12:36:01 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/mm/page_alloc.c 2005-01-15 15:38:17 +0100 @@ -1092,6 +1093,8 @@ void si_meminfo(struct sysinfo *val) val->freehigh = 0; #endif val->mem_unit = PAGE_SIZE; + if (vx_flags(VXF_VIRT_MEM, 0)) + vx_vsi_meminfo(val); } EXPORT_SYMBOL(si_meminfo); --- linux-2.6.11-rc1/mm/swapfile.c 2005-01-14 12:36:01 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/mm/swapfile.c 2005-01-15 11:27:52 +0100 @@ -1649,6 +1651,8 @@ void si_swapinfo(struct sysinfo *val) val->freeswap = nr_swap_pages + nr_to_be_unused; val->totalswap = total_swap_pages + nr_to_be_unused; swap_list_unlock(); + if (vx_flags(VXF_VIRT_MEM, 0)) + vx_vsi_swapinfo(val); } /* --- linux-2.6.11-rc1/mm/vmscan.c 2005-01-14 12:36:01 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/mm/vmscan.c 2005-01-15 11:27:52 +0100 @@ -1265,7 +1265,7 @@ static int __init kswapd_init(void) swap_setup(); for_each_pgdat(pgdat) pgdat->kswapd - = find_task_by_pid(kernel_thread(kswapd, pgdat, CLONE_KERNEL)); + = find_task_by_real_pid(kernel_thread(kswapd, pgdat, CLONE_KERNEL)); total_memory = nr_free_pagecache_pages(); hotcpu_notifier(cpu_callback, 0); return 0; --- linux-2.6.11-rc1/net/ipv4/netfilter/ipt_owner.c 2004-08-14 12:56:22 +0200 +++ linux-2.6.11-rc1-vs1.9.4-rc2/net/ipv4/netfilter/ipt_owner.c 2005-01-15 11:27:52 +0100 @@ -61,7 +61,7 @@ match_pid(const struct sk_buff *skb, pid int i; read_lock(&tasklist_lock); - p = find_task_by_pid(pid); + p = find_task_by_real_pid(pid); if (!p) goto out; task_lock(p); --- linux-2.6.11-rc1/net/ipv6/netfilter/ip6t_owner.c 2004-12-25 01:55:32 +0100 +++ linux-2.6.11-rc1-vs1.9.4-rc2/net/ipv6/netfilter/ip6t_owner.c 2005-01-15 11:27:52 +0100 @@ -28,7 +28,7 @@ match_pid(const struct sk_buff *skb, pid int i; read_lock(&tasklist_lock); - p = find_task_by_pid(pid); + p = find_task_by_real_pid(pid); if (!p) goto out; task_lock(p);