linux-kernel

Difference b/w Filesystem I/O (__GFP_FS) and Disk I/O (__GFP_IO)

倾然丶 夕夏残阳落幕 提交于 2021-02-10 14:28:39
问题 May i know in linux kernel what is the difference between filesystem I/O (GFP_FS) and Disk I/O (GFP_IO)? 回答1: It is plain and simple that filesystem I/O is I/O happening on the filesystem. Lets say you are reading/writing on a file which is represented on the filesystem. The disk IO is the IO happening directly on the disk. This is block IO. On a layering standpoint you can say, the disk IO happens at a low level than the file system IO. And you can even say, the filesystem IO may get

BCM2708 (RPi) Rasbpian FIQ not triggered

风格不统一 提交于 2021-02-10 11:46:23
问题 I have written a Linux Loadable Kernel Module which attempts to attach to the FIQ to service GPIO edge transistions. The Pin in question is on GPIO0 (IRQ 49) so I attempt to configure the FIQ as follows: #ifndef GPIO_BASE #define GPIO_BASE 0x7E200000 #endif #define GPIO_LEN 0x60 #define GPIO_GPEDS0 0x10 #define GPIO_GPEDS1 0x11 #define GPIO_GPREN0 0x13 #define GPIO_GPREN1 0x14 #define GPIO_GPFEN0 0x16 #define GPIO_GPFEN1 0x17 #define AIR_BASE 0x7E00B200 #define AIR_LEN 0x28 #define AIR_IP2 2

How correctly wake up process inside interrupt handlers

一个人想着一个人 提交于 2021-02-10 07:14:00
问题 Briefly, in a read method i check if a variable is 0 and if it's i put the current process to sleep: static ssize_t soc2e_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos) { ... struct soc2e_dev *soc2e = (struct soc2e_dev *)filp->private_data; if (soc2e->bytes == 0) { if (wait_event_interruptible(soc2e->wlist, (soc2e->bytes > 0))) return -ERESTARTSYS; } ... } I must wake up the process in an interrupt handler: static irqreturn_t soc2e_irq_handler(int irq, void *dev) { ...

How correctly wake up process inside interrupt handlers

假装没事ソ 提交于 2021-02-10 07:12:27
问题 Briefly, in a read method i check if a variable is 0 and if it's i put the current process to sleep: static ssize_t soc2e_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos) { ... struct soc2e_dev *soc2e = (struct soc2e_dev *)filp->private_data; if (soc2e->bytes == 0) { if (wait_event_interruptible(soc2e->wlist, (soc2e->bytes > 0))) return -ERESTARTSYS; } ... } I must wake up the process in an interrupt handler: static irqreturn_t soc2e_irq_handler(int irq, void *dev) { ...

How correctly wake up process inside interrupt handlers

雨燕双飞 提交于 2021-02-10 07:11:41
问题 Briefly, in a read method i check if a variable is 0 and if it's i put the current process to sleep: static ssize_t soc2e_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos) { ... struct soc2e_dev *soc2e = (struct soc2e_dev *)filp->private_data; if (soc2e->bytes == 0) { if (wait_event_interruptible(soc2e->wlist, (soc2e->bytes > 0))) return -ERESTARTSYS; } ... } I must wake up the process in an interrupt handler: static irqreturn_t soc2e_irq_handler(int irq, void *dev) { ...

When signal handler is not called when segment fault occurs?

允我心安 提交于 2021-02-10 06:11:47
问题 Below is the operation method of my program, and there was a case where the registered handler was not called when the program was terminated due to the occurrence of a segment fault. Is there a case where the registered handler can be terminated without being called when a segment fault occurs? When initializing program A, register handler through signal() function.( SIGSEGV, SIGABRT, SIGFPE, SIGTERM ) fork() -> waitpid() for program A in program B Aging Segment Fault occurs due to unknown

When signal handler is not called when segment fault occurs?

你离开我真会死。 提交于 2021-02-10 06:11:39
问题 Below is the operation method of my program, and there was a case where the registered handler was not called when the program was terminated due to the occurrence of a segment fault. Is there a case where the registered handler can be terminated without being called when a segment fault occurs? When initializing program A, register handler through signal() function.( SIGSEGV, SIGABRT, SIGFPE, SIGTERM ) fork() -> waitpid() for program A in program B Aging Segment Fault occurs due to unknown

How to get information about wireless net_devices

一曲冷凌霜 提交于 2021-02-10 05:30:27
问题 I am working in Linux kernel module which is using NF_INET_PRE_ROUTING hook. In that hook I need to know the status of all my net_devices, specially wireless devices. I am able get some information about devices from net_device->flags i.e IFF_UP is device up or down. But I need some more detail about the wireless net_device . Is net_device wireless / wired? Is wireless devices connected to wireless access point? If yes which wireless access point (name of access point)? Gateway address

How to get information about wireless net_devices

爱⌒轻易说出口 提交于 2021-02-10 05:27:55
问题 I am working in Linux kernel module which is using NF_INET_PRE_ROUTING hook. In that hook I need to know the status of all my net_devices, specially wireless devices. I am able get some information about devices from net_device->flags i.e IFF_UP is device up or down. But I need some more detail about the wireless net_device . Is net_device wireless / wired? Is wireless devices connected to wireless access point? If yes which wireless access point (name of access point)? Gateway address

Replace kernel builtin module with a loadable one

我与影子孤独终老i 提交于 2021-02-08 18:47:56
问题 I have developped a kernel module to manage a nf4 tag as a char device. I have developped this module outside of the kernel and tested it compiled as a loadable kernel module (i.e. .ko) during the development phase. Once the driver has been functional and stable enough I have inserted it into linux kernel source (v4.9.30) using patches so it's built as part of the kernel. Here I'm in the situation where the module is loaded probed at boot by kernel as it's builtin and it appears into the