ARM64 - 프로세스(Process) preempt_disable(), preemption 스케줄(Schedule) 조건 분석
By Guillermo Austin Kim | 2017년 12월 25일 |
아래 제 블로그에서 ARM32 아키텍처에서 preempt_disable() 매크로 함수를 호출하면 __irq_svc 벡터에서 svc_preempt 함수를호출하지 않아, preemption이 수행되지 않는다고 확인했어요.http://rousalome.egloos.com/9964816 이번에는 ARM64(Aarch64) 아키텍처에서는 어떤 코드로 구현 되는지 살펴 볼께요. ARM64(Aarch64) 아키텍처는 ARM32 아키텍처와는 다르게 아예 어떤 코드가 실행이 되던 current_thread_info을 읽어올 수 있는 Instruction을 제공해요.코드는 아래와 같은데, "mrs" 명령어로 스택 Top 주소를 가져오네요. current_thread_info()가 호출될 때 속도를 더 빠르게 하기 위
[Linux][Kernel] preempt_disable()/preempt_enable() 주의 사항
By Guillermo Austin Kim | 2019년 1월 2일 |
preempt_disable() 함수를 쓸 때 주의해야 할 점이 있습니다.preempt_disable() 함수는 preempt_enable() 함수와 반드시 Pair로 써야 합니다. preempt_disable() 함수를 호출한 다음 스케줄링 동작을 수행하는 함수를 쓰면 리눅스 시스템은 오동작합니다. 예를 들어 다음과 같은 드라이버를 초기화하는 코드를 예를 들겠습니다.1 void configure_something_driver(void) 2 {3 preempt_disable();4 5 do_something();6 mdelay(100);7 do_something();8 9 preempt_enable();10 } 5~7 번 코드가 실행할 때 Preemption이 되면 안된다고 판단했습니다.그래서 3 번
[Linux][Kernel] Check process in Linux system
By Guillermo Austin Kim | 2019년 1월 9일 |
In order to be able to survive as competitive Linux system developers(DevOps for device drivers) for a long time, you need to know the Linux kernel better. However, the Linux kernel is huge, and its content depth is a difficult technical area to grasp in the short term. I started the Linux kernel with the question "What is a process?" I saw a lot of words like the Bible or blasphemy. Unfortunately
[Linux][Kernel][Stability] Kernel panic @0x0 from xfrm_local_error+0x4c
By Guillermo Austin Kim | 2017년 12월 7일 |
커널 패닉이 났어요.네트워크 드라이버 리눅스 커널 코드에서 발생한 것 같은데요. 음.일단 당황하지 마시구요. 차근 차근 커널 로그와 코어 덤프를 살펴보면, 정답이 나와요. 일단 커널 로그를 보면, 프로그램 카운터가 0x0을 가르키고 있네요.음... 그리고링크 레지스터(R14)가 0xc0adc274(LR is at xfrm_local_error+0x4c/0x58) 을 가르키고 있습니다.[ 262.401303] Unable to handle kernel NULL pointer dereference at virtual address 00000000[ 262.401365] pgd = dbdc4000[ 262.401389] [00000000] *pgd=00000000[ 262.401433] Internal