Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 74997
b: refs/heads/master
c: 8cf32ac
h: refs/heads/master
i:
  74995: ee95474
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Dec 18, 2007
1 parent 1dd94bc commit f76df46
Show file tree
Hide file tree
Showing 55 changed files with 288 additions and 412 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 64396accc2831fcbdc7d793edc25481a5ebc75b2
refs/heads/master: 8cf32ac6578a70025be1103466da9d1d6141429e
4 changes: 4 additions & 0 deletions trunk/Documentation/lguest/lguest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ Running Lguest:
See http://linux-net.osdl.org/index.php/Bridge for general information
on how to get bridging working.

- You can also create an inter-guest network using
"--sharenet=<filename>": any two guests using the same file are on
the same network. This file is created if it does not exist.

There is a helpful mailing list at http://ozlabs.org/mailman/listinfo/lguest

Good luck!
Expand Down
19 changes: 0 additions & 19 deletions trunk/Documentation/sysctl/vm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ Currently, these files are in /proc/sys/vm:
- oom_kill_allocating_task
- mmap_min_address
- numa_zonelist_order
- nr_hugepages
- nr_overcommit_hugepages

==============================================================

Expand Down Expand Up @@ -307,20 +305,3 @@ will select "node" order in following case.

Otherwise, "zone" order will be selected. Default order is recommended unless
this is causing problems for your system/application.

==============================================================

nr_hugepages

Change the minimum size of the hugepage pool.

See Documentation/vm/hugetlbpage.txt

==============================================================

nr_overcommit_hugepages

Change the maximum size of the hugepage pool. The maximum is
nr_hugepages + nr_overcommit_hugepages.

See Documentation/vm/hugetlbpage.txt
35 changes: 6 additions & 29 deletions trunk/Documentation/vm/hugetlbpage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ alignment and size of the arguments to the above system calls.
The output of "cat /proc/meminfo" will have lines like:

.....
HugePages_Total: vvv
HugePages_Free: www
HugePages_Rsvd: xxx
HugePages_Surp: yyy
HugePages_Total: xxx
HugePages_Free: yyy
HugePages_Rsvd: www
Hugepagesize: zzz kB

where:
Expand All @@ -43,10 +42,6 @@ allocated.
HugePages_Rsvd is short for "reserved," and is the number of hugepages
for which a commitment to allocate from the pool has been made, but no
allocation has yet been made. It's vaguely analogous to overcommit.
HugePages_Surp is short for "surplus," and is the number of hugepages in
the pool above the value in /proc/sys/vm/nr_hugepages. The maximum
number of surplus hugepages is controlled by
/proc/sys/vm/nr_overcommit_hugepages.

/proc/filesystems should also show a filesystem of type "hugetlbfs" configured
in the kernel.
Expand Down Expand Up @@ -76,25 +71,7 @@ or failure of allocation depends on the amount of physically contiguous
memory that is preset in system at this time. System administrators may want
to put this command in one of the local rc init files. This will enable the
kernel to request huge pages early in the boot process (when the possibility
of getting physical contiguous pages is still very high). In either
case, adminstrators will want to verify the number of hugepages actually
allocated by checking the sysctl or meminfo.

/proc/sys/vm/nr_overcommit_hugepages indicates how large the pool of
hugepages can grow, if more hugepages than /proc/sys/vm/nr_hugepages are
requested by applications. echo'ing any non-zero value into this file
indicates that the hugetlb subsystem is allowed to try to obtain
hugepages from the buddy allocator, if the normal pool is exhausted. As
these surplus hugepages go out of use, they are freed back to the buddy
allocator.

Caveat: Shrinking the pool via nr_hugepages while a surplus is in effect
will allow the number of surplus huge pages to exceed the overcommit
value, as the pool hugepages (which must have been in use for a surplus
hugepages to be allocated) will become surplus hugepages. As long as
this condition holds, however, no more surplus huge pages will be
allowed on the system until one of the two sysctls are increased
sufficiently, or the surplus huge pages go out of use and are freed.
of getting physical contiguous pages is still very high).

If the user applications are going to request hugepages using mmap system
call, then it is required that system administrator mount a file system of
Expand All @@ -117,8 +94,8 @@ provided on command line then no limits are set. For size and nr_inodes
options, you can use [G|g]/[M|m]/[K|k] to represent giga/mega/kilo. For
example, size=2K has the same meaning as size=2048.

While read system calls are supported on files that reside on hugetlb
file systems, write system calls are not.
read and write system calls are not supported on files that reside on hugetlb
file systems.

Regular chown, chgrp, and chmod commands (with right permissions) could be
used to change the file attributes on hugetlbfs.
Expand Down
10 changes: 5 additions & 5 deletions trunk/arch/alpha/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ LDFLAGS_vmlinux := -static -N #-relax
CHECKFLAGS += -D__alpha__ -m64
cflags-y := -pipe -mno-fp-regs -ffixed-8 -msmall-data

cpuflags-$(CONFIG_ALPHA_EV4) := -mcpu=ev4
cpuflags-$(CONFIG_ALPHA_EV5) := -mcpu=ev5
cpuflags-$(CONFIG_ALPHA_EV56) := -mcpu=ev56
cpuflags-$(CONFIG_ALPHA_EV67) := -mcpu=ev67
cpuflags-$(CONFIG_ALPHA_EV6) := -mcpu=ev6
cpuflags-$(CONFIG_ALPHA_POLARIS) := -mcpu=pca56
cpuflags-$(CONFIG_ALPHA_SX164) := -mcpu=pca56
cpuflags-$(CONFIG_ALPHA_EV6) := -mcpu=ev6
cpuflags-$(CONFIG_ALPHA_EV67) := -mcpu=ev67
cpuflags-$(CONFIG_ALPHA_EV56) := -mcpu=ev56
cpuflags-$(CONFIG_ALPHA_EV5) := -mcpu=ev5
cpuflags-$(CONFIG_ALPHA_EV4) := -mcpu=ev4
# If GENERIC, make sure to turn off any instruction set extensions that
# the host compiler might have on by default. Given that EV4 and EV5
# have the same instruction set, prefer EV5 because an EV5 schedule is
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/alpha/kernel/err_ev7.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ ev7_process_pal_subpacket(struct el_subpacket *header)
struct el_subpacket_handler ev7_pal_subpacket_handler =
SUBPACKET_HANDLER_INIT(EL_CLASS__PAL, ev7_process_pal_subpacket);

void __init
void
ev7_register_error_handlers(void)
{
int i;
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/alpha/kernel/err_marvel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@ marvel_machine_check(u64 vector, u64 la_ptr)
mb();
}

void __init
void
marvel_register_error_handlers(void)
{
ev7_register_error_handlers();
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/alpha/kernel/err_titan.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ static struct el_subpacket_handler titan_subpacket_handler =
SUBPACKET_HANDLER_INIT(EL_CLASS__REGATTA_FAMILY,
el_process_regatta_subpacket);

void __init
void
titan_register_error_handlers(void)
{
size_t i;
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/alpha/kernel/machvec_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
#define __initmv __initdata
#define ALIAS_MV(x)
#else
#define __initmv __initdata_refok
#define __initmv

/* GCC actually has a syntax for defining aliases, but is under some
delusion that you shouldn't be able to declare it extern somewhere
Expand Down
14 changes: 7 additions & 7 deletions trunk/arch/alpha/lib/ev6-stxncpy.S
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,10 @@ $unaligned:

extql t2, a1, t2 # U :
cmpbge zero, t1, t8 # E : is there a zero?
andnot t2, t6, t2 # E : dest mask for a single word copy
andnot t2, t6, t12 # E : dest mask for a single word copy
or t8, t10, t5 # E : test for end-of-count too

cmpbge zero, t2, t3 # E :
cmpbge zero, t12, t3 # E :
cmoveq a2, t5, t8 # E : Latency=2, extra map slot
nop # E : keep with cmoveq
andnot t8, t3, t8 # E : (stall)
Expand All @@ -379,13 +379,13 @@ $unaligned:
negq t8, t6 # E : build bitmask of bytes <= zero
mskqh t1, t4, t1 # U :

and t6, t8, t12 # E :
subq t12, 1, t6 # E : (stall)
or t6, t12, t8 # E : (stall)
zapnot t2, t8, t2 # U : prepare source word; mirror changes (stall)
and t6, t8, t2 # E :
subq t2, 1, t6 # E : (stall)
or t6, t2, t8 # E : (stall)
zapnot t12, t8, t12 # U : prepare source word; mirror changes (stall)

zapnot t1, t8, t1 # U : to source validity mask
andnot t0, t2, t0 # E : zero place for source to reside
andnot t0, t12, t0 # E : zero place for source to reside
or t0, t1, t0 # E : and put it there (stall both t0, t1)
stq_u t0, 0(a0) # L : (stall)

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/alpha/lib/strncpy.S
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ strncpy:

or $3, $24, $3 # clear the bits between the last
or $4, $27, $4 # written byte and the last byte in COUNT
andnot $3, $4, $4
andnot $4, $3, $4
zap $1, $4, $1

stq_u $1, 0($16)
Expand Down
14 changes: 7 additions & 7 deletions trunk/arch/alpha/lib/stxncpy.S
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,9 @@ $unaligned:

extql t2, a1, t2 # e0 :
cmpbge zero, t1, t8 # .. e1 : is there a zero?
andnot t2, t6, t2 # e0 : dest mask for a single word copy
andnot t2, t6, t12 # e0 : dest mask for a single word copy
or t8, t10, t5 # .. e1 : test for end-of-count too
cmpbge zero, t2, t3 # e0 :
cmpbge zero, t12, t3 # e0 :
cmoveq a2, t5, t8 # .. e1 :
andnot t8, t3, t8 # e0 :
beq t8, $u_head # .. e1 (zdb)
Expand All @@ -330,14 +330,14 @@ $unaligned:
ldq_u t0, 0(a0) # e0 :
negq t8, t6 # .. e1 : build bitmask of bytes <= zero
mskqh t1, t4, t1 # e0 :
and t6, t8, t12 # .. e1 :
subq t12, 1, t6 # e0 :
or t6, t12, t8 # e1 :
and t6, t8, t2 # .. e1 :
subq t2, 1, t6 # e0 :
or t6, t2, t8 # e1 :

zapnot t2, t8, t2 # e0 : prepare source word; mirror changes
zapnot t12, t8, t12 # e0 : prepare source word; mirror changes
zapnot t1, t8, t1 # .. e1 : to source validity mask

andnot t0, t2, t0 # e0 : zero place for source to reside
andnot t0, t12, t0 # e0 : zero place for source to reside
or t0, t1, t0 # e1 : and put it there
stq_u t0, 0(a0) # e0 :
ret (t9) # .. e1 :
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/um/drivers/net_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ static int change_tramp(char **argv, char *output, int output_len)
close(fds[1]);

if (pid > 0)
helper_wait(pid, 0, "change_tramp");
CATCH_EINTR(err = waitpid(pid, NULL, 0));
return pid;
}

Expand Down
12 changes: 10 additions & 2 deletions trunk/arch/um/drivers/slip_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static int slip_tramp(char **argv, int fd)
{
struct slip_pre_exec_data pe_data;
char *output;
int pid, fds[2], err, output_len;
int status, pid, fds[2], err, output_len;

err = os_pipe(fds, 1, 0);
if (err < 0) {
Expand Down Expand Up @@ -109,7 +109,15 @@ static int slip_tramp(char **argv, int fd)
read_output(fds[0], output, output_len);
printk("%s", output);

err = helper_wait(pid, 0, argv[0]);
CATCH_EINTR(err = waitpid(pid, &status, 0));
if (err < 0)
err = errno;
else if (!WIFEXITED(status) || (WEXITSTATUS(status) != 0)) {
printk(UM_KERN_ERR "'%s' didn't exit with status 0\n", argv[0]);
err = -EINVAL;
}
else err = 0;

close(fds[0]);

out_free:
Expand Down
15 changes: 12 additions & 3 deletions trunk/arch/um/drivers/slirp_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static int slirp_open(void *data)
static void slirp_close(int fd, void *data)
{
struct slirp_data *pri = data;
int err;
int status,err;

close(fd);
close(pri->slave);
Expand All @@ -98,9 +98,18 @@ static void slirp_close(int fd, void *data)
"(%d)\n", pri->pid, errno);
}
#endif
err = helper_wait(pri->pid, 1, "slirp_close");
if (err < 0)

CATCH_EINTR(err = waitpid(pri->pid, &status, WNOHANG));
if (err < 0) {
printk(UM_KERN_ERR "slirp_close: waitpid returned %d\n", errno);
return;
}

if (err == 0) {
printk(UM_KERN_ERR "slirp_close: process %d has not exited\n",
pri->pid);
return;
}

pri->pid = -1;
}
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/um/drivers/ubd_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ int start_io_thread(unsigned long sp, int *fd_out)
goto out_close;
}

pid = clone(io_thread, (void *) sp, CLONE_FILES | CLONE_VM, NULL);
pid = clone(io_thread, (void *) sp, CLONE_FILES | CLONE_VM | SIGCHLD,
NULL);
if(pid < 0){
err = -errno;
printk("start_io_thread - clone failed : errno = %d\n", errno);
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/um/include/os.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ extern int execvp_noalloc(char *buf, const char *file, char *const argv[]);
extern int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv);
extern int run_helper_thread(int (*proc)(void *), void *arg,
unsigned int flags, unsigned long *stack_out);
extern int helper_wait(int pid, int nohang, char *pname);
extern int helper_wait(int pid);


/* tls.c */
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/um/os-Linux/aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ static int init_aio_24(void)
goto out_close_pipe;

err = run_helper_thread(not_aio_thread, NULL,
CLONE_FILES | CLONE_VM, &aio_stack);
CLONE_FILES | CLONE_VM | SIGCHLD, &aio_stack);
if (err < 0)
goto out_close_pipe;

Expand Down Expand Up @@ -254,7 +254,7 @@ static int init_aio_26(void)
}

err = run_helper_thread(aio_thread, NULL,
CLONE_FILES | CLONE_VM, &aio_stack);
CLONE_FILES | CLONE_VM | SIGCHLD, &aio_stack);
if (err < 0)
return err;

Expand Down
10 changes: 8 additions & 2 deletions trunk/arch/um/os-Linux/drivers/ethertap_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static int etap_tramp(char *dev, char *gate, int control_me,
int control_remote, int data_me, int data_remote)
{
struct etap_pre_exec_data pe_data;
int pid, err, n;
int pid, status, err, n;
char version_buf[sizeof("nnnnn\0")];
char data_fd_buf[sizeof("nnnnnn\0")];
char gate_buf[sizeof("nnn.nnn.nnn.nnn\0")];
Expand Down Expand Up @@ -131,7 +131,13 @@ static int etap_tramp(char *dev, char *gate, int control_me,
}
if (c != 1) {
printk(UM_KERN_ERR "etap_tramp : uml_net failed\n");
err = helper_wait(pid, 0, "uml_net");
err = -EINVAL;
CATCH_EINTR(n = waitpid(pid, &status, 0));
if (n < 0)
err = -errno;
else if (!WIFEXITED(status) || (WEXITSTATUS(status) != 1))
printk(UM_KERN_ERR "uml_net didn't exit with "
"status 1\n");
}
return err;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/um/os-Linux/drivers/tuntap_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static int tuntap_open_tramp(char *gate, int *fd_out, int me, int remote,
"errno = %d\n", errno);
return err;
}
helper_wait(pid, 0, "tuntap_open_tramp");
CATCH_EINTR(waitpid(pid, NULL, 0));

cmsg = CMSG_FIRSTHDR(&msg);
if (cmsg == NULL) {
Expand Down
Loading

0 comments on commit f76df46

Please sign in to comment.