155 0

Improving Write Distribution in Non-Volatile Main Memory on Tiny Devices via Task Stack Migration

Title
Improving Write Distribution in Non-Volatile Main Memory on Tiny Devices via Task Stack Migration
Author
이정민
Alternative Author(s)
Jeongmin Lee
Advisor(s)
최정욱; 송용호
Issue Date
2023. 8
Publisher
한양대학교
Degree
Doctor
Abstract
초소형 디바이스는 매우 작은 크기의 임베디드 디바이스로 배터리와 같은 독립 전원을 사용하여 원격지에서 장시간 동작하는데, 이를 위해서 낮은 전력소모와 저렴한생산 비용이 요구된다. 차세대 고밀도 비휘발성 메모리는 기존의 휘발성 메모리에 비하여 정적인 상황에서 소모하는 전력이 적고, 동일한 면적에서 더 많은 용량을 제공하기 때문에 고밀도 비휘발성 메모리를 초소형 디바이스에서 사용하면 낮은 전력소모와 저렴한 생산 비용의 요구조건을 충족할 수 있다. 그러나 기존의 휘발성 메모리에 비하여 고밀도 비휘발성 메모리는 매우 낮은 쓰기 내구성을 갖기 때문에, 고밀도 비휘발성 메모리를 메인 메모리로 사용하면 디바이스가 장시간 동작하면서 누적되는 쓰기로 인해 쓰기 수명 문제가 발생할 수 있다. 초소형 디바이스에서는 면적 및 비용 절감 등을 목적으로 로우 엔드 마이크로컨트롤러를 사용하며, 일반적으로 로우 엔드 마이크로컨트롤러에는 캐시 메모리와 메모리매니지먼트 유닛이 없다. 캐시와 메모리 관리 유닛이 없는 로우 앤드 마크로컨트롤러를 사용하면 쓰기 부하 경감과 분산이 어렵다. 캐시는 빈번하게 요청되는 데이터를 적재하기 때문에, 이 데이터에 대한 메인 메모리로 접근하는 횟수를 줄인다. 따라서 마이크로컨트롤러에 캐시가 없으면 메인 메모리로 요청되는 쓰기 부하가 경감되지 않는다. 메모리 관리 유닛은 메인 메모리의 각 구역에 대한 논리 주소와 물리 주소를 맵핑한 테이블을 가지는데, 맵핑 테이블을 사용하여 논리 주소로 요청된 메모리 접근을 물리 주소로 변환한다. 메모리 매니저먼트 유닛이 없으면 물리 주소만을 이용해 메모리 접근 요청을 처리하게 되는데, 이러한 메모리 접근 방식은 기존의 메모리 맵핑 기반 쓰기 분산 기법을 적용하기 불가능하게 한다. 기존의 임베디드 디바이스를 대상으로 하는 비휘발성 메인 메모리의 쓰기 분산 기법들은 대부분 쓰기 정보를 이용했으며, 이에 더해 일부 연구들은 쓰기 분산을 지원하는 전용 하드웨어 로직을 추가하였다. 그러나 기존의 연구들에서 쓰기 분산 연구를 수행한 임베디드 디바이스들은 초소형 디바이스보다 상대적으로 자원이 풍부했으며, 런타임 중에 쓰기 정보의 획득이 가능했다. 반면 초소형 디바이스는 런타임 중에 쓰기 정보 의 획득이 어렵고, 쓰기 분산을 위한 전용의 하드웨어를 추가하기 어렵다. 따라서 본연구에서는 초소형 디바이스 환경을 고려하여 소프트웨어 기반의 쓰기 분산 방법을 모색하였다. 스택은 초소형 디바이스의 메인 메모리에서 가장 쓰기가 많이 발생하는 메모리 영역이었기 때문에, 본 연구에서는 스택에 발생하는 쓰기 분산을 목표로 하였다. 런타임 중 스택에 발생하는 쓰기를 분산하기 위하여, FreeRTOS를 사용해 어플리케이션이 태스크 단위로 구성되도록 하고, 이 태스크 스택을 마이그레이션하여 스택에 발생하는 쓰기 분산을 시도했다. 태스크 스택을 마이그레이션하는 기준으로 시간을 사용하였으며, 스택의 위치 변화에 따라서 데이터 유효성 문제를 회피하기 위하여 스택 마이그레이션을 제한된 조건에서만 가능하게 하였다. 또한 FreeRTOS는 하나의 힙을 사용하여 동적할당을 하기 때문에, 단일 힙에 할당된 메모리 오브젝트들로 인하여 스택 이동 자유도가 낮아져 쓰기 분산 효과가 저하된다. 스택 이동 자유도를 높이기 위하여, 기존의 힙 역할을 수행하는 범용 목적의 힙에 더해 스택만을 할당되는 전용 힙으로 구성된 이중 힙 구조를 도입하였다. 앞서 언급한 스택 마이그레이션 방법들을 기반으로 두가지의 서로 다른 목적을 갖는 스택 마이그레이션 정책을 제안하고, 성능 분석 및 평가를 진행하였다. 먼저 임의 크기 스트라이드를 이용해 스택이 다양한 위치로 이동하도록 하여 쓰기 분산도를 높이고자 하였다. 다음으로는 각 태스크가 전용 마이그레이션 공간을 할당을 갖도록 하여, 스택 이동시 발생하는 오버헤드를 경감하고자 하였다. 이를 통하여 두 마이그레이션 방안들 모두 마이그레이션을 하지 않을 때보다 평균 99.4% 작은 최대 쓰기를 보였다. 이 때 임의 크기를 사용하는 방식은 평균 0.3%의 연산 오버헤드를 보였으며, 전용 공간을 사용하는 방식은 평균 0.2%의 연산 오버헤드를 보였다. |Tiny devices are very small embedded devices that operate for long periods of time in remote locations using an independent power source such as a battery, which requires low power consumption and low production costs. Compared to conventional volatile memory, next-generation high-density non-volatile memory consumes less power in static situations and provides more capacity in the same area, so the use of high-density non-volatile memory in tiny devices can meet the requirements of low power consumption and low manufacturing cost. However, compared to traditional volatile memory, high-density non-volatile memory has very low write endurance, so using high-density non-volatile memory as main memory can cause write lifetime challenges due to accumulated writes over long periods of device operation. Tiny devices use low-end microcontrollers (MCU) to reduce area and cost, and low-end MCUs typically lack cache memory and memory management unit (MMU). Without a cache and MMU, low-end macrocontrollers make it difficult to mitigate and balance write loads. Caches load frequently requested data, reducing the number of accesses to main memory for this data. Therefore, if the MCU does not have a cache, the write load to main memory is not decreased. The MMU has a table that maps logical addresses to physical addresses for each section of main memory, and it uses the mapping table to translate memory accesses requested by logical address to physical address. Without the MMU, memory access requests would be processed using only physical addresses, which makes it impossible to apply traditional memory mapping-based write distribution methods. Previous write distribution methods for non-volatile main memory in embedded devices have mostly utilized write information, with some studies adding dedicated hardware logic to support write distribution. However, the embedded devices that have been studied for write balancing in previous research are relatively more resource-rich than tiny devices, and write information can be acquired during runtime. On the other hand, it is difficult to acquire write information during runtime for tiny devices, and it is also challenging to add dedicated hardware for write distribution. Therefore, in this thesis, software-based write distribution method was explored considering the tiny device environment. Since the stack is the most write-intensive memory area in the main memory of a tiny device, this study aimed to distribute writes to the stack. To distribute the writes to the stack during runtime, FreeRTOS allows the application to be organized into tasks, and the task stack is migrated to distribute the writes to the stack. Time is used as the criterion for migrating the task stack, and stack migration is possible only under limited conditions to avoid data validation problem due to the relocation of the stack. In addition, since FreeRTOS uses a single heap for dynamic allocation, the memory objects allocated in the single heap reduce the freedom of stack movement, which reduces the effectiveness of write distribution. In order to increase the freedom of stack movement, a dual heap structure is introduced, consisting of a generalpurpose heap that serves as a conventional heap and a dedicated heap to which only the stack is allocated. Based on the aforementioned stack migration methods, this thesis proposed a stack migration policy with two different objectives, and performs performance analysis and evaluation. First, using random size strides to move the stack to various locations to increase the write distribution. Next, each task is allocated a dedicated migration space to reduce the overhead of moving the stack. Both migration schemes resulted in an average maximum write that was 99.4% smaller than without migration. The random size stride method had an average computation overhead of 0.3%, while the dedicated space method had an average computation overhead of 0.2%.
URI
http://hanyang.dcollection.net/common/orgView/200000687318https://repository.hanyang.ac.kr/handle/20.500.11754/187286
Appears in Collections:
GRADUATE SCHOOL[S](대학원) > ELECTRONICS AND COMPUTER ENGINEERING(전자컴퓨터통신공학과) > Theses (Ph.D.)
Files in This Item:
There are no files associated with this item.
Export
RIS (EndNote)
XLS (Excel)
XML


qrcode

Items in DSpace are protected by copyright, with all rights reserved, unless otherwise indicated.

BROWSE