cregit-Linux how code gets into the kernel

Release 4.14 include/linux/mman.h

Directory: include/linux
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_MMAN_H

#define _LINUX_MMAN_H

#include <linux/mm.h>
#include <linux/percpu_counter.h>

#include <linux/atomic.h>
#include <uapi/linux/mman.h>

extern int sysctl_overcommit_memory;
extern int sysctl_overcommit_ratio;
extern unsigned long sysctl_overcommit_kbytes;
extern struct percpu_counter vm_committed_as;

#ifdef CONFIG_SMP
extern s32 vm_committed_as_batch;
#else

#define vm_committed_as_batch 0
#endif

unsigned long vm_memory_committed(void);


static inline void vm_acct_memory(long pages) { percpu_counter_add_batch(&vm_committed_as, pages, vm_committed_as_batch); }

Contributors

PersonTokensPropCommitsCommitProp
Andrew Morton1470.00%125.00%
Motohiro Kosaki315.00%125.00%
Tim Chen210.00%125.00%
Nikolay Borisov15.00%125.00%
Total20100.00%4100.00%


static inline void vm_unacct_memory(long pages) { vm_acct_memory(-pages); }

Contributors

PersonTokensPropCommitsCommitProp
Andrew Morton16100.00%1100.00%
Total16100.00%1100.00%

/* * Allow architectures to handle additional protection bits */ #ifndef arch_calc_vm_prot_bits #define arch_calc_vm_prot_bits(prot, pkey) 0 #endif #ifndef arch_vm_get_page_prot #define arch_vm_get_page_prot(vm_flags) __pgprot(0) #endif #ifndef arch_validate_prot /* * This is called from mprotect(). PROT_GROWSDOWN and PROT_GROWSUP have * already been masked out. * * Returns true if the prot flags are valid */
static inline bool arch_validate_prot(unsigned long prot) { return (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC | PROT_SEM)) == 0; }

Contributors

PersonTokensPropCommitsCommitProp
Dave Kleikamp2896.55%150.00%
Chen Gang S13.45%150.00%
Total29100.00%2100.00%

#define arch_validate_prot arch_validate_prot #endif /* * Optimisation macro. It is equivalent to: * (x & bit1) ? bit2 : 0 * but this version is faster. * ("bit1" and "bit2" must be single bits) */ #define _calc_vm_trans(x, bit1, bit2) \ ((bit1) <= (bit2) ? ((x) & (bit1)) * ((bit2) / (bit1)) \ : ((x) & (bit1)) / ((bit1) / (bit2))) /* * Combine the mmap "prot" argument into "vm_flags" used internally. */
static inline unsigned long calc_vm_prot_bits(unsigned long prot, unsigned long pkey) { return _calc_vm_trans(prot, PROT_READ, VM_READ ) | _calc_vm_trans(prot, PROT_WRITE, VM_WRITE) | _calc_vm_trans(prot, PROT_EXEC, VM_EXEC) | arch_calc_vm_prot_bits(prot, pkey); }

Contributors

PersonTokensPropCommitsCommitProp
Jamie Lokier4078.43%133.33%
Dave Hansen611.76%133.33%
Dave Kleikamp59.80%133.33%
Total51100.00%3100.00%

/* * Combine the mmap "flags" argument into "vm_flags" used internally. */
static inline unsigned long calc_vm_flag_bits(unsigned long flags) { return _calc_vm_trans(flags, MAP_GROWSDOWN, VM_GROWSDOWN ) | _calc_vm_trans(flags, MAP_DENYWRITE, VM_DENYWRITE ) | _calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED ); }

Contributors

PersonTokensPropCommitsCommitProp
Jamie Lokier3587.50%150.00%
Michel Lespinasse512.50%150.00%
Total40100.00%2100.00%

unsigned long vm_commit_limit(void); #endif /* _LINUX_MMAN_H */

Overall Contributors

PersonTokensPropCommitsCommitProp
Jamie Lokier8932.13%15.00%
Dave Kleikamp6824.55%15.00%
Andrew Morton4114.80%420.00%
Tim Chen176.14%15.00%
Jerome Marchand124.33%210.00%
Linus Torvalds (pre-git)113.97%210.00%
Motohiro Kosaki82.89%15.00%
Dave Hansen82.89%15.00%
K. Y. Srinivasan72.53%15.00%
Michel Lespinasse51.81%15.00%
David Woodhouse41.44%15.00%
David Howells41.44%15.00%
Nikolay Borisov10.36%15.00%
Chen Gang S10.36%15.00%
Greg Kroah-Hartman10.36%15.00%
Total277100.00%20100.00%
Directory: include/linux
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.