diff --git a/thu_os/lab2_report.md b/thu_os/lab2_report.md index 28e73d9..70099fe 100644 --- a/thu_os/lab2_report.md +++ b/thu_os/lab2_report.md @@ -253,17 +253,17 @@ page_init(void) { /* * * Physical memory map: * - * +---------------------------------+ + * +---------------------------------+ * | | * | Free Memory (*) | * | | * freemem -------------> +---------------------------------+ - * | Struct Page *pages | + * | Struct Page *pages | * pages ---------------> +---------------------------------+ * | Invalid Memory (*) | * end kern ------------> +---------------------------------+ * | | - * | KERNEL | + * | KERNEL | * | | * load addr -----------> +---------------------------------+ 0x00100000 * | | @@ -423,7 +423,7 @@ default_free_pages(struct Page *base, size_t n) { } ``` -在主循环里面,我是试图查找新加入的页面的后继页面,将新的页面插入到其后继页面之前,再进行合并的检测。但如果新加入页面是被插入到`free_area`链表的最后,则没有这样的后继页面,同时也只有可能与它的前驱进行合并了,`while`循环之后就是对于这种特殊情况的处理。相对于参考答案的代码,我的版本应该是更好的,因为参考答案用了两次循环,存在大量的冗余操作,当然老师的注释也写了应该对这个代码进行优化。 +在主循环里面,我是试图查找新加入的页面的后继页面,将新的页面插入到其后继页面之前,再进行合并的检测。但如果新加入页面是被插入到`free_area`链表的最后,则没有这样的后继页面,同时也只有可能与它的前驱进行合并了,`while`循环之后就是对于这种特殊情况的处理。相对于参考答案的代码,我的版本应该是更好的,因为参考答案用了两次循环,存在大量的冗余操作,当然老师的注释也写了应该对这个代码进行优化。但是不管怎么样,我的这个代码还是存在太多冗余了,存在改进的余地(但是我懒得改了),以下简单说明以下:首先定位待插入页面的前驱`front`,如果`le2page(front) != free_list && front + front->property == base`,则更新`front`的信息,并且令`base = front`;否则插入`base`页面。无论哪种情况,以下再以`base`为基,判断后面的页面是否也可以合并。这样写性能不会更快,但是代码会简练不少。 ## 页表的建立 diff --git a/words.md b/words.md index 66c1857..7e5b36b 100644 --- a/words.md +++ b/words.md @@ -1801,5 +1801,107 @@ Some Words - The package deal under discussion will require every country to be flexible on its immigration laws. - Many small hotels offer accommodation and breakfast as a package deal. -+ +## 18, November + ++ justify +> (v)to show that something is reasonable, right or true. + + - Her fears of a low voter turnout were justified when fewer than half of the people voted. + - She said that there was no justification for such a rude behaviour. + ++ turnout +> (n)the number of people who are present at an event, especially the number who go to vote at an election. + + - Good weather on polling day should ensure a good turnout. + ++ dim +> (adj)not very clever + + - He's a nice guy, but a little dim. + ++ corporate +> (adj)relating to a business, especially a large business.
+> Corporate America: used to refer to large companies that have a lot of influence in the economy of the US. + + - Analysts are expecting share prices to fall in the first quarter of next year because of poor corporate earnings. + ++ put sb on notice +> (v)to warn someone offically that something is going to happen, or could possibly happen. + + - The facility was put on notice that its funding was in danger if improvements were not carried out. + ++ compliance +> (n)the act of obeying an order, rule or request. + + - It is the job of the inspectors to enforce compliance with the regulations. + - We've been working hard to remain in compliance with all air pollution control laws. + ++ feeble +> (adj)weak and without energy, strength or power. + + - He was a feeble, helpless old man. + - Opposition to the plan was rather feeble. + - a feeble joke/excuse + ++ pink slip +> (n)a document given to an employee to tell them that they do not have a job any longer. + + - Eastern Airlines shut down operations at midnight, and 18,000 employees were given their pink slips. + ++ outlive +> (v)to live or exist longer than someone or something. + + - He outlived all of his brothers. + ++ deductible +> (adj)a deductible expense is a cost that you can subtract from the earnings on which you have to pay income tax.
+> (n)a part of the cost of an accident, injury etc that you agree to pay yourself when you buy insurance. + + - Customers can lower insurance premiums by taking higher deductibles. + ++ odds +> (n)the probability that a particular thing will or will not happen. + + - If you drive a car all your life, the odds are that you'll have an accident at some point. + ++ attendant +> (adj)coming with a stated thing or resulting from it. + + - debt and its attendant problems + - There are too many risks attendant on such a large investment of money. + ++ eightfold +> (adj, adv)eight times as big or as much + + - an eightfold increase + - Drug-related crimes jumped eightfold. + ++ elude +> (v)if something that you want eludes you, you do not succeed in achieving it.
+> (v)if a piece of information eludes you, you cannot remember it.
+> (v)if you elude someone or something, you avoid them or escape from them. + + - Sleep eluded her. + - They had minor breakthroughs but real success eluded them. + - I know who you mean but her name eludes me. + - He eluded the police for 13 years. + ++ encompass +> (v)to include different types of things. + + - The festival is to encompass everything from music, theatre and ballet to literature, cinema and the visual arts. + ++ chronological +> (adj)following the order in which a series of events happened + + - Give me the dates in chronological order. + - I have arranged these stories in chronological order. + - The exhibition is organized chronologically. + ++ toil +> (v)to work hard
+> (n)hard work, especially work that makes you feel physically tired. + + - People who toiled in dim factores were too exhausted to enjoy their family life. + - Well, after a day's toil in the office I like to relax a little. \ No newline at end of file