SlideShare a Scribd company logo
1 of 8
11차 ARM-A
35주차1월 10일 후기
Note!
memory region은 물리적으로 쓸 수 있는 영
역을 설정한 것이고,
reserved region은 사용하지 말아야 할 부분
을 설정한 것입니다.
kernel이 사용하는 영역을 reserved 영역으
로 설정하였습니다.
-> 이 내용은 1/10 스터디를 하면서 아직까
지는 불확실한 내용이라 판단했습니다.
흐름
memblock_add_region함수
->
memblock_double_array함수
->
memblock_find_in_range함수
->
memblock_find_in_range_node함수
->
for_each_free_mem_range_reverse매크로
->
__next_free_mem_range함수
Case 1) reserved가 memory에 포함되서 겹치는 경우
1) mi, ri를 이용한 이중 for문
Step 1) mi = 2, ri = 2
Reserved regions
cnt = 2
[0]
Base
Size
…
[1]
Base
Size
…
Memory regions
cnt = 3
[0]
Base
Size
…
[1]
Base
Size
…
[2]
Base
Size
…
m_start m_end
r_endr_start
out_endout_start
out_start(this_start)
out_end(this_end)
Case 2) reserved가 앞에서 겹치는 경우
1) mi, ri를 이용한 이중 for문 snapshot
Step 1) mi = 2, ri = 2
Reserved regions
cnt = 2
[0]
Base
Size
…
[1]
Base
Size
…
Memory regions
cnt = 3
[0]
Base
Size
…
[1]
Base
Size
…
[2]
Base
Size
…
m_start
r_start r_end
out_start(this_start)
out_end(this_end)
m_end
Case 3) reserved가 뒤에서 겹치는 경우
1) mi, ri를 이용한 이중 for문 snapshot
Step 1) mi = 2, ri = 2
Reserved regions
cnt = 2
[0]
Base
Size
…
[1]
Base
Size
…
Memory regions
cnt = 3
[0]
Base
Size
…
[1]
Base
Size
…
[2]
Base
Size
…
m_start m_end
r_start r_end
두 번째 for문의
두 번째 if문(m_end > r_start)에 걸리지 않기 때문에
For문 그대로 진행되고 ri--됨
Case 3) reserved가 뒤에서 겹치는 경우
1) mi, ri를 이용한 이중 for문 snapshot
Step 2) mi = 2, ri = 1
Reserved regions
cnt = 2
[0]
Base
Size
…
[1]
Base
Size
…
Memory regions
cnt = 3
[0]
Base
Size
…
[1]
Base
Size
…
[2]
Base
Size
…
m_end
r_start r_end
m_start
out_start(this_start)
out_end(this_end)
memblock_find_in_range_node함수
for_each 문 변환
for (i = (u64)ULLONG_MAX, __next_free_mem_range_rev(&i, nid, this_start, this_end, nid) ;
i != (u64)ULLONG_MAX ;
__next_free_mem_range_rev(&i, nid, this_start, this_end, nid))
this_start = clamp(this_start, start, end);
this_end = clamp(this_end, start, end);
if (this_end < size)
continue;
cand = round_down(this_end - size, align);
if (cand >= this_start)
return cand;
}

More Related Content

Viewers also liked

Change Your Voice in Slack.com
Change Your Voice in Slack.comChange Your Voice in Slack.com
Change Your Voice in Slack.comaudio4fun
 
персоналды башкаруу 4 лекция
персоналды башкаруу 4 лекцияперсоналды башкаруу 4 лекция
персоналды башкаруу 4 лекцияokyykg
 
Yeni microsoft power point sunusu
Yeni microsoft power point sunusuYeni microsoft power point sunusu
Yeni microsoft power point sunusuKerem Öksüz
 
Export a Video With Your Own Logo
Export a Video With Your Own LogoExport a Video With Your Own Logo
Export a Video With Your Own Logoaudio4fun
 
About Fems with Fervor and Women Making a Difference
About Fems with Fervor and Women Making a DifferenceAbout Fems with Fervor and Women Making a Difference
About Fems with Fervor and Women Making a DifferenceKathy Levinson
 
бизнес идея 1 кадам
бизнес идея  1 кадамбизнес идея  1 кадам
бизнес идея 1 кадамokyykg
 
Males 19-23-final
Males 19-23-finalMales 19-23-final
Males 19-23-finalfluffy1995
 

Viewers also liked (7)

Change Your Voice in Slack.com
Change Your Voice in Slack.comChange Your Voice in Slack.com
Change Your Voice in Slack.com
 
персоналды башкаруу 4 лекция
персоналды башкаруу 4 лекцияперсоналды башкаруу 4 лекция
персоналды башкаруу 4 лекция
 
Yeni microsoft power point sunusu
Yeni microsoft power point sunusuYeni microsoft power point sunusu
Yeni microsoft power point sunusu
 
Export a Video With Your Own Logo
Export a Video With Your Own LogoExport a Video With Your Own Logo
Export a Video With Your Own Logo
 
About Fems with Fervor and Women Making a Difference
About Fems with Fervor and Women Making a DifferenceAbout Fems with Fervor and Women Making a Difference
About Fems with Fervor and Women Making a Difference
 
бизнес идея 1 кадам
бизнес идея  1 кадамбизнес идея  1 кадам
бизнес идея 1 кадам
 
Males 19-23-final
Males 19-23-finalMales 19-23-final
Males 19-23-final
 

Memory map(iamroot)

  • 2. Note! memory region은 물리적으로 쓸 수 있는 영 역을 설정한 것이고, reserved region은 사용하지 말아야 할 부분 을 설정한 것입니다. kernel이 사용하는 영역을 reserved 영역으 로 설정하였습니다. -> 이 내용은 1/10 스터디를 하면서 아직까 지는 불확실한 내용이라 판단했습니다.
  • 4. Case 1) reserved가 memory에 포함되서 겹치는 경우 1) mi, ri를 이용한 이중 for문 Step 1) mi = 2, ri = 2 Reserved regions cnt = 2 [0] Base Size … [1] Base Size … Memory regions cnt = 3 [0] Base Size … [1] Base Size … [2] Base Size … m_start m_end r_endr_start out_endout_start out_start(this_start) out_end(this_end)
  • 5. Case 2) reserved가 앞에서 겹치는 경우 1) mi, ri를 이용한 이중 for문 snapshot Step 1) mi = 2, ri = 2 Reserved regions cnt = 2 [0] Base Size … [1] Base Size … Memory regions cnt = 3 [0] Base Size … [1] Base Size … [2] Base Size … m_start r_start r_end out_start(this_start) out_end(this_end) m_end
  • 6. Case 3) reserved가 뒤에서 겹치는 경우 1) mi, ri를 이용한 이중 for문 snapshot Step 1) mi = 2, ri = 2 Reserved regions cnt = 2 [0] Base Size … [1] Base Size … Memory regions cnt = 3 [0] Base Size … [1] Base Size … [2] Base Size … m_start m_end r_start r_end 두 번째 for문의 두 번째 if문(m_end > r_start)에 걸리지 않기 때문에 For문 그대로 진행되고 ri--됨
  • 7. Case 3) reserved가 뒤에서 겹치는 경우 1) mi, ri를 이용한 이중 for문 snapshot Step 2) mi = 2, ri = 1 Reserved regions cnt = 2 [0] Base Size … [1] Base Size … Memory regions cnt = 3 [0] Base Size … [1] Base Size … [2] Base Size … m_end r_start r_end m_start out_start(this_start) out_end(this_end)
  • 8. memblock_find_in_range_node함수 for_each 문 변환 for (i = (u64)ULLONG_MAX, __next_free_mem_range_rev(&i, nid, this_start, this_end, nid) ; i != (u64)ULLONG_MAX ; __next_free_mem_range_rev(&i, nid, this_start, this_end, nid)) this_start = clamp(this_start, start, end); this_end = clamp(this_end, start, end); if (this_end < size) continue; cand = round_down(this_end - size, align); if (cand >= this_start) return cand; }