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

目录
相关文章
|
Linux C语言 开发工具
Samsung_tiny4412(驱动笔记05)----Makefile,open,read,write,lseek,poll,ioctl,fasync
/*********************************************************************************** * * Makefile,open,read,wr...
792 0
|
9月前
|
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
955 0
系统编程之文件IO(六)——获取文件属性(stat、fstat、lstat、struct stat)
系统编程之文件IO(六)——获取文件属性(stat、fstat、lstat、struct stat)
179 0
系统编程之文件IO(六)——获取文件属性(stat、fstat、lstat、struct stat)
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。
|
存储 5G 调度
5G NR 系统消息
此文基于3GPP协议进行总结,主要介绍了MIB和一系列SIB消息属性,发送和获取流程。
945 0
5G NR 系统消息
|
5G 调度 数据安全/隐私保护
5G NR SIB1介绍
SIB1携带UE接入小区所需的最关键的信息,例如随机接入参数。SIB1包括关于其他SIB的可用性和调度的信息,例如,其他SIB。
1895 0
|
调度 索引
NR PUCCH(一) PUCCH format 0/1
NR中PUCCH物理信道用来发送上行控制信息Uplink Control Information(UCI),当然UCI也可以在PUSCH上发送。UCI 内容包括:CSI,HARQ ACK/NACK ,SR 及上述三者的组合信息。
|
9月前
|
算法 Unix Linux
select函数中的文件描述符(File Descriptor)范围
select函数中的文件描述符(File Descriptor)范围
121 0
select函数中的文件描述符(File Descriptor)范围
|
存储 Linux 数据安全/隐私保护
struct inode 和 struct file
*索引节点对象由inode结构体表示,定义文件在linux/fs.h中 */ struct inode {         struct hlist_node       i_hash;  ...
1269 0
NR PDSCH(六) DL data operation
NR中,网络端会根据UE业务动态的调整BWP,进而改变频域资源范围;不同的BWP会配置CORESET/Searchspace确定不同的时频域资源,让UE在对应的资源上进行盲检接收DCI;通过DCI获得调度信息后,再去PDSCH对应的时域资源和频域资源上 decode data。

热门文章

最新文章