NR_OPEN 与 NR_FILE 的区别

简介: NR_OPEN 与 NR_FILE 的区别 阅读0.11版的内核源码时,在linux-0.11/fs/pipe.c中,函数sys_pipe()里面出现了2个宏定义,NR_OPEN 与 NR_FILE。

NR_OPEN NR_FILE 的区别

阅读0.11版的内核源码时,在linux-0.11/fs/pipe.c中,函数sys_pipe()里面出现了2个宏定义,NR_OPEN NR_FILE。下面说明一下它们的区别:

1. NR_OPEN is the maximum number of files that can be opened by process

NR_OPEN是一个进程可以打开的最大文件数。

A process cannot use more than NR_OPEN file descriptors.

一个进程不能使用超过NR_OPEN文件描述符。

The kernel also enforces a dynamic bound on the maximum number of file descriptors in the signal-<rlim[RLIMIT_NOFILE] structure of the process descriptor; this value is usually 1,024, but it can be raised if the process has root privileges.

2. NR_FILE is the limit on total number of files in the system at any given point in time

NR_FILE 是系统在某一给定时刻,限制的文件总数

While initializing the kernel we setup the vfs cache with

start_kernel
vfs_caches_init(num_physpages);
files_init(mempages);

fs/file_table.c says

/* One file with associated inode and dcache is very roughly 1K.
* Per default don't use more than 10% of our memory for files.

n = (mempages * (PAGE_SIZE / 1024)) / 10;
this n can never be greater than NR_FILE

原文

http://blog.chinaunix.net/uid-24807808-id-3077199.html

目录
相关文章
|
6月前
|
安全 大数据 Linux
总结下 fs.file-max,ulimit -n 和 lsof的异同
总结下 fs.file-max,ulimit -n 和 lsof的异同
|
16天前
|
Linux 开发者
Linux文件编程(open read write close函数)
通过这些函数,开发者可以在Linux环境下进行文件的读取、写入和管理。 买CN2云服务器,免备案服务器,高防服务器,就选蓝易云。百度搜索:蓝易云
84 4
|
3月前
|
Linux
内核态的文件操作函数:filp_open、filp_close、vfs_read、vfs_write、set_fs、get_fs
内核态的文件操作函数:filp_open、filp_close、vfs_read、vfs_write、set_fs、get_fs
79 0
|
8月前
|
调度 索引
NR PUCCH(一) PUCCH format 0/1
NR中PUCCH物理信道用来发送上行控制信息Uplink Control Information(UCI),当然UCI也可以在PUSCH上发送。UCI 内容包括:CSI,HARQ ACK/NACK ,SR 及上述三者的组合信息。
|
8月前
|
调度
R16 NR CDRX
在NR中降低UE功耗一直比较重要,如38.300 power saving 所述,NR 中UE power saving的机制有很多,包含DRX ,BWP adaption, dormancy BWP, DCP(DCI with CRC scrambled by PS-RNTI),跨时隙调度,放松测量等。dormancy BWP和DCP都集中在dormancy BWP中介绍,这篇CDRX也会提及部分内容;放松测量大概内容主要在38.304及38.133,而这篇主要看下CDRX。
系统编程之文件IO(六)——获取文件属性(stat、fstat、lstat、struct stat)
系统编程之文件IO(六)——获取文件属性(stat、fstat、lstat、struct stat)
系统编程之文件IO(六)——获取文件属性(stat、fstat、lstat、struct stat)
|
Unix Linux
cat /proc/bus/input/devices 文件内容详解
cat /proc/bus/input/devices 文件内容详解
381 0
cat /proc/bus/input/devices 文件内容详解
|
5G 调度 数据安全/隐私保护
5G NR SIB1介绍
SIB1携带UE接入小区所需的最关键的信息,例如随机接入参数。SIB1包括关于其他SIB的可用性和调度的信息,例如,其他SIB。
1474 0
|
存储 5G 调度
5G NR 系统消息
此文基于3GPP协议进行总结,主要介绍了MIB和一系列SIB消息属性,发送和获取流程。
718 0
5G NR 系统消息
|
Linux
Linux 执行partprobe命令时遇到Unable to open /dev/sr0 read-write (Read-only file system)
在使用fdisk创建分区时,我们会使用partprobe命令可以使kernel重新读取分区信息,从而避免重启系统,但是有时候会遇到下面错误信息“Warning: Unable to open /dev/sr0 read-write (Read-only file system).
3195 0

热门文章

最新文章