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
nexedi
linux
Commits
61a9bb47
Commit
61a9bb47
authored
Feb 21, 2002
by
Richard Henderson
Browse files
Options
Browse Files
Download
Plain Diff
Merge
ssh://are.twiddle.net/BK/axp-2.5
into fidel.sfbay.redhat.com:/fidel/ity/rth/linux/linus-2.5
parents
eac94688
8d645041
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
71 additions
and
124 deletions
+71
-124
arch/alpha/kernel/core_irongate.c
arch/alpha/kernel/core_irongate.c
+1
-1
arch/alpha/kernel/process.c
arch/alpha/kernel/process.c
+0
-1
arch/alpha/mm/init.c
arch/alpha/mm/init.c
+18
-25
fs/nfsd/nfsctl.c
fs/nfsd/nfsctl.c
+1
-0
include/asm-alpha/pgalloc.h
include/asm-alpha/pgalloc.h
+29
-84
include/asm-alpha/pgtable.h
include/asm-alpha/pgtable.h
+15
-4
include/asm-alpha/smp.h
include/asm-alpha/smp.h
+0
-4
include/asm-alpha/system.h
include/asm-alpha/system.h
+1
-0
include/linux/highmem.h
include/linux/highmem.h
+1
-0
include/linux/spinlock.h
include/linux/spinlock.h
+5
-5
No files found.
arch/alpha/kernel/core_irongate.c
View file @
61a9bb47
...
...
@@ -455,7 +455,7 @@ irongate_remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned long size,
if
(
address
>=
end
)
BUG
();
do
{
pte_t
*
pte
=
pte_alloc
(
&
init_mm
,
pmd
,
address
);
pte_t
*
pte
=
pte_alloc
_kernel
(
&
init_mm
,
pmd
,
address
);
if
(
!
pte
)
return
-
ENOMEM
;
irongate_remap_area_pte
(
pte
,
address
,
end
-
address
,
...
...
arch/alpha/kernel/process.c
View file @
61a9bb47
...
...
@@ -64,7 +64,6 @@ cpu_idle(void)
while
(
!
need_resched
())
barrier
();
schedule
();
check_pgt_cache
();
}
}
...
...
arch/alpha/mm/init.c
View file @
61a9bb47
...
...
@@ -42,12 +42,8 @@ extern void die_if_kernel(char *,struct pt_regs *,long);
static
struct
pcb_struct
original_pcb
;
#ifndef CONFIG_SMP
struct
pgtable_cache_struct
quicklists
;
#endif
pgd_t
*
get_pgd_slow
(
void
)
pgd_alloc
(
struct
mm_struct
*
mm
)
{
pgd_t
*
ret
,
*
init
;
...
...
@@ -69,28 +65,26 @@ get_pgd_slow(void)
return
ret
;
}
int
do_check_pgt_cache
(
int
low
,
int
high
)
pte_t
*
pte_alloc_one_kernel
(
struct
mm_struct
*
mm
,
unsigned
long
address
)
{
int
freed
=
0
;
if
(
pgtable_cache_size
>
high
)
{
do
{
if
(
pgd_quicklist
)
{
free_pgd_slow
(
get_pgd_fast
());
freed
++
;
}
if
(
pmd_quicklist
)
{
pmd_free_slow
(
pmd_alloc_one_fast
(
NULL
,
0
));
freed
++
;
}
if
(
pte_quicklist
)
{
pte_free_slow
(
pte_alloc_one_fast
(
NULL
,
0
));
freed
++
;
}
}
while
(
pgtable_cache_size
>
low
);
pte_t
*
pte
;
long
timeout
=
10
;
retry:
pte
=
(
pte_t
*
)
__get_free_page
(
GFP_KERNEL
);
if
(
pte
)
clear_page
(
pte
);
else
if
(
--
timeout
>=
0
)
{
current
->
state
=
TASK_UNINTERRUPTIBLE
;
schedule_timeout
(
HZ
);
goto
retry
;
}
return
freed
;
return
pte
;
}
/*
* BAD_PAGE is the page that is used for page faults when linux
* is out-of-memory. Older versions of linux just did a
...
...
@@ -145,7 +139,6 @@ show_mem(void)
printk
(
"%ld reserved pages
\n
"
,
reserved
);
printk
(
"%ld pages shared
\n
"
,
shared
);
printk
(
"%ld pages swap cached
\n
"
,
cached
);
printk
(
"%ld pages in page table cache
\n
"
,
pgtable_cache_size
);
show_buffers
();
}
#endif
...
...
@@ -260,7 +253,7 @@ callback_init(void * kernel_end)
unsigned
long
paddr
=
crb
->
map
[
i
].
pa
;
crb
->
map
[
i
].
va
=
vaddr
;
for
(
j
=
0
;
j
<
crb
->
map
[
i
].
count
;
++
j
)
{
set_pte
(
pte_offset
(
pmd
,
vaddr
),
set_pte
(
pte_offset
_kernel
(
pmd
,
vaddr
),
mk_pte_phys
(
paddr
,
PAGE_KERNEL
));
paddr
+=
PAGE_SIZE
;
vaddr
+=
PAGE_SIZE
;
...
...
fs/nfsd/nfsctl.c
View file @
61a9bb47
...
...
@@ -32,6 +32,7 @@
#include <asm/uaccess.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/init.h>
static
int
nfsctl_svc
(
struct
nfsctl_svc
*
data
);
static
int
nfsctl_addclient
(
struct
nfsctl_client
*
data
);
...
...
include/asm-alpha/pgalloc.h
View file @
61a9bb47
...
...
@@ -230,53 +230,35 @@ extern void flush_tlb_range(struct vm_area_struct *, unsigned long, unsigned lon
* used to allocate a kernel page table - this turns on ASN bits
* if any.
*/
#ifndef CONFIG_SMP
extern
struct
pgtable_cache_struct
{
unsigned
long
*
pgd_cache
;
unsigned
long
*
pmd_cache
;
unsigned
long
*
pte_cache
;
unsigned
long
pgtable_cache_sz
;
}
quicklists
;
#else
#include <asm/smp.h>
#define quicklists cpu_data[smp_processor_id()]
#endif
#define pgd_quicklist (quicklists.pgd_cache)
#define pmd_quicklist (quicklists.pmd_cache)
#define pte_quicklist (quicklists.pte_cache)
#define pgtable_cache_size (quicklists.pgtable_cache_sz)
#define pmd_populate(mm, pmd, pte) pmd_set(pmd, pte)
#define pgd_populate(mm, pgd, pmd) pgd_set(pgd, pmd)
extern
pgd_t
*
get_pgd_slow
(
void
);
static
inline
void
pmd_populate
(
struct
mm_struct
*
mm
,
pmd_t
*
pmd
,
struct
page
*
pte
)
{
pmd_set
(
pmd
,
(
pte_t
*
)((
pte
-
mem_map
)
<<
PAGE_SHIFT
));
}
static
inline
pgd_t
*
get_pgd_fast
(
void
)
static
inline
void
pmd_populate_kernel
(
struct
mm_struct
*
mm
,
pmd_t
*
pmd
,
pte_t
*
pte
)
{
unsigned
long
*
ret
;
if
((
ret
=
pgd_quicklist
)
!=
NULL
)
{
pgd_quicklist
=
(
unsigned
long
*
)(
*
ret
);
ret
[
0
]
=
0
;
pgtable_cache_size
--
;
}
else
ret
=
(
unsigned
long
*
)
get_pgd_slow
();
return
(
pgd_t
*
)
ret
;
pmd_set
(
pmd
,
pte
);
}
static
inline
void
free_pgd_fast
(
pgd_t
*
pgd
)
static
inline
void
pgd_populate
(
struct
mm_struct
*
mm
,
pgd_t
*
pgd
,
pmd_t
*
pmd
)
{
*
(
unsigned
long
*
)
pgd
=
(
unsigned
long
)
pgd_quicklist
;
pgd_quicklist
=
(
unsigned
long
*
)
pgd
;
pgtable_cache_size
++
;
pgd_set
(
pgd
,
pmd
);
}
static
inline
void
free_pgd_slow
(
pgd_t
*
pgd
)
extern
pgd_t
*
pgd_alloc
(
struct
mm_struct
*
mm
);
static
inline
void
pgd_free
(
pgd_t
*
pgd
)
{
free_page
((
unsigned
long
)
pgd
);
}
static
inline
pmd_t
*
pmd_alloc_one
(
struct
mm_struct
*
mm
,
unsigned
long
address
)
static
inline
pmd_t
*
pmd_alloc_one
(
struct
mm_struct
*
mm
,
unsigned
long
address
)
{
pmd_t
*
ret
=
(
pmd_t
*
)
__get_free_page
(
GFP_KERNEL
);
if
(
ret
)
...
...
@@ -284,67 +266,30 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
return
ret
;
}
static
inline
pmd_t
*
pmd_alloc_one_fast
(
struct
mm_struct
*
mm
,
unsigned
long
address
)
{
unsigned
long
*
ret
;
if
((
ret
=
(
unsigned
long
*
)
pte_quicklist
)
!=
NULL
)
{
pte_quicklist
=
(
unsigned
long
*
)(
*
ret
);
ret
[
0
]
=
0
;
pgtable_cache_size
--
;
}
return
(
pmd_t
*
)
ret
;
}
static
inline
void
pmd_free_fast
(
pmd_t
*
pmd
)
{
*
(
unsigned
long
*
)
pmd
=
(
unsigned
long
)
pte_quicklist
;
pte_quicklist
=
(
unsigned
long
*
)
pmd
;
pgtable_cache_size
++
;
}
static
inline
void
pmd_free_slow
(
pmd_t
*
pmd
)
static
inline
void
pmd_free
(
pmd_t
*
pmd
)
{
free_page
((
unsigned
long
)
pmd
);
}
static
inline
pte_t
*
pte_alloc_one
(
struct
mm_struct
*
mm
,
unsigned
long
address
)
{
pte_t
*
pte
=
(
pte_t
*
)
__get_free_page
(
GFP_KERNEL
);
if
(
pte
)
clear_page
(
pte
);
return
pte
;
}
extern
pte_t
*
pte_alloc_one_kernel
(
struct
mm_struct
*
mm
,
unsigned
long
addr
);
static
inline
pte_t
*
pte_alloc_one_fast
(
struct
mm_struct
*
mm
,
unsigned
long
address
)
static
inline
void
pte_free_kernel
(
pte_t
*
pte
)
{
unsigned
long
*
ret
;
if
((
ret
=
(
unsigned
long
*
)
pte_quicklist
)
!=
NULL
)
{
pte_quicklist
=
(
unsigned
long
*
)(
*
ret
);
ret
[
0
]
=
0
;
pgtable_cache_size
--
;
}
return
(
pte_t
*
)
ret
;
free_page
((
unsigned
long
)
pte
);
}
static
inline
void
pte_free_fast
(
pte_t
*
pte
)
static
inline
struct
page
*
pte_alloc_one
(
struct
mm_struct
*
mm
,
unsigned
long
addr
)
{
*
(
unsigned
long
*
)
pte
=
(
unsigned
long
)
pte_quicklist
;
pte_quicklist
=
(
unsigned
long
*
)
pte
;
pgtable_cache_size
++
;
return
virt_to_page
(
pte_alloc_one_kernel
(
mm
,
addr
));
}
static
inline
void
pte_free_slow
(
pte_t
*
pte
)
static
inline
void
pte_free
(
struct
page
*
page
)
{
free_page
((
unsigned
long
)
pt
e
);
__free_page
(
pag
e
);
}
#define pte_free(pte) pte_free_fast(pte)
#define pmd_free(pmd) pmd_free_fast(pmd)
#define pgd_free(pgd) free_pgd_fast(pgd)
#define pgd_alloc(mm) get_pgd_fast()
extern
int
do_check_pgt_cache
(
int
,
int
);
#endif
/* _ALPHA_PGALLOC_H */
include/asm-alpha/pgtable.h
View file @
61a9bb47
...
...
@@ -248,8 +248,13 @@ extern inline void pgd_set(pgd_t * pgdp, pmd_t * pmdp)
})
#endif
extern
inline
unsigned
long
pmd_page
(
pmd_t
pmd
)
{
return
PAGE_OFFSET
+
((
pmd_val
(
pmd
)
&
_PFN_MASK
)
>>
(
32
-
PAGE_SHIFT
));
}
extern
inline
unsigned
long
pmd_page_kernel
(
pmd_t
pmd
)
{
return
((
pmd_val
(
pmd
)
&
_PFN_MASK
)
>>
(
32
-
PAGE_SHIFT
))
+
PAGE_OFFSET
;
}
#define pmd_page(pmd) (mem_map + ((pmd_val(pmd) & _PFN_MASK) >> 32))
extern
inline
unsigned
long
pgd_page
(
pgd_t
pgd
)
{
return
PAGE_OFFSET
+
((
pgd_val
(
pgd
)
&
_PFN_MASK
)
>>
(
32
-
PAGE_SHIFT
));
}
...
...
@@ -306,11 +311,17 @@ extern inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address)
}
/* Find an entry in the third-level page table.. */
extern
inline
pte_t
*
pte_offset
(
pmd_t
*
dir
,
unsigned
long
address
)
extern
inline
pte_t
*
pte_offset
_kernel
(
pmd_t
*
dir
,
unsigned
long
address
)
{
return
(
pte_t
*
)
pmd_page
(
*
dir
)
+
((
address
>>
PAGE_SHIFT
)
&
(
PTRS_PER_PAGE
-
1
));
return
(
pte_t
*
)
pmd_page_kernel
(
*
dir
)
+
((
address
>>
PAGE_SHIFT
)
&
(
PTRS_PER_PAGE
-
1
));
}
#define pte_offset_map(dir,addr) pte_offset_kernel((dir),(addr))
#define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir),(addr))
#define pte_unmap(pte) do { } while (0)
#define pte_unmap_nested(pte) do { } while (0)
extern
pgd_t
swapper_pg_dir
[
1024
];
/*
...
...
include/asm-alpha/smp.h
View file @
61a9bb47
...
...
@@ -29,10 +29,6 @@ struct cpuinfo_alpha {
unsigned
long
last_asn
;
int
need_new_asn
;
int
asn_lock
;
unsigned
long
*
pgd_cache
;
unsigned
long
*
pmd_cache
;
unsigned
long
*
pte_cache
;
unsigned
long
pgtable_cache_sz
;
unsigned
long
ipi_count
;
unsigned
long
irq_attempt
[
NR_IRQS
];
unsigned
long
prof_multiplier
;
...
...
include/asm-alpha/system.h
View file @
61a9bb47
...
...
@@ -137,6 +137,7 @@ do { \
check_mmu_context(); \
} while (0)
struct
task_struct
;
extern
void
alpha_switch_to
(
unsigned
long
,
struct
task_struct
*
);
#define mb() \
...
...
include/linux/highmem.h
View file @
61a9bb47
...
...
@@ -4,6 +4,7 @@
#include <linux/config.h>
#include <linux/bio.h>
#include <linux/fs.h>
#include <asm/pgalloc.h>
#ifdef CONFIG_HIGHMEM
...
...
include/linux/spinlock.h
View file @
61a9bb47
...
...
@@ -84,12 +84,12 @@
#define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 }
#endif
#define spin_lock_init(lock) do { } while(0)
#define spin_lock_init(lock) do {
(void)(lock);
} while(0)
#define _raw_spin_lock(lock) (void)(lock)
/* Not "unused variable". */
#define spin_is_locked(lock) (0)
#define _raw_spin_trylock(lock) (
{1; }
)
#define spin_unlock_wait(lock) do { } while(0)
#define _raw_spin_unlock(lock) do { } while(0)
#define spin_is_locked(lock) (
(void)(lock),
0)
#define _raw_spin_trylock(lock) (
(void)(lock), 1
)
#define spin_unlock_wait(lock) do {
(void)(lock);
} while(0)
#define _raw_spin_unlock(lock) do {
(void)(lock);
} while(0)
#elif (DEBUG_SPINLOCKS < 2)
...
...
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