linux-kernel

_spin_unlock_irqrestore() has very high sampling rate in my kvm, why?

依然范特西╮ 提交于 2020-12-29 13:15:54
问题 I run a SPECJbb benchmark in my KVM virtual machine. It shows a drastic drop on throughput between Warehouse 2 and Warehouse 3(The different between them is just addding on cocurrent task) Then I use perf in my guest virtual machine. It shows that _spin_unlock_irqrestore has very high sampling rate. Events: 31K cycles 74.89% [kernel] [k] _spin_unlock_irqrestore 7.36% perf-1968.map [.] 0x7f84b913e064 6.82% [kernel] [k] __do_softirq 6.39% [kernel] [k] handle_IRQ_event ... It seems that only 7

_spin_unlock_irqrestore() has very high sampling rate in my kvm, why?

☆樱花仙子☆ 提交于 2020-12-29 13:15:30
问题 I run a SPECJbb benchmark in my KVM virtual machine. It shows a drastic drop on throughput between Warehouse 2 and Warehouse 3(The different between them is just addding on cocurrent task) Then I use perf in my guest virtual machine. It shows that _spin_unlock_irqrestore has very high sampling rate. Events: 31K cycles 74.89% [kernel] [k] _spin_unlock_irqrestore 7.36% perf-1968.map [.] 0x7f84b913e064 6.82% [kernel] [k] __do_softirq 6.39% [kernel] [k] handle_IRQ_event ... It seems that only 7

Adding new System Call to Linux Kernel 3.13 on 64 bit system

陌路散爱 提交于 2020-12-29 05:45:48
问题 I'm trying to add a simple helloworld System Call to kernel 3.13.0-37-generic on 64 bit system. I'll try to show what I did so far step by step : 1- I've downloaded kernel source by : sudo apt-get source linux-image-3.13.0-37-generic After that, kernel source files extracted to /usr/src/ 2- Define a new system call sys_hello() : I've created a directory with hello name in the kernel source directory in /usr/src/linux-3.13/ And I created a hello.c file in hello directory with below content :

Adding new System Call to Linux Kernel 3.13 on 64 bit system

浪子不回头ぞ 提交于 2020-12-29 05:45:14
问题 I'm trying to add a simple helloworld System Call to kernel 3.13.0-37-generic on 64 bit system. I'll try to show what I did so far step by step : 1- I've downloaded kernel source by : sudo apt-get source linux-image-3.13.0-37-generic After that, kernel source files extracted to /usr/src/ 2- Define a new system call sys_hello() : I've created a directory with hello name in the kernel source directory in /usr/src/linux-3.13/ And I created a hello.c file in hello directory with below content :

how to disable CONFIG_STRICT_DEVMEM through make menuconfig or make nconfig

Deadly 提交于 2020-12-26 09:14:53
问题 I need to disable a CONFIG_STRICT_DEVMEM option in my Linux kernel and recompile it. Why? I was told to do so. I know I can disable it by simply commenting it out in the .config file, but I need to see how it is done through make menuconfig or make nconfig . Why? This is for a demo and I need to be able to show it. Does anyone know how to do it? Any help is appreciated. 回答1: If you don't know your way around menuconfig, hit / to search (à la vim and friends), and type in enough of the config

Android sensors hardware abstraction layer

ぐ巨炮叔叔 提交于 2020-12-14 13:01:34
问题 I'm working on sensor data acquisition in Android (Jelly Bean on Samsung Galaxy S3). I'm new to Android/Linux internals. I'm trying to read Android sources on how the sensor samples rise from the drivers to userspace. As a reference take a look here. I can go all the way from the SensorManager down to the SensorService. I can see the kernel module loading infrastructure, the registration of the event input device and the input_report_rel() function calls in the drivers (e.g. the open-sourced

Android sensors hardware abstraction layer

白昼怎懂夜的黑 提交于 2020-12-14 12:59:46
问题 I'm working on sensor data acquisition in Android (Jelly Bean on Samsung Galaxy S3). I'm new to Android/Linux internals. I'm trying to read Android sources on how the sensor samples rise from the drivers to userspace. As a reference take a look here. I can go all the way from the SensorManager down to the SensorService. I can see the kernel module loading infrastructure, the registration of the event input device and the input_report_rel() function calls in the drivers (e.g. the open-sourced

How to access IP_DF and IP_MF from iph->frag_offset when using netfilter

元气小坏坏 提交于 2020-12-13 07:19:58
问题 I am trying to write a netfilter module and want to access the fields of the IPHeader that denotes the DF and MF fields. I can access most other fields as desired but I think I have to extract the DF and MF fields from the ipheader in the struct and manipulate them say for example I want to set or unset the DF bit depending on the type of packet I receive. The below structure has 'frag_off' how do I access/rewrite IP_DF and IP_MF from this? struct iphdr { #if defined(__LITTLE_ENDIAN_BITFIELD)

How to access IP_DF and IP_MF from iph->frag_offset when using netfilter

谁说我不能喝 提交于 2020-12-13 07:18:13
问题 I am trying to write a netfilter module and want to access the fields of the IPHeader that denotes the DF and MF fields. I can access most other fields as desired but I think I have to extract the DF and MF fields from the ipheader in the struct and manipulate them say for example I want to set or unset the DF bit depending on the type of packet I receive. The below structure has 'frag_off' how do I access/rewrite IP_DF and IP_MF from this? struct iphdr { #if defined(__LITTLE_ENDIAN_BITFIELD)

High kernel memory usage in Kubernetes Node

戏子无情 提交于 2020-12-12 06:44:05
问题 I am pretty desperate searching for a solution to this. I am running a Kubernetes Cluster (v1.16.7) on AWS. Node specs are : It is an Amazon EC2 t3.medium instance with 4GB RAM and AMI: k8s-1.11-debian-stretch-amd64-hvm-ebs-2018-08-17 with kernel: 4.9.0-7-amd64 My main problem is that I see increased memory usage in the kernel, which leads to faster memory starvation issues in my node. More specifically: free -m : total used free shared buff/cache available Mem: 3895 3470 130 3 294 204 Swap: