Search

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

技术细节:linux内核 [2022/04/26 10:45]
baolitoumu 创建
技术细节:linux内核 [2022/04/28 14:32] (当前版本)
baolitoumu
行 1: 行 1:
-====== Linux Kernel ======+====== Linux 内核 ======
  
-===== Versions =====+===== 版本 =====
  
 ==== Remarkable ==== ==== Remarkable ====
 +
 <code> <code>
 remarkable: ~/ uname -a remarkable: ~/ uname -a
 Linux remarkable 4.1.28-zero-gravitas-01897-g7f82abb869aa-dirty #256 Tue Sep 12 08:53:59 CEST 2017 armv7l GNU/Linux Linux remarkable 4.1.28-zero-gravitas-01897-g7f82abb869aa-dirty #256 Tue Sep 12 08:53:59 CEST 2017 armv7l GNU/Linux
 +
 </code> </code>
  
-== default config == +== 默认配置 == 
-https://github.com/reMarkable/linux/blob/zero-gravitas/arch/arm/configs/zero-gravitas_defconfig+ 
 +[[https://github.com/reMarkable/linux/blob/zero-gravitas/arch/arm/configs/zero-gravitas_defconfig|https://github.com/reMarkable/linux/blob/zero-gravitas/arch/arm/configs/zero-gravitas_defconfig]]
  
 ==== Remarkable 2 ==== ==== Remarkable 2 ====
 <code> <code>
 +
 remarkable: ~/ uname -a remarkable: ~/ uname -a
 Linux reMarkable 4.14.78 #1 SMP PREEMPT Fri Sep 4 14:30:06 UTC 2020 armv7l GNU/Linux Linux reMarkable 4.14.78 #1 SMP PREEMPT Fri Sep 4 14:30:06 UTC 2020 armv7l GNU/Linux
 +
 </code> </code>
  
-== default config == +== 默认配置 ==
-https://github.com/reMarkable/linux/blob/zero-sugar/arch/arm/configs/zero-sugar_defconfig+
  
-===== Kernel Configuration =====+[[https://github.com/reMarkable/linux/blob/zero-sugar/arch/arm/configs/zero-sugar_defconfig|https://github.com/reMarkable/linux/blob/zero-sugar/arch/arm/configs/zero-sugar_defconfig]]
  
-TODO: document notes on the existing kernel config+===== 内核配置 ===== 
 + 
 +TODO: 现有内核配置的文档说明 
 + 
 +==== 有用的配置选项 ==== 
 + 
 +=== 内存优化 === 
 + 
 +== 配置_高端内存 ==
  
-==== Useful configuration options ==== 
-=== Memory Optimization === 
-== CONFIG_HIGHMEM == 
 The kernel has himem set. When an arm device has enough ram this impacts the ability to allocate virtual memory and use all of ram. The Remarkable and Remarkable 2 both have no reason to have this on, and it impacts performance. A small change makes the system more responsive and have more throughput: The kernel has himem set. When an arm device has enough ram this impacts the ability to allocate virtual memory and use all of ram. The Remarkable and Remarkable 2 both have no reason to have this on, and it impacts performance. A small change makes the system more responsive and have more throughput:
 <code> <code>
 +
 CONFIG_HIGHMEM=n CONFIG_HIGHMEM=n
 +
 </code> </code>
  
-with this change we can see the virutal memory layout on boot has no impact to available memory. Nothing running on this device likely needs more than a gig of virtual memory on top, though if you are trying to run GHC you may have issues ;-) +with this change we can see the virutal memory layout on boot has no impact to available memory. Nothing running on this device likely needs more than a gig of virtual memory on top, though if you are trying to run GHC you may have issues ;-) It may be prudent to change the kernel-userspace memory split as well, the remarkable stock has a 2G/2G split. A 1G/3G split would allow ~2G of virtually addressed space for user programs on top of available ram, which probably is sufficient for any reasonable processes on this device.
-It may be prudent to change the kernel-userspace memory split as well, the remarkable stock has a 2G/2G split. A 1G/3G split would allow ~2G of virtually addressed space for user programs on top of available ram, which probably is sufficient for any reasonable processes on this device.+
  
 <code> <code>
行 48: 行 58:
 [    0.000000]       .data : 0x80d00000 - 0x80d927c8   ( 586 kB) [    0.000000]       .data : 0x80d00000 - 0x80d927c8   ( 586 kB)
 [    0.000000]        .bss : 0x80d94000 - 0x80df9ea0   ( 408 kB) [    0.000000]        .bss : 0x80d94000 - 0x80df9ea0   ( 408 kB)
 +
 </code> </code>
  
 == CONFIG_CMA_SIZE_MBYTES == == CONFIG_CMA_SIZE_MBYTES ==
 +
 The kernel has defaults from arch/arm for the contiguous memory allocator (CMA). This is a memory reservation in RAM that allows hardware to reserve places where memory is physically (rather than virtually) contiguous so that DMA may be more optimum. The default on arch/arm was set by google engineers in 2015 to be tailored for smartphone like devices, at 320 MB to allow big transfer regions between high density pixel planes like cameras, screens, GPU and accelerators. The Remarkable has no such hardware, and uses maybe a bit more than 32MB. Setting the option below recovers 256MB of active ram (and is still probably wasting like 31MB, but that is better than 287!!): The kernel has defaults from arch/arm for the contiguous memory allocator (CMA). This is a memory reservation in RAM that allows hardware to reserve places where memory is physically (rather than virtually) contiguous so that DMA may be more optimum. The default on arch/arm was set by google engineers in 2015 to be tailored for smartphone like devices, at 320 MB to allow big transfer regions between high density pixel planes like cameras, screens, GPU and accelerators. The Remarkable has no such hardware, and uses maybe a bit more than 32MB. Setting the option below recovers 256MB of active ram (and is still probably wasting like 31MB, but that is better than 287!!):
  
 <code> <code>
 CONFIG_CMA_SIZE_MBYTES=64 CONFIG_CMA_SIZE_MBYTES=64
 +
 </code> </code>
  
 ===== Divergence from mainline (RM2, zero-sugar 4.14.78) ===== ===== Divergence from mainline (RM2, zero-sugar 4.14.78) =====
 +
 Disclaimer: this information is only a rough examination and quite likely wrong. Please feel free to update and improve upon it. Disclaimer: this information is only a rough examination and quite likely wrong. Please feel free to update and improve upon it.
  
行 63: 行 77:
  
 ==== otgcontrol ==== ==== otgcontrol ====
 +
 This is a remarkable made module that acts as a state machine to change the OTG port modes. The USB-C port PHY acts as a ethernet gadget, and this module has a state machine to detect and change some conditions. From initial examination it seems to be a product of wanting to allow the Remarkable to act as a ethernet client and be able to receive charge from the host while doing so. It uses its state detection to push onewire bus changes to set the pinctrl and usb states so that the device will flow power in. This seems to be incomplete work leaving out the needed detection to act as an OTG host. Disabling their usb gadget interface and this module may make it possible to use the device as an OTG host in a more stock kernel without too much difficulty. This is a remarkable made module that acts as a state machine to change the OTG port modes. The USB-C port PHY acts as a ethernet gadget, and this module has a state machine to detect and change some conditions. From initial examination it seems to be a product of wanting to allow the Remarkable to act as a ethernet client and be able to receive charge from the host while doing so. It uses its state detection to push onewire bus changes to set the pinctrl and usb states so that the device will flow power in. This seems to be incomplete work leaving out the needed detection to act as an OTG host. Disabling their usb gadget interface and this module may make it possible to use the device as an OTG host in a more stock kernel without too much difficulty.
 +
 +

Page Tools

Site Tools

User Tools