Specifies the maximum number of concurrent unauthenticated connections to the SSH daemon. Additional connections will be dropped until authentication succeeds or the LoginGraceTime expires for a connection. The default is 10.
Alternatively, random early drop can be enabled by specifying the three colon separated values ''start:rate:full'' (e.g. "10:30:60"). sshd(8) will refuse connection attempts with a probability of ''rate/100'' (30%) if there are currently ''start'' (10) unauthenticated connections. The probability increases linearly and all connection attempts are refused if the number of unauthenticated connections reaches ''full'' (60).
structvm_area_struct { /* The first cache line has the info for VMA tree walking. */ unsignedlong vm_start; /* Our start address within vm_mm. */ unsignedlong vm_end; /* The first byte after our end address within vm_mm. */ /* linked list of VM areas per task, sorted by address */ structvm_area_struct *vm_next, *vm_prev; structrb_nodevm_rb; unsignedlong rb_subtree_gap; structmm_struct *vm_mm;/* The address space we belong to. */ pgprot_t vm_page_prot; /* Access permissions of this VMA. */ unsignedlong vm_flags; /* Flags, see mm.h. */ struct { structrb_noderb; unsignedlong rb_subtree_last; } shared; structlist_headanon_vma_chain;/* Serialized by mmap_sem & * page_table_lock */ structanon_vma *anon_vma;/* Serialized by page_table_lock */ /* Function pointers to deal with this struct. */ conststructvm_operations_struct *vm_ops; /* Information about our backing store: */ unsignedlong vm_pgoff; /* Offset (within vm_file) in PAGE_SIZE units, *not* PAGE_CACHE_SIZE */ structfile * vm_file;/* File we map to (can be NULL). */ void * vm_private_data; /* was vm_pte (shared mem) */ ... };
总结mmap文件映射过程: a) 用户在进程中触发mmap操作; b) 内核对参数做基本的校验,并针对映射长度做一些内存对齐; c) 分配vm_area_struct结构,并对其进行初始化; d) 调用文件系统的mmap映射,将缺页异常等函数指针赋于vm_ops; e) 将新建的vm_area_struct结构插入到mm链表中; f) 当进程访问这片内存时,引发缺页异常,从而调用filemap_fault; g) 缺页异常查找cache中有无请求的页,如果没有,内核发起请求将数据从磁盘装入内存;
3、mmap和read/write的区别
read的系统调用的流程大概如下图所示:
a) 用户进程发起read操作; b) 内核会做一些基本的page cache判断,从磁盘中读取数据到kernel buffer中; c) 然后内核将buffer的数据再拷贝至用户态的user buffer; d) 唤醒用户进程继续执行;