Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
306950a3
Commit
306950a3
authored
Jan 11, 2005
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://gkernel.bkbits.net/net-drivers-2.6
into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents
594315ad
1eb0b69c
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
140 additions
and
43 deletions
+140
-43
arch/mips/kernel/irixelf.c
arch/mips/kernel/irixelf.c
+10
-1
arch/sparc64/kernel/binfmt_aout32.c
arch/sparc64/kernel/binfmt_aout32.c
+12
-0
arch/x86_64/ia32/ia32_aout.c
arch/x86_64/ia32/ia32_aout.c
+11
-1
arch/x86_64/mm/k8topology.c
arch/x86_64/mm/k8topology.c
+14
-9
arch/x86_64/mm/numa.c
arch/x86_64/mm/numa.c
+4
-6
arch/x86_64/mm/srat.c
arch/x86_64/mm/srat.c
+11
-8
drivers/scsi/sata_sil.c
drivers/scsi/sata_sil.c
+2
-0
fs/binfmt_aout.c
fs/binfmt_aout.c
+14
-3
fs/binfmt_elf.c
fs/binfmt_elf.c
+11
-1
include/asm-x86_64/numa.h
include/asm-x86_64/numa.h
+1
-1
include/linux/nodemask.h
include/linux/nodemask.h
+9
-0
mm/mmap.c
mm/mmap.c
+41
-13
No files found.
arch/mips/kernel/irixelf.c
View file @
306950a3
...
...
@@ -127,7 +127,9 @@ static void set_brk(unsigned long start, unsigned long end)
end
=
PAGE_ALIGN
(
end
);
if
(
end
<=
start
)
return
;
down_write
(
&
current
->
mm
->
mmap_sem
);
do_brk
(
start
,
end
-
start
);
up_write
(
&
current
->
mm
->
mmap_sem
);
}
...
...
@@ -375,7 +377,9 @@ static unsigned int load_irix_interp(struct elfhdr * interp_elf_ex,
/* Map the last of the bss segment */
if
(
last_bss
>
len
)
{
down_write
(
&
current
->
mm
->
mmap_sem
);
do_brk
(
len
,
(
last_bss
-
len
));
up_write
(
&
current
->
mm
->
mmap_sem
);
}
kfree
(
elf_phdata
);
...
...
@@ -562,7 +566,9 @@ void irix_map_prda_page (void)
unsigned
long
v
;
struct
prda
*
pp
;
down_write
(
&
current
->
mm
->
mmap_sem
);
v
=
do_brk
(
PRDA_ADDRESS
,
PAGE_SIZE
);
up_write
(
&
current
->
mm
->
mmap_sem
);
if
(
v
<
0
)
return
;
...
...
@@ -852,8 +858,11 @@ static int load_irix_library(struct file *file)
len
=
(
elf_phdata
->
p_filesz
+
elf_phdata
->
p_vaddr
+
0xfff
)
&
0xfffff000
;
bss
=
elf_phdata
->
p_memsz
+
elf_phdata
->
p_vaddr
;
if
(
bss
>
len
)
if
(
bss
>
len
)
{
down_write
(
&
current
->
mm
->
mmap_sem
);
do_brk
(
len
,
bss
-
len
);
up_write
(
&
current
->
mm
->
mmap_sem
);
}
kfree
(
elf_phdata
);
return
0
;
}
...
...
arch/sparc64/kernel/binfmt_aout32.c
View file @
306950a3
...
...
@@ -49,7 +49,9 @@ static void set_brk(unsigned long start, unsigned long end)
end
=
PAGE_ALIGN
(
end
);
if
(
end
<=
start
)
return
;
down_write
(
&
current
->
mm
->
mmap_sem
);
do_brk
(
start
,
end
-
start
);
up_write
(
&
current
->
mm
->
mmap_sem
);
}
/*
...
...
@@ -246,10 +248,14 @@ static int load_aout32_binary(struct linux_binprm * bprm, struct pt_regs * regs)
if
(
N_MAGIC
(
ex
)
==
NMAGIC
)
{
loff_t
pos
=
fd_offset
;
/* Fuck me plenty... */
down_write
(
&
current
->
mm
->
mmap_sem
);
error
=
do_brk
(
N_TXTADDR
(
ex
),
ex
.
a_text
);
up_write
(
&
current
->
mm
->
mmap_sem
);
bprm
->
file
->
f_op
->
read
(
bprm
->
file
,
(
char
__user
*
)
N_TXTADDR
(
ex
),
ex
.
a_text
,
&
pos
);
down_write
(
&
current
->
mm
->
mmap_sem
);
error
=
do_brk
(
N_DATADDR
(
ex
),
ex
.
a_data
);
up_write
(
&
current
->
mm
->
mmap_sem
);
bprm
->
file
->
f_op
->
read
(
bprm
->
file
,
(
char
__user
*
)
N_DATADDR
(
ex
),
ex
.
a_data
,
&
pos
);
goto
beyond_if
;
...
...
@@ -257,8 +263,10 @@ static int load_aout32_binary(struct linux_binprm * bprm, struct pt_regs * regs)
if
(
N_MAGIC
(
ex
)
==
OMAGIC
)
{
loff_t
pos
=
fd_offset
;
down_write
(
&
current
->
mm
->
mmap_sem
);
do_brk
(
N_TXTADDR
(
ex
)
&
PAGE_MASK
,
ex
.
a_text
+
ex
.
a_data
+
PAGE_SIZE
-
1
);
up_write
(
&
current
->
mm
->
mmap_sem
);
bprm
->
file
->
f_op
->
read
(
bprm
->
file
,
(
char
__user
*
)
N_TXTADDR
(
ex
),
ex
.
a_text
+
ex
.
a_data
,
&
pos
);
}
else
{
...
...
@@ -272,7 +280,9 @@ static int load_aout32_binary(struct linux_binprm * bprm, struct pt_regs * regs)
if
(
!
bprm
->
file
->
f_op
->
mmap
)
{
loff_t
pos
=
fd_offset
;
down_write
(
&
current
->
mm
->
mmap_sem
);
do_brk
(
0
,
ex
.
a_text
+
ex
.
a_data
);
up_write
(
&
current
->
mm
->
mmap_sem
);
bprm
->
file
->
f_op
->
read
(
bprm
->
file
,
(
char
__user
*
)
N_TXTADDR
(
ex
),
ex
.
a_text
+
ex
.
a_data
,
&
pos
);
...
...
@@ -389,7 +399,9 @@ static int load_aout32_library(struct file *file)
len
=
PAGE_ALIGN
(
ex
.
a_text
+
ex
.
a_data
);
bss
=
ex
.
a_text
+
ex
.
a_data
+
ex
.
a_bss
;
if
(
bss
>
len
)
{
down_write
(
&
current
->
mm
->
mmap_sem
);
error
=
do_brk
(
start_addr
+
len
,
bss
-
len
);
up_write
(
&
current
->
mm
->
mmap_sem
);
retval
=
error
;
if
(
error
!=
start_addr
+
len
)
goto
out
;
...
...
arch/x86_64/ia32/ia32_aout.c
View file @
306950a3
...
...
@@ -115,7 +115,9 @@ static void set_brk(unsigned long start, unsigned long end)
end
=
PAGE_ALIGN
(
end
);
if
(
end
<=
start
)
return
;
down_write
(
&
current
->
mm
->
mmap_sem
);
do_brk
(
start
,
end
-
start
);
up_write
(
&
current
->
mm
->
mmap_sem
);
}
#if CORE_DUMP
...
...
@@ -325,7 +327,10 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
pos
=
32
;
map_size
=
ex
.
a_text
+
ex
.
a_data
;
down_write
(
&
current
->
mm
->
mmap_sem
);
error
=
do_brk
(
text_addr
&
PAGE_MASK
,
map_size
);
up_write
(
&
current
->
mm
->
mmap_sem
);
if
(
error
!=
(
text_addr
&
PAGE_MASK
))
{
send_sig
(
SIGKILL
,
current
,
0
);
return
error
;
...
...
@@ -361,7 +366,9 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
if
(
!
bprm
->
file
->
f_op
->
mmap
||
((
fd_offset
&
~
PAGE_MASK
)
!=
0
))
{
loff_t
pos
=
fd_offset
;
down_write
(
&
current
->
mm
->
mmap_sem
);
do_brk
(
N_TXTADDR
(
ex
),
ex
.
a_text
+
ex
.
a_data
);
up_write
(
&
current
->
mm
->
mmap_sem
);
bprm
->
file
->
f_op
->
read
(
bprm
->
file
,(
char
*
)
N_TXTADDR
(
ex
),
ex
.
a_text
+
ex
.
a_data
,
&
pos
);
flush_icache_range
((
unsigned
long
)
N_TXTADDR
(
ex
),
...
...
@@ -469,8 +476,9 @@ static int load_aout_library(struct file *file)
error_time
=
jiffies
;
}
#endif
down_write
(
&
current
->
mm
->
mmap_sem
);
do_brk
(
start_addr
,
ex
.
a_text
+
ex
.
a_data
+
ex
.
a_bss
);
up_write
(
&
current
->
mm
->
mmap_sem
);
file
->
f_op
->
read
(
file
,
(
char
*
)
start_addr
,
ex
.
a_text
+
ex
.
a_data
,
&
pos
);
...
...
@@ -494,7 +502,9 @@ static int load_aout_library(struct file *file)
len
=
PAGE_ALIGN
(
ex
.
a_text
+
ex
.
a_data
);
bss
=
ex
.
a_text
+
ex
.
a_data
+
ex
.
a_bss
;
if
(
bss
>
len
)
{
down_write
(
&
current
->
mm
->
mmap_sem
);
error
=
do_brk
(
start_addr
+
len
,
bss
-
len
);
up_write
(
&
current
->
mm
->
mmap_sem
);
retval
=
error
;
if
(
error
!=
start_addr
+
len
)
goto
out
;
...
...
arch/x86_64/mm/k8topology.c
View file @
306950a3
...
...
@@ -47,6 +47,10 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
int
nodeid
,
i
,
nb
;
int
found
=
0
;
u32
reg
;
unsigned
numnodes
;
nodemask_t
nodes_parsed
;
nodes_clear
(
nodes_parsed
);
nb
=
find_northbridge
();
if
(
nb
<
0
)
...
...
@@ -55,10 +59,9 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
printk
(
KERN_INFO
"Scanning NUMA topology in Northbridge %d
\n
"
,
nb
);
reg
=
read_pci_config
(
0
,
nb
,
0
,
0x60
);
for
(
i
=
0
;
i
<=
((
reg
>>
4
)
&
7
);
i
++
)
node_set_online
(
i
);
numnodes
=
((
reg
>>
4
)
&
7
)
+
1
;
printk
(
KERN_INFO
"Number of nodes %d
(%x)
\n
"
,
num_online_nodes
(),
reg
);
printk
(
KERN_INFO
"Number of nodes %d
\n
"
,
numnodes
);
memset
(
&
nodes
,
0
,
sizeof
(
nodes
));
prevbase
=
0
;
...
...
@@ -70,11 +73,11 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
nodeid
=
limit
&
7
;
if
((
base
&
3
)
==
0
)
{
if
(
i
<
num
_online_nodes
()
)
if
(
i
<
num
nodes
)
printk
(
"Skipping disabled node %d
\n
"
,
i
);
continue
;
}
if
(
nodeid
>=
num
_online_nodes
()
)
{
if
(
nodeid
>=
num
nodes
)
{
printk
(
"Ignoring excess node %d (%lx:%lx)
\n
"
,
nodeid
,
base
,
limit
);
continue
;
...
...
@@ -90,7 +93,7 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
nodeid
,
(
base
>>
8
)
&
3
,
(
limit
>>
8
)
&
3
);
return
-
1
;
}
if
(
node_
online
(
nodei
d
))
{
if
(
node_
isset
(
nodeid
,
nodes_parse
d
))
{
printk
(
KERN_INFO
"Node %d already present. Skipping
\n
"
,
nodeid
);
continue
;
...
...
@@ -138,12 +141,14 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
nodes
[
nodeid
].
end
=
limit
;
prevbase
=
base
;
node_set
(
nodeid
,
nodes_parsed
);
}
if
(
!
found
)
return
-
1
;
memnode_shift
=
compute_hash_shift
(
nodes
);
memnode_shift
=
compute_hash_shift
(
nodes
,
numnodes
);
if
(
memnode_shift
<
0
)
{
printk
(
KERN_ERR
"No NUMA node hash function found. Contact maintainer
\n
"
);
return
-
1
;
...
...
@@ -154,8 +159,8 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
if
(
nodes
[
i
].
start
!=
nodes
[
i
].
end
)
{
/* assume 1:1 NODE:CPU */
cpu_to_node
[
i
]
=
i
;
setup_node_bootmem
(
i
,
nodes
[
i
].
start
,
nodes
[
i
].
end
);
}
setup_node_bootmem
(
i
,
nodes
[
i
].
start
,
nodes
[
i
].
end
);
}
}
numa_init_array
();
...
...
arch/x86_64/mm/numa.c
View file @
306950a3
...
...
@@ -34,9 +34,7 @@ cpumask_t node_to_cpumask[MAX_NUMNODES];
int
numa_off
__initdata
;
unsigned
long
nodes_present
;
int
__init
compute_hash_shift
(
struct
node
*
nodes
)
int
__init
compute_hash_shift
(
struct
node
*
nodes
,
int
numnodes
)
{
int
i
;
int
shift
=
24
;
...
...
@@ -45,7 +43,7 @@ int __init compute_hash_shift(struct node *nodes)
/* When in doubt use brute force. */
while
(
shift
<
48
)
{
memset
(
memnodemap
,
0xff
,
sizeof
(
*
memnodemap
)
*
NODEMAPSIZE
);
for
_each_online_node
(
i
)
{
for
(
i
=
0
;
i
<
numnodes
;
i
++
)
{
if
(
nodes
[
i
].
start
==
nodes
[
i
].
end
)
continue
;
for
(
addr
=
nodes
[
i
].
start
;
...
...
@@ -197,7 +195,7 @@ static int numa_emulation(unsigned long start_pfn, unsigned long end_pfn)
(
nodes
[
i
].
end
-
nodes
[
i
].
start
)
>>
20
);
node_set_online
(
i
);
}
memnode_shift
=
compute_hash_shift
(
nodes
);
memnode_shift
=
compute_hash_shift
(
nodes
,
numa_fake
);
if
(
memnode_shift
<
0
)
{
memnode_shift
=
0
;
printk
(
KERN_ERR
"No NUMA hash function found. Emulation disabled.
\n
"
);
...
...
@@ -274,7 +272,7 @@ void __init paging_init(void)
/* [numa=off] */
__init
int
numa_setup
(
char
*
opt
)
{
if
(
!
str
cmp
(
opt
,
"off"
))
if
(
!
str
ncmp
(
opt
,
"off"
,
3
))
numa_off
=
1
;
#ifdef CONFIG_NUMA_EMU
if
(
!
strncmp
(
opt
,
"fake="
,
5
))
{
...
...
arch/x86_64/mm/srat.c
View file @
306950a3
...
...
@@ -20,17 +20,20 @@
static
struct
acpi_table_slit
*
acpi_slit
;
static
DECLARE_BITMAP
(
nodes_parsed
,
MAX_NUMNODES
)
__initdata
;
static
nodemask_t
nodes_parsed
__initdata
;
static
nodemask_t
nodes_found
__initdata
;
static
struct
node
nodes
[
MAX_NUMNODES
]
__initdata
;
static
__u8
pxm2node
[
256
]
__initdata
=
{
[
0
...
255
]
=
0xff
};
static
__init
int
setup_node
(
int
pxm
)
{
if
(
pxm2node
[
pxm
]
==
0xff
)
{
if
(
num_online_nodes
()
>=
MAX_NUMNODES
)
unsigned
node
=
pxm2node
[
pxm
];
if
(
node
==
0xff
)
{
if
(
nodes_weight
(
nodes_found
)
>=
MAX_NUMNODES
)
return
-
1
;
pxm2node
[
pxm
]
=
num_online_nodes
();
node_set_online
(
num_online_nodes
());
node
=
first_unset_node
(
nodes_found
);
node_set
(
node
,
nodes_found
);
pxm2node
[
pxm
]
=
node
;
}
return
pxm2node
[
pxm
];
}
...
...
@@ -140,7 +143,7 @@ acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma)
return
;
}
nd
=
&
nodes
[
node
];
if
(
!
test_and_set_bit
(
node
,
&
nodes_parsed
))
{
if
(
!
node_test_and_set
(
node
,
nodes_parsed
))
{
nd
->
start
=
start
;
nd
->
end
=
end
;
}
else
{
...
...
@@ -163,7 +166,7 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
int
i
;
if
(
acpi_numa
<=
0
)
return
-
1
;
memnode_shift
=
compute_hash_shift
(
nodes
);
memnode_shift
=
compute_hash_shift
(
nodes
,
nodes_weight
(
nodes_parsed
)
);
if
(
memnode_shift
<
0
)
{
printk
(
KERN_ERR
"SRAT: No NUMA node hash function found. Contact maintainer
\n
"
);
...
...
@@ -171,7 +174,7 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
return
-
1
;
}
for
(
i
=
0
;
i
<
MAX_NUMNODES
;
i
++
)
{
if
(
!
test_bit
(
i
,
&
nodes_parsed
))
if
(
!
node_isset
(
i
,
nodes_parsed
))
continue
;
cutoff_node
(
i
,
start
,
end
);
if
(
nodes
[
i
].
start
==
nodes
[
i
].
end
)
...
...
drivers/scsi/sata_sil.c
View file @
306950a3
...
...
@@ -71,6 +71,8 @@ static struct pci_device_id sil_pci_tbl[] = {
{
0x1095
,
0x0240
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
sil_3112
},
{
0x1095
,
0x3512
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
sil_3112
},
{
0x1095
,
0x3114
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
sil_3114
},
{
0x1002
,
0x436e
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
sil_3112
},
{
0x1002
,
0x4379
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
sil_3112
},
{
}
/* terminate list */
};
...
...
fs/binfmt_aout.c
View file @
306950a3
...
...
@@ -50,7 +50,10 @@ static int set_brk(unsigned long start, unsigned long end)
start
=
PAGE_ALIGN
(
start
);
end
=
PAGE_ALIGN
(
end
);
if
(
end
>
start
)
{
unsigned
long
addr
=
do_brk
(
start
,
end
-
start
);
unsigned
long
addr
;
down_write
(
&
current
->
mm
->
mmap_sem
);
addr
=
do_brk
(
start
,
end
-
start
);
up_write
(
&
current
->
mm
->
mmap_sem
);
if
(
BAD_ADDR
(
addr
))
return
addr
;
}
...
...
@@ -323,10 +326,14 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
loff_t
pos
=
fd_offset
;
/* Fuck me plenty... */
/* <AOL></AOL> */
down_write
(
&
current
->
mm
->
mmap_sem
);
error
=
do_brk
(
N_TXTADDR
(
ex
),
ex
.
a_text
);
up_write
(
&
current
->
mm
->
mmap_sem
);
bprm
->
file
->
f_op
->
read
(
bprm
->
file
,
(
char
*
)
N_TXTADDR
(
ex
),
ex
.
a_text
,
&
pos
);
down_write
(
&
current
->
mm
->
mmap_sem
);
error
=
do_brk
(
N_DATADDR
(
ex
),
ex
.
a_data
);
up_write
(
&
current
->
mm
->
mmap_sem
);
bprm
->
file
->
f_op
->
read
(
bprm
->
file
,
(
char
*
)
N_DATADDR
(
ex
),
ex
.
a_data
,
&
pos
);
goto
beyond_if
;
...
...
@@ -346,8 +353,9 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
pos
=
32
;
map_size
=
ex
.
a_text
+
ex
.
a_data
;
#endif
down_write
(
&
current
->
mm
->
mmap_sem
);
error
=
do_brk
(
text_addr
&
PAGE_MASK
,
map_size
);
up_write
(
&
current
->
mm
->
mmap_sem
);
if
(
error
!=
(
text_addr
&
PAGE_MASK
))
{
send_sig
(
SIGKILL
,
current
,
0
);
return
error
;
...
...
@@ -382,7 +390,9 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
if
(
!
bprm
->
file
->
f_op
->
mmap
||
((
fd_offset
&
~
PAGE_MASK
)
!=
0
))
{
loff_t
pos
=
fd_offset
;
down_write
(
&
current
->
mm
->
mmap_sem
);
do_brk
(
N_TXTADDR
(
ex
),
ex
.
a_text
+
ex
.
a_data
);
up_write
(
&
current
->
mm
->
mmap_sem
);
bprm
->
file
->
f_op
->
read
(
bprm
->
file
,
(
char
__user
*
)
N_TXTADDR
(
ex
),
ex
.
a_text
+
ex
.
a_data
,
&
pos
);
...
...
@@ -487,8 +497,9 @@ static int load_aout_library(struct file *file)
file
->
f_dentry
->
d_name
.
name
);
error_time
=
jiffies
;
}
down_write
(
&
current
->
mm
->
mmap_sem
);
do_brk
(
start_addr
,
ex
.
a_text
+
ex
.
a_data
+
ex
.
a_bss
);
up_write
(
&
current
->
mm
->
mmap_sem
);
file
->
f_op
->
read
(
file
,
(
char
__user
*
)
start_addr
,
ex
.
a_text
+
ex
.
a_data
,
&
pos
);
...
...
fs/binfmt_elf.c
View file @
306950a3
...
...
@@ -88,7 +88,10 @@ static int set_brk(unsigned long start, unsigned long end)
start
=
ELF_PAGEALIGN
(
start
);
end
=
ELF_PAGEALIGN
(
end
);
if
(
end
>
start
)
{
unsigned
long
addr
=
do_brk
(
start
,
end
-
start
);
unsigned
long
addr
;
down_write
(
&
current
->
mm
->
mmap_sem
);
addr
=
do_brk
(
start
,
end
-
start
);
up_write
(
&
current
->
mm
->
mmap_sem
);
if
(
BAD_ADDR
(
addr
))
return
addr
;
}
...
...
@@ -409,7 +412,9 @@ static unsigned long load_elf_interp(struct elfhdr * interp_elf_ex,
/* Map the last of the bss segment */
if
(
last_bss
>
elf_bss
)
{
down_write
(
&
current
->
mm
->
mmap_sem
);
error
=
do_brk
(
elf_bss
,
last_bss
-
elf_bss
);
up_write
(
&
current
->
mm
->
mmap_sem
);
if
(
BAD_ADDR
(
error
))
goto
out_close
;
}
...
...
@@ -449,7 +454,9 @@ static unsigned long load_aout_interp(struct exec * interp_ex,
goto
out
;
}
down_write
(
&
current
->
mm
->
mmap_sem
);
do_brk
(
0
,
text_data
);
up_write
(
&
current
->
mm
->
mmap_sem
);
if
(
!
interpreter
->
f_op
||
!
interpreter
->
f_op
->
read
)
goto
out
;
if
(
interpreter
->
f_op
->
read
(
interpreter
,
addr
,
text_data
,
&
offset
)
<
0
)
...
...
@@ -457,8 +464,11 @@ static unsigned long load_aout_interp(struct exec * interp_ex,
flush_icache_range
((
unsigned
long
)
addr
,
(
unsigned
long
)
addr
+
text_data
);
down_write
(
&
current
->
mm
->
mmap_sem
);
do_brk
(
ELF_PAGESTART
(
text_data
+
ELF_MIN_ALIGN
-
1
),
interp_ex
->
a_bss
);
up_write
(
&
current
->
mm
->
mmap_sem
);
elf_entry
=
interp_ex
->
a_entry
;
out:
...
...
include/asm-x86_64/numa.h
View file @
306950a3
...
...
@@ -8,7 +8,7 @@ struct node {
u64
start
,
end
;
};
extern
int
compute_hash_shift
(
struct
node
*
nodes
);
extern
int
compute_hash_shift
(
struct
node
*
nodes
,
int
numnodes
);
#define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT))
...
...
include/linux/nodemask.h
View file @
306950a3
...
...
@@ -38,6 +38,8 @@
*
* int first_node(mask) Number lowest set bit, or MAX_NUMNODES
* int next_node(node, mask) Next node past 'node', or MAX_NUMNODES
* int first_unset_node(mask) First node not set in mask, or
* MAX_NUMNODES.
*
* nodemask_t nodemask_of_node(node) Return nodemask with bit 'node' set
* NODE_MASK_ALL Initializer - all bits set
...
...
@@ -235,6 +237,13 @@ static inline int __next_node(int n, const nodemask_t *srcp, int nbits)
m; \
})
#define first_unset_node(mask) __first_unset_node(&(mask))
static
inline
int
__first_unset_node
(
const
nodemask_t
*
maskp
)
{
return
min_t
(
int
,
MAX_NUMNODES
,
find_first_zero_bit
(
maskp
->
bits
,
MAX_NUMNODES
));
}
#define NODE_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(MAX_NUMNODES)
#if MAX_NUMNODES <= BITS_PER_LONG
...
...
mm/mmap.c
View file @
306950a3
...
...
@@ -1475,7 +1475,6 @@ static int acct_stack_growth(struct vm_area_struct * vma, unsigned long size, un
int
expand_stack
(
struct
vm_area_struct
*
vma
,
unsigned
long
address
)
{
int
error
;
unsigned
long
size
,
grow
;
if
(
!
(
vma
->
vm_flags
&
VM_GROWSUP
))
return
-
EFAULT
;
...
...
@@ -1495,12 +1494,19 @@ int expand_stack(struct vm_area_struct * vma, unsigned long address)
*/
address
+=
4
+
PAGE_SIZE
-
1
;
address
&=
PAGE_MASK
;
size
=
address
-
vma
->
vm_start
;
grow
=
(
address
-
vma
->
vm_end
)
>>
PAGE_SHIFT
;
error
=
0
;
error
=
acct_stack_growth
(
vma
,
size
,
grow
);
if
(
!
error
)
vma
->
vm_end
=
address
;
/* Somebody else might have raced and expanded it already */
if
(
address
>
vma
->
vm_end
)
{
unsigned
long
size
,
grow
;
size
=
address
-
vma
->
vm_start
;
grow
=
(
address
-
vma
->
vm_end
)
>>
PAGE_SHIFT
;
error
=
acct_stack_growth
(
vma
,
size
,
grow
);
if
(
!
error
)
vma
->
vm_end
=
address
;
}
anon_vma_unlock
(
vma
);
return
error
;
}
...
...
@@ -1528,7 +1534,6 @@ find_extend_vma(struct mm_struct *mm, unsigned long addr)
int
expand_stack
(
struct
vm_area_struct
*
vma
,
unsigned
long
address
)
{
int
error
;
unsigned
long
size
,
grow
;
/*
* We must make sure the anon_vma is allocated
...
...
@@ -1544,13 +1549,20 @@ int expand_stack(struct vm_area_struct *vma, unsigned long address)
* anon_vma lock to serialize against concurrent expand_stacks.
*/
address
&=
PAGE_MASK
;
size
=
vma
->
vm_end
-
address
;
grow
=
(
vma
->
vm_start
-
address
)
>>
PAGE_SHIFT
;
error
=
0
;
/* Somebody else might have raced and expanded it already */
if
(
address
<
vma
->
vm_start
)
{
unsigned
long
size
,
grow
;
error
=
acct_stack_growth
(
vma
,
size
,
grow
);
if
(
!
error
)
{
vma
->
vm_start
=
address
;
vma
->
vm_pgoff
-=
grow
;
size
=
vma
->
vm_end
-
address
;
grow
=
(
vma
->
vm_start
-
address
)
>>
PAGE_SHIFT
;
error
=
acct_stack_growth
(
vma
,
size
,
grow
);
if
(
!
error
)
{
vma
->
vm_start
=
address
;
vma
->
vm_pgoff
-=
grow
;
}
}
anon_vma_unlock
(
vma
);
return
error
;
...
...
@@ -1858,6 +1870,16 @@ asmlinkage long sys_munmap(unsigned long addr, size_t len)
return
ret
;
}
static
inline
void
verify_mm_writelocked
(
struct
mm_struct
*
mm
)
{
#ifdef CONFIG_DEBUG_KERNEL
if
(
unlikely
(
down_read_trylock
(
&
mm
->
mmap_sem
)))
{
WARN_ON
(
1
);
up_read
(
&
mm
->
mmap_sem
);
}
#endif
}
/*
* this is really a simplified "do_mmap". it only handles
* anonymous maps. eventually we may be able to do some
...
...
@@ -1890,6 +1912,12 @@ unsigned long do_brk(unsigned long addr, unsigned long len)
return
-
EAGAIN
;
}
/*
* mm->mmap_sem is required to protect against another thread
* changing the mappings in case we sleep.
*/
verify_mm_writelocked
(
mm
);
/*
* Clear old maps. this also does some error checking for us
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment