The difference among ioctl, unlocked_ioctl and compat_ioctl (RT)
Meta-answer: All the raw stuff happening to the Linux kernel goes through lkml (the Linux kernel mailing list). For explicative summaries, read or search lwn (Linux weekly news).
Answer: From The new way of ioctl() by Jonathan Corbet:
ioctl()
is one of the remaining parts of the kernel which runs under the Big Kernel Lock (BKL). In the past, the usage of the BKL has made it possible for long-runningioctl()
methods to create long latencies for unrelated processes.
Follows an explanation of the patch that introduced unlocked_ioctl
and compat_ioctl
into 2.6.11. The removal of the ioctl
field happened a lot later, in 2.6.36.
Explanation: When ioctl
was executed, it took the Big Kernel Lock (BKL), so nothing else could execute at the same time. This is very bad on a multiprocessor machine, so there was a big effort to get rid of the BKL. First, unlocked_ioctl
was introduced. It lets each driver writer choose what lock to use instead. This can be difficult, so there was a period of transition during which old drivers still worked (using ioctl
) but new drivers could use the improved interface (unlocked_ioctl
). Eventually all drivers were converted and ioctl
could be removed.
compat_ioctl
is actually unrelated, even though it was added at the same time. Its purpose is to allow 32-bit userland programs to make ioctl
calls on a 64-bit kernel. The meaning of the last argument to ioctl
depends on the driver, so there is no way to do a driver-independent conversion.
The difference among ioctl, unlocked_ioctl and compat_ioctl (RT)的更多相关文章
- unlocked_ioctl和compat_ioctl
参考: https://www.cnblogs.com/super119/archive/2012/12/03/2799967.html https://lwn.net/Articles/119652 ...
- Linux Device Driver 3th 中的一些坑
linux设备驱动第三版由于年代比较久远,有很多东西已过时.开一贴记录自己发现的一些问题. 4.3.1.4. seq_file接口 此节最后提到用 struct proc_dir_entry* cre ...
- ioctl,unlocked_ioctl 处理方法
kernel 2.6.35 及之前的版本中struct file_operations 一共有3个ioctl : ioctl,unlocked_ioctl和compat_ioctl 现在只有unloc ...
- [虚拟化/云] kvm的架构分析
预备知识 1. 客户机物理页框到宿主机虚拟地址转换 http://blog.csdn.net/zhuriyuxiao/article/details/8968781 http://www.tuicoo ...
- 手把手教Linux驱动3-之字符设备架构详解,有这篇就够了
一.Linux设备分类 Linux系统为了管理方便,将设备分成三种基本类型: 字符设备 块设备 网络设备 字符设备: 字符(char)设备是个能够像字节流(类似文件)一样被访问的设备,由字符设备驱动程 ...
- nvme ioctl解密
对于Nvme SSD,我们有的时候会用到ioctl系统调用,该调用的流程是怎样的呢? 首先,在注册nvme设备的时候,会初始化该设备的注册了file operations: static const ...
- 字符设备驱动之Led驱动学习记录
一.概述 Linux内核就是由各种驱动组成的,内核源码中大约有85%的各种渠道程序的代码.一般来说,编写Linux设备驱动大致流程如下: 1.查看原理图,数据手册,了解设备的操作方法. 2.在内核中找 ...
- Smart210学习记录-------Linux设备驱动结构
cdev结构体 1 struct cdev { 2 struct kobject kobj; /* 内嵌的 kobject 对象 */ 3 struct module *owner; /*所属模块*/ ...
- [tty与uart]1.Linux中tty框架与uart框架之间的调用关系剖析
转自:http://developer.51cto.com/art/201209/357501_all.htm 目录 1.tty框架 2.uart框架 3.自底向上 4.自顶向下 5.关系图 在这期间 ...
随机推荐
- 深入理解java虚拟机---虚拟机工具jhat(十六)
jhat JVM Heap Analysis Tool命令是与jmap搭配使用,用来分析jmap生成的dump,jhat内置了一个微型的HTTP/HTML服务器,生成dump的分析结果后,可以在浏览器 ...
- Spring学习五(JDBC支持)
Spring的jdbc支持 1配置db.properties,将有关JDBC的信息载入 2bean文件配置数据源,这里用e3p0作为数据源载入db.properties 3配置template的bea ...
- L327 找灵魂伴侣
Looking for the Perfect Partner I'm sure we all remember a time when we fell in love. For some it wa ...
- 解决Cannot resolve reference to bean 'txPointcut' while setting bean property 'pointcut'
忘记导入了 这三个jar包...
- Delphi和OutputDebugString
曾经想要实时监控您的Delphi应用程序,并能够查看日志消息吗?当然,您始终可以在RAD Studio IDE中以完全调试模式运行.另一种方法是输出日志消息,例如输出到文本文件.您还可以使用Outpu ...
- nodejs环境下配置运行mysql
首先需要在本地运行node环境 必须在本地安装mysql(可以用xampp里面的) 在node环境下引入mysql模块 命令: npm install node-mysql 运用例子(前提条件 ...
- 解析XML技术
转载:http://developer.51cto.com/art/200903/117512.htm XML现在已经成为一种通用的数据交换格式,它的平台无关性,语言无关性,系统无关性,给数据集成与交 ...
- c语言求最大公约数和最小公倍数(转)
最大公约数与最小公倍数的求解是很多初学C的人所面临的一道问题.当然这道问题并不难解答,也有很多人已经写过相关的博客,我在此书写此篇博客,一是为了让自己能够夯实基础,另外就是希望能够帮到和我一样的初学者 ...
- MySQL中的视图详解
一.什么是视图? 简单来说,视图就是从一张表中导出的虚拟表.视图拥有表的结构,但是在数据库中只有视图的定义,但是没有视图中的数据. 视图是由查询语句从一张表中导出来的数据,不是一张实际的表. 二.视图 ...
- Container(容器)
容器可以管理对象的生命周期.对象与对象之间的依赖关系,您可以使用一个配置文件(通常是XML),在上面定义好对象的名称.如何产生(Prototype 方式或Singleton 方式). 哪个对象产生之后 ...