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
e6d19c6a
Commit
e6d19c6a
authored
May 20, 2002
by
Linus Torvalds
Committed by
Linus Torvalds
May 20, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make generic TLB shootdown friendlier to non-x86 architectures
parent
00f42361
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
10 deletions
+35
-10
include/asm-generic/tlb.h
include/asm-generic/tlb.h
+14
-10
include/asm-i386/tlb.h
include/asm-i386/tlb.h
+19
-0
mm/memory.c
mm/memory.c
+2
-0
No files found.
include/asm-generic/tlb.h
View file @
e6d19c6a
...
...
@@ -16,8 +16,17 @@
#include <linux/config.h>
#include <asm/tlbflush.h>
/* aim for something that fits in the L1 cache */
#define FREE_PTE_NR 508
/*
* For UP we don't need to worry about TLB flush
* and page free order so much..
*/
#ifdef CONFIG_SMP
#define FREE_PTE_NR 507
#define tlb_fast_mode(tlb) ((tlb)->nr == ~0UL)
#else
#define FREE_PTE_NR 1
#define tlb_fast_mode(tlb) 1
#endif
/* mmu_gather_t is an opaque type used by the mm code for passing around any
* data needed by arch specific code for tlb_remove_page. This structure can
...
...
@@ -34,10 +43,6 @@ typedef struct free_pte_ctx {
/* Users of the generic TLB shootdown code must declare this storage space. */
extern
mmu_gather_t
mmu_gathers
[
NR_CPUS
];
/* Do me later */
#define tlb_start_vma(tlb, vma) do { } while (0)
#define tlb_end_vma(tlb, vma) do { } while (0)
/* tlb_gather_mmu
* Return a pointer to an initialized mmu_gather_t.
*/
...
...
@@ -57,9 +62,9 @@ static inline void tlb_flush_mmu(mmu_gather_t *tlb, unsigned long start, unsigne
{
unsigned
long
nr
;
flush_tlb_mm
(
tlb
->
mm
);
tlb_flush
(
tlb
);
nr
=
tlb
->
nr
;
if
(
nr
!=
~
0UL
)
{
if
(
!
tlb_fast_mode
(
tlb
)
)
{
unsigned
long
i
;
tlb
->
nr
=
0
;
for
(
i
=
0
;
i
<
nr
;
i
++
)
...
...
@@ -91,8 +96,7 @@ static inline void tlb_finish_mmu(mmu_gather_t *tlb, unsigned long start, unsign
*/
static
inline
void
tlb_remove_page
(
mmu_gather_t
*
tlb
,
struct
page
*
page
)
{
/* Handle the common case fast, first. */
\
if
(
tlb
->
nr
==
~
0UL
)
{
if
(
tlb_fast_mode
(
tlb
))
{
free_page_and_swap_cache
(
page
);
return
;
}
...
...
include/asm-i386/tlb.h
View file @
e6d19c6a
#ifndef _I386_TLB_H
#define _I386_TLB_H
/*
* x86 doesn't need any special per-pte or
* per-vma handling..
*/
#define tlb_start_vma(tlb, vma) do { } while (0)
#define tlb_end_vma(tlb, vma) do { } while (0)
#define tlb_remove_tlb_entry(tlb, pte, address) do { } while (0)
/*
* .. because we flush the whole mm when it
* fills up.
*/
#define tlb_flush(tlb) flush_tlb_mm((tlb)->mm)
#include <asm-generic/tlb.h>
#endif
mm/memory.c
View file @
e6d19c6a
...
...
@@ -348,11 +348,13 @@ static void zap_pte_range(mmu_gather_t *tlb, pmd_t * pmd, unsigned long address,
pte_clear
(
ptep
);
pfn
=
pte_pfn
(
pte
);
tlb_remove_tlb_entry
(
tlb
,
pte
,
address
+
offset
);
if
(
pfn_valid
(
pfn
))
{
struct
page
*
page
=
pfn_to_page
(
pfn
);
if
(
!
PageReserved
(
page
))
{
if
(
pte_dirty
(
pte
))
set_page_dirty
(
page
);
tlb
->
freed
++
;
tlb_remove_page
(
tlb
,
page
);
}
}
...
...
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