behavior
asmlinkage notrace long parisc_madvise(unsigned long start, size_t len_in, int behavior)
switch (behavior) {
case 65: behavior = MADV_MERGEABLE; break;
case 66: behavior = MADV_UNMERGEABLE; break;
case 67: behavior = MADV_HUGEPAGE; break;
case 68: behavior = MADV_NOHUGEPAGE; break;
case 69: behavior = MADV_DONTDUMP; break;
case 70: behavior = MADV_DODUMP; break;
case 71: behavior = MADV_WIPEONFORK; break;
case 72: behavior = MADV_KEEPONFORK; break;
case 73: behavior = MADV_COLLAPSE; break;
return sys_madvise(start, len_in, behavior);
struct hl_mmap_mem_buf_behavior *behavior, gfp_t gfp,
struct hl_mmap_mem_buf_behavior *behavior;
struct hl_mmap_mem_buf_behavior *behavior, gfp_t gfp,
behavior->topic, rc);
buf->behavior = behavior;
buf->handle = (((u64)rc | buf->behavior->mem_id) << PAGE_SHIFT);
rc = buf->behavior->alloc(buf, gfp, args);
behavior->topic, rc);
buf->behavior->topic, user_mem_size, buf->mappable_size);
buf->behavior->topic, vma->vm_start);
buf->behavior->topic);
rc = buf->behavior->mmap(buf, vma, args);
topic = buf->behavior->topic;
mem_id = buf->behavior->mem_id;
if (buf->behavior->release)
buf->behavior->release(buf);
u8 mode, behavior;
behavior = (rc & LED_COMBINE_DIS_MASK(index)) >> index;
if (!behavior && *rules)
const struct pci_bridge_reg_behavior *behavior;
behavior = bridge->pci_regs_behavior;
behavior = NULL;
behavior = bridge->pcie_cap_regs_behavior;
behavior = NULL;
if (behavior)
*value &= behavior[reg / 4].ro | behavior[reg / 4].rw |
behavior[reg / 4].w1c;
const struct pci_bridge_reg_behavior *behavior;
behavior = bridge->pci_regs_behavior;
behavior = bridge->pcie_cap_regs_behavior;
behavior = NULL;
if (behavior) {
new = old & (~mask | ~behavior[reg / 4].rw);
new |= (value << shift) & (behavior[reg / 4].rw & mask);
new &= ~((value << shift) & (behavior[reg / 4].w1c & mask));
if (behavior) {
new &= ~(behavior[reg / 4].w1c & ~mask);
new |= (value << shift) & (behavior[reg / 4].w1c & mask);
enum evict_behavior behavior;
behavior = evict_should_delete(inode, &gh);
if (behavior == EVICT_SHOULD_DEFER_DELETE &&
behavior = EVICT_SHOULD_SKIP_DELETE;
if (behavior == EVICT_SHOULD_DELETE)
extern int do_madvise(struct mm_struct *mm, unsigned long start, size_t len_in, int behavior);
asmlinkage long sys_madvise(unsigned long start, size_t len, int behavior);
size_t vlen, int behavior, unsigned int flags);
struct damon_region *r, int behavior)
struct damon_region *r, int behavior)
applied = do_madvise(mm, start, len, behavior) ? 0 : len;
int state, enum behavior behavior)
if (behavior == EXCLUSIVE) {
if (behavior == DROP)
if (behavior != EXCLUSIVE)
if (behavior == EXCLUSIVE)
static bool is_discard(int behavior)
switch (behavior) {
if (!is_discard(madv_behavior->behavior))
int behavior = madv_behavior->behavior;
switch (behavior) {
behavior, &new_flags);
error = hugepage_madvise(vma, &new_flags, behavior);
if (madv_behavior->behavior == MADV_SOFT_OFFLINE) {
switch (madv_behavior->behavior) {
madvise_behavior_valid(int behavior)
switch (behavior) {
bool set_new_anon_name = madv_behavior->behavior == __MADV_SET_ANON_VMA_NAME;
static bool process_madvise_remote_valid(int behavior)
switch (behavior) {
static bool prepares_anon_vma(int behavior)
switch (behavior) {
prepares_anon_vma(madv_behavior->behavior) && !vma->anon_vma)
switch (madv_behavior->behavior) {
static bool madvise_batch_tlb_flush(int behavior)
switch (behavior) {
if (madvise_batch_tlb_flush(madv_behavior->behavior))
if (madvise_batch_tlb_flush(madv_behavior->behavior))
static bool is_valid_madvise(unsigned long start, size_t len_in, int behavior)
if (!madvise_behavior_valid(behavior))
int behavior, int *err)
if (!is_valid_madvise(start, len_in, behavior)) {
switch (madv_behavior->behavior) {
int do_madvise(struct mm_struct *mm, unsigned long start, size_t len_in, int behavior)
.behavior = behavior,
if (madvise_should_skip(start, len_in, behavior, &error))
SYSCALL_DEFINE3(madvise, unsigned long, start, size_t, len_in, int, behavior)
return do_madvise(current->mm, start, len_in, behavior);
int behavior)
.behavior = behavior,
if (madvise_should_skip(start, len_in, behavior, &error))
size_t, vlen, int, behavior, unsigned int, flags)
if (mm != current->mm && !process_madvise_remote_valid(behavior)) {
ret = vector_madvise(mm, &iter, behavior);
.behavior = __MADV_SET_ANON_VMA_NAME,
int behavior;
int behavior = madv_behavior->behavior;
if (behavior != MADV_DONTNEED_LOCKED)
if (behavior != MADV_DONTNEED && behavior != MADV_DONTNEED_LOCKED)
int behavior = madv_behavior->behavior;
if (behavior == MADV_DONTNEED || behavior == MADV_DONTNEED_LOCKED)
else if (behavior == MADV_FREE)
const bool write = madv_behavior->behavior == MADV_POPULATE_WRITE;
#define FS_USE(behavior, fstype) \
behavior, fstype, mls ? ":" SYSTEMLOW : "")
return (devcg->behavior != DEVCG_DEFAULT_NONE);
dev_cgroup->behavior = DEVCG_DEFAULT_ALLOW;
dev_cgroup->behavior = parent_dev_cgroup->behavior;
dev_cgroup->behavior = DEVCG_DEFAULT_NONE;
dev_cgroup->behavior = DEVCG_DEFAULT_NONE;
if (devcgroup->behavior == DEVCG_DEFAULT_ALLOW) {
enum devcg_behavior behavior)
if (dev_cgroup->behavior == DEVCG_DEFAULT_ALLOW) {
if (behavior == DEVCG_DEFAULT_ALLOW) {
enum devcg_behavior behavior;
return verify_new_ex(parent, ex, childcg->behavior);
if (childcg->behavior == DEVCG_DEFAULT_DENY)
return parent->behavior == DEVCG_DEFAULT_ALLOW;
if (devcg_root->behavior == DEVCG_DEFAULT_ALLOW &&
devcg->behavior == DEVCG_DEFAULT_ALLOW) {
devcgroup->behavior = DEVCG_DEFAULT_ALLOW;
devcgroup->behavior = DEVCG_DEFAULT_ALLOW;
devcgroup->behavior = DEVCG_DEFAULT_DENY;
if (devcgroup->behavior == DEVCG_DEFAULT_ALLOW) {
if (devcgroup->behavior == DEVCG_DEFAULT_DENY)
if (dev_cgroup->behavior == DEVCG_DEFAULT_ALLOW)
switch (sbsec->behavior) {
(sbsec->behavior == SECURITY_FS_USE_MNTPOINT)) {
switch (sbsec->behavior) {
sbsec->behavior = SECURITY_FS_USE_GENFS;
if (sbsec->behavior == SECURITY_FS_USE_XATTR) {
if (!sbsec->behavior) {
if (sbsec->behavior == SECURITY_FS_USE_XATTR) {
sbsec->behavior = SECURITY_FS_USE_MNTPOINT;
sbsec->behavior = SECURITY_FS_USE_NATIVE;
sbsec->behavior = SECURITY_FS_USE_NATIVE;
sbsec->behavior = SECURITY_FS_USE_MNTPOINT;
if (sbsec->behavior != SECURITY_FS_USE_XATTR &&
sbsec->behavior != SECURITY_FS_USE_NATIVE) {
newsbsec->behavior = oldsbsec->behavior;
if (newsbsec->behavior == SECURITY_FS_USE_NATIVE &&
newsbsec->behavior = SECURITY_FS_USE_NATIVE;
unsigned short behavior; /* labeling behavior */
c->v.behavior = le32_to_cpu(buf[0]);
if (c->v.behavior == SECURITY_FS_USE_MNTPOINT)
if (c->v.behavior > SECURITY_FS_USE_MAX)
buf[0] = cpu_to_le32(c->v.behavior);
u32 behavior; /* labeling behavior for fs_use */
sbsec->behavior = SECURITY_FS_USE_NONE;
sbsec->behavior = c->v.behavior;
sbsec->behavior = SECURITY_FS_USE_NONE;
sbsec->behavior = SECURITY_FS_USE_GENFS;
static size_t madvise__scnprintf_behavior(int behavior, char *bf, size_t size)
if (behavior < strarray__madvise_advices.nr_entries && strarray__madvise_advices.entries[behavior] != NULL)
return scnprintf(bf, size, "MADV_%s", strarray__madvise_advices.entries[behavior]);
return scnprintf(bf, size, "%#", behavior);