Lab 7 Lock
Re-designing code to increase parallelism
Introduction
Task 1: Memory Allocator
$ **kalloctest**
start test0
test0 results:
=== lock kmem/bcache stats
lock: kmem: #test-and-set 161724 #acquire() 433008
lock: bcache: #test-and-set 0 #acquire() 812
=== top 5 contended locks:
lock: kmem: #test-and-set 161724 #acquire() 433008
lock: proc: #test-and-set 290 #acquire() 961
lock: proc: #test-and-set 240 #acquire() 962
lock: proc: #test-and-set 72 #acquire() 907
lock: proc: #test-and-set 68 #acquire() 907
test0 FAIL
start test1
total allocated number of pages: 200000 (out of 32768)
test1 OKYour job
Solution
In kalloc
kallocTask 2: Buffer Cache
The Problem
Your Task
Solution
Implement hashable
Modify bget to use hash table
bget to use hash tablebrelse doesnāt need to acquire the bcache lock
brelse doesnāt need to acquire the bcache lockThoughts
åæå¾
Last updated