Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pintos-2017
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gback
pintos-2017
Commits
12d34ddd
Commit
12d34ddd
authored
7 years ago
by
gback
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of git.cs.vt.edu:gback/pintos-2017
parents
4b5de360
fb8f67e2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
doc/threads.texi
+1
-1
1 addition, 1 deletion
doc/threads.texi
src/devices/usb_uhci.c
+3
-3
3 additions, 3 deletions
src/devices/usb_uhci.c
src/threads/synch.h
+8
-0
8 additions, 0 deletions
src/threads/synch.h
src/userprog/pagedir.c
+1
-1
1 addition, 1 deletion
src/userprog/pagedir.c
with
13 additions
and
5 deletions
doc/threads.texi
+
1
−
1
View file @
12d34ddd
...
...
@@ -608,7 +608,7 @@ that no CPU is idle while threads are ready to run (but are not currently
running). However, using a global queue has two main weaknesses.
The first weakness is lack of
scability. The global queue must be locked while choosing the next job to run.
sca
la
bility. The global queue must be locked while choosing the next job to run.
Locking greatly reduces performance as the number of CPUs grows. Each CPU will
spend more and more time contenting for the global queue lock and less time
actually running threads.
...
...
This diff is collapsed.
Click to expand it.
src/devices/usb_uhci.c
+
3
−
3
View file @
12d34ddd
...
...
@@ -724,7 +724,7 @@ uhci_add_td_to_qh (struct queue_head *qh, struct tx_descriptor *td)
{
/* queue is empty */
td
->
flp
.
terminate
=
1
;
barrier
();
smp_
barrier
();
td
->
flp
.
flp
=
0
;
qh
->
qelp
.
flp
=
ptr_to_flp
(
vtop
(
td
));
qh
->
qelp
.
terminate
=
0
;
...
...
@@ -745,7 +745,7 @@ uhci_add_td_to_qh (struct queue_head *qh, struct tx_descriptor *td)
fp
->
qh_select
=
0
;
fp
->
depth_select
=
0
;
fp
->
flp
=
ptr_to_flp
(
vtop
(
td
));
barrier
();
smp_
barrier
();
fp
->
terminate
=
0
;
}
}
...
...
@@ -928,7 +928,7 @@ uhci_create_chan (host_info hi, int dev_addr, int ver)
/* queue data */
memset
(
ud
->
qh
,
0
,
sizeof
(
*
ud
->
qh
));
ud
->
qh
->
qelp
.
terminate
=
1
;
barrier
();
smp_
barrier
();
ud
->
qh
->
qelp
.
flp
=
0
;
ud
->
qh
->
qelp
.
qh_select
=
0
;
ud
->
qh
->
qhlp
.
qh_select
=
1
;
...
...
This diff is collapsed.
Click to expand it.
src/threads/synch.h
+
8
−
0
View file @
12d34ddd
...
...
@@ -52,4 +52,12 @@ void cond_broadcast (struct condition *, struct lock *);
reference guide for more information.*/
#define barrier() asm volatile ("" : : : "memory")
/* Memory barrier.
The hardware will not complete instructions out of
order around a memory barrier. The compiler will
similarly refrain from reordering operations across
a memory barrier */
#define smp_barrier() asm volatile("mfence" : : : "memory")
#endif
/* threads/synch.h */
This diff is collapsed.
Click to expand it.
src/userprog/pagedir.c
+
1
−
1
View file @
12d34ddd
...
...
@@ -297,7 +297,7 @@ invalidate_pagedir_others (uint32_t *pd)
lock_acquire
(
&
tlb_flush_state
.
lock
);
tlb_flush_state
.
remaining
=
ncpu
-
1
;
tlb_flush_state
.
pd
=
pd
;
barrier
();
smp_
barrier
();
lapic_send_ipi_to_all_but_self
(
IPI_TLB
);
/* We busy-wait here rather than blocking the calling thread
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment