/mm/kfence/ |
D | kfence_test.c | 38 static void probe_console(void *ignore, const char *buf, size_t len) in probe_console() argument 46 if (strnstr(buf, "BUG: KFENCE: ", len) && strnstr(buf, "test_", len)) { in probe_console() 53 strscpy(observed.lines[0], buf, min(len + 1, sizeof(observed.lines[0]))); in probe_console() 55 } else if (nlines == 1 && (strnstr(buf, "at 0x", len) || strnstr(buf, "of 0x", len))) { in probe_console() 56 strscpy(observed.lines[nlines++], buf, min(len + 1, sizeof(observed.lines[0]))); in probe_console() 308 char *buf; in test_out_of_bounds_read() local 321 buf = test_alloc(test, size, GFP_KERNEL, ALLOCATE_LEFT); in test_out_of_bounds_read() 322 expect.addr = buf - 1; in test_out_of_bounds_read() 325 test_free(buf); in test_out_of_bounds_read() 327 buf = test_alloc(test, size, GFP_KERNEL, ALLOCATE_RIGHT); in test_out_of_bounds_read() [all …]
|
D | report.c | 51 char buf[64]; in get_stack_skipnr() local 73 int len = scnprintf(buf, sizeof(buf), "%ps", (void *)stack_entries[skipnr]); in get_stack_skipnr() 75 if (str_has_prefix(buf, ARCH_FUNC_PREFIX "kfence_") || in get_stack_skipnr() 76 str_has_prefix(buf, ARCH_FUNC_PREFIX "__kfence_") || in get_stack_skipnr() 77 !strncmp(buf, ARCH_FUNC_PREFIX "__slab_free", len)) { in get_stack_skipnr() 86 if (str_has_prefix(buf, ARCH_FUNC_PREFIX "kfree") || in get_stack_skipnr() 87 str_has_prefix(buf, ARCH_FUNC_PREFIX "kmem_cache_free") || in get_stack_skipnr() 88 str_has_prefix(buf, ARCH_FUNC_PREFIX "__kmalloc") || in get_stack_skipnr() 89 str_has_prefix(buf, ARCH_FUNC_PREFIX "kmem_cache_alloc")) in get_stack_skipnr()
|
/mm/damon/ |
D | dbgfs-test.h | 83 char buf[64]; in damon_dbgfs_test_set_targets() local 90 sprint_target_ids(ctx, buf, 64); in damon_dbgfs_test_set_targets() 91 KUNIT_EXPECT_STREQ(test, (char *)buf, "1 2 3\n"); in damon_dbgfs_test_set_targets() 94 sprint_target_ids(ctx, buf, 64); in damon_dbgfs_test_set_targets() 95 KUNIT_EXPECT_STREQ(test, (char *)buf, "\n"); in damon_dbgfs_test_set_targets() 98 sprint_target_ids(ctx, buf, 64); in damon_dbgfs_test_set_targets() 99 KUNIT_EXPECT_STREQ(test, (char *)buf, "1 2\n"); in damon_dbgfs_test_set_targets() 102 sprint_target_ids(ctx, buf, 64); in damon_dbgfs_test_set_targets() 103 KUNIT_EXPECT_STREQ(test, (char *)buf, "2\n"); in damon_dbgfs_test_set_targets() 106 sprint_target_ids(ctx, buf, 64); in damon_dbgfs_test_set_targets() [all …]
|
D | dbgfs.c | 26 static char *user_input_str(const char __user *buf, size_t count, loff_t *ppos) in user_input_str() argument 39 ret = simple_write_to_buffer(kbuf, count + 1, ppos, buf, count); in user_input_str() 50 char __user *buf, size_t count, loff_t *ppos) in dbgfs_attrs_read() argument 63 return simple_read_from_buffer(buf, count, ppos, kbuf, ret); in dbgfs_attrs_read() 67 const char __user *buf, size_t count, loff_t *ppos) in dbgfs_attrs_write() argument 74 kbuf = user_input_str(buf, count, ppos); in dbgfs_attrs_write() 100 static ssize_t sprint_schemes(struct damon_ctx *c, char *buf, ssize_t len) in sprint_schemes() argument 107 rc = scnprintf(&buf[written], len - written, in sprint_schemes() 131 static ssize_t dbgfs_schemes_read(struct file *file, char __user *buf, in dbgfs_schemes_read() argument 147 len = simple_read_from_buffer(buf, count, ppos, kbuf, len); in dbgfs_schemes_read() [all …]
|
/mm/ |
D | hugetlb_cgroup.c | 499 char *buf, size_t nbytes, loff_t off, in hugetlb_cgroup_write() argument 510 buf = strstrip(buf); in hugetlb_cgroup_write() 511 ret = page_counter_memparse(buf, max, &nr_pages); in hugetlb_cgroup_write() 537 char *buf, size_t nbytes, loff_t off) in hugetlb_cgroup_write_legacy() argument 539 return hugetlb_cgroup_write(of, buf, nbytes, off, "-1"); in hugetlb_cgroup_write_legacy() 543 char *buf, size_t nbytes, loff_t off) in hugetlb_cgroup_write_dfl() argument 545 return hugetlb_cgroup_write(of, buf, nbytes, off, "max"); in hugetlb_cgroup_write_dfl() 549 char *buf, size_t nbytes, loff_t off) in hugetlb_cgroup_reset() argument 578 static char *mem_fmt(char *buf, int size, unsigned long hsize) in mem_fmt() argument 581 snprintf(buf, size, "%luGB", hsize >> 30); in mem_fmt() [all …]
|
D | ksm.c | 2841 struct kobj_attribute *attr, char *buf) in sleep_millisecs_show() argument 2843 return sprintf(buf, "%u\n", ksm_thread_sleep_millisecs); in sleep_millisecs_show() 2848 const char *buf, size_t count) in sleep_millisecs_store() argument 2853 err = kstrtoul(buf, 10, &msecs); in sleep_millisecs_store() 2865 struct kobj_attribute *attr, char *buf) in pages_to_scan_show() argument 2867 return sprintf(buf, "%u\n", ksm_thread_pages_to_scan); in pages_to_scan_show() 2872 const char *buf, size_t count) in pages_to_scan_store() argument 2877 err = kstrtoul(buf, 10, &nr_pages); in pages_to_scan_store() 2888 char *buf) in run_show() argument 2890 return sprintf(buf, "%lu\n", ksm_run); in run_show() [all …]
|
D | slub.c | 778 char buf[100]; in slab_err() local 781 vsnprintf(buf, sizeof(buf), fmt, args); in slab_err() 783 slab_bug(s, "%s", buf); in slab_err() 4908 char *buf, unsigned long flags) in show_slab_objects() argument 5002 x = sprintf(buf, "%lu", total); in show_slab_objects() 5006 x += sprintf(buf + x, " N%d=%lu", in show_slab_objects() 5010 return x + sprintf(buf + x, "\n"); in show_slab_objects() 5018 ssize_t (*show)(struct kmem_cache *s, char *buf); 5030 static ssize_t slab_size_show(struct kmem_cache *s, char *buf) in slab_size_show() argument 5032 return sprintf(buf, "%u\n", s->size); in slab_size_show() [all …]
|
D | util.c | 58 char *buf; in kstrdup() local 64 buf = kmalloc_track_caller(len, gfp); in kstrdup() 65 if (buf) in kstrdup() 66 memcpy(buf, s, len); in kstrdup() 67 return buf; in kstrdup() 104 char *buf; in kstrndup() local 110 buf = kmalloc_track_caller(len+1, gfp); in kstrndup() 111 if (buf) { in kstrndup() 112 memcpy(buf, s, len); in kstrndup() 113 buf[len] = '\0'; in kstrndup() [all …]
|
D | khugepaged.c | 125 char *buf) in scan_sleep_millisecs_show() argument 127 return sprintf(buf, "%u\n", khugepaged_scan_sleep_millisecs); in scan_sleep_millisecs_show() 132 const char *buf, size_t count) in scan_sleep_millisecs_store() argument 137 err = kstrtoul(buf, 10, &msecs); in scan_sleep_millisecs_store() 153 char *buf) in alloc_sleep_millisecs_show() argument 155 return sprintf(buf, "%u\n", khugepaged_alloc_sleep_millisecs); in alloc_sleep_millisecs_show() 160 const char *buf, size_t count) in alloc_sleep_millisecs_store() argument 165 err = kstrtoul(buf, 10, &msecs); in alloc_sleep_millisecs_store() 181 char *buf) in pages_to_scan_show() argument 183 return sprintf(buf, "%u\n", khugepaged_pages_to_scan); in pages_to_scan_show() [all …]
|
D | page_idle.c | 119 struct bin_attribute *attr, char *buf, in page_idle_bitmap_read() argument 122 u64 *out = (u64 *)buf; in page_idle_bitmap_read() 160 return (char *)out - buf; in page_idle_bitmap_read() 164 struct bin_attribute *attr, char *buf, in page_idle_bitmap_write() argument 167 const u64 *in = (u64 *)buf; in page_idle_bitmap_write() 197 return (char *)in - buf; in page_idle_bitmap_write()
|
D | kmemleak.c | 264 int rowsize, int groupsize, const void *buf, in warn_or_seq_hex_dump() argument 269 buf, len, ascii); in warn_or_seq_hex_dump() 272 rowsize, groupsize, buf, len, ascii); in warn_or_seq_hex_dump() 1779 char buf[64]; in kmemleak_write() local 1783 buf_size = min(size, (sizeof(buf) - 1)); in kmemleak_write() 1784 if (strncpy_from_user(buf, user_buf, buf_size) < 0) in kmemleak_write() 1786 buf[buf_size] = 0; in kmemleak_write() 1792 if (strncmp(buf, "clear", 5) == 0) { in kmemleak_write() 1805 if (strncmp(buf, "off", 3) == 0) in kmemleak_write() 1807 else if (strncmp(buf, "stack=on", 8) == 0) in kmemleak_write() [all …]
|
D | cma_sysfs.c | 36 struct kobj_attribute *attr, char *buf) in alloc_pages_success_show() argument 40 return sysfs_emit(buf, "%llu\n", in alloc_pages_success_show() 46 struct kobj_attribute *attr, char *buf) in alloc_pages_fail_show() argument 50 return sysfs_emit(buf, "%llu\n", atomic64_read(&cma->nr_pages_failed)); in alloc_pages_fail_show()
|
D | page_pinner.c | 67 static int __init early_page_pinner_param(char *buf) in early_page_pinner_param() argument 224 print_page_pinner(bool longterm, char __user *buf, size_t count, struct captured_pinner *record) in print_page_pinner() argument 273 if (copy_to_user(buf, kbuf, ret)) in print_page_pinner() 381 read_longterm_page_pinner(struct file *file, char __user *buf, size_t count, in read_longterm_page_pinner() argument 409 return print_page_pinner(true, buf, count, &record); in read_longterm_page_pinner() 416 static ssize_t read_alloc_contig_failed(struct file *file, char __user *buf, in read_alloc_contig_failed() argument 445 return print_page_pinner(false, buf, count, &record); in read_alloc_contig_failed()
|
D | huge_memory.c | 176 struct kobj_attribute *attr, char *buf) in enabled_show() argument 179 return sprintf(buf, "[always] madvise never\n"); in enabled_show() 181 return sprintf(buf, "always [madvise] never\n"); in enabled_show() 183 return sprintf(buf, "always madvise [never]\n"); in enabled_show() 188 const char *buf, size_t count) in enabled_store() argument 192 if (sysfs_streq(buf, "always")) { in enabled_store() 195 } else if (sysfs_streq(buf, "madvise")) { in enabled_store() 198 } else if (sysfs_streq(buf, "never")) { in enabled_store() 215 struct kobj_attribute *attr, char *buf, in single_hugepage_flag_show() argument 218 return sprintf(buf, "%d\n", in single_hugepage_flag_show() [all …]
|
D | memcontrol.c | 1691 char *buf; in mem_cgroup_print_oom_meminfo() local 1712 buf = memory_stat_format(memcg); in mem_cgroup_print_oom_meminfo() 1713 if (!buf) in mem_cgroup_print_oom_meminfo() 1715 pr_info("%s", buf); in mem_cgroup_print_oom_meminfo() 1716 kfree(buf); in mem_cgroup_print_oom_meminfo() 3561 char *buf, size_t nbytes, in mem_cgroup_force_empty_write() argument 3878 char *buf, size_t nbytes, loff_t off) in mem_cgroup_write() argument 3884 buf = strstrip(buf); in mem_cgroup_write() 3885 ret = page_counter_memparse(buf, "-1", &nr_pages); in mem_cgroup_write() 3921 static ssize_t mem_cgroup_reset(struct kernfs_open_file *of, char *buf, in mem_cgroup_reset() argument [all …]
|
D | page_owner.c | 44 static int __init early_page_owner_param(char *buf) in early_page_owner_param() argument 46 if (!buf) in early_page_owner_param() 49 if (strcmp(buf, "on") == 0) in early_page_owner_param() 387 print_page_owner(char __user *buf, size_t count, unsigned long pfn, in print_page_owner() argument 441 if (copy_to_user(buf, kbuf, ret)) in print_page_owner() 510 read_page_owner(struct file *file, char __user *buf, size_t count, loff_t *ppos) in read_page_owner() argument 602 return print_page_owner(buf, count, pfn, page, in read_page_owner()
|
D | vmalloc.c | 2782 static int aligned_vread(char *buf, char *addr, unsigned long count) in aligned_vread() argument 2808 memcpy(buf, map + offset, length); in aligned_vread() 2811 memset(buf, 0, length); in aligned_vread() 2814 buf += length; in aligned_vread() 2821 static int aligned_vwrite(char *buf, char *addr, unsigned long count) in aligned_vwrite() argument 2847 memcpy(map + offset, buf, length); in aligned_vwrite() 2851 buf += length; in aligned_vwrite() 2882 long vread(char *buf, char *addr, unsigned long count) in vread() argument 2886 char *vaddr, *buf_start = buf; in vread() 2909 *buf = '\0'; in vread() [all …]
|
D | nommu.c | 203 long vread(char *buf, char *addr, unsigned long count) in vread() argument 206 if ((unsigned long) buf + count < count) in vread() 207 count = -(unsigned long) buf; in vread() 209 memcpy(buf, addr, count); in vread() 213 long vwrite(char *buf, char *addr, unsigned long count) in vwrite() argument 219 memcpy(addr, buf, count); in vwrite() 1688 unsigned long addr, void *buf, int len, unsigned int gup_flags) in __access_remote_vm() argument 1706 (void *) addr, buf, len); in __access_remote_vm() 1709 buf, (void *) addr, len); in __access_remote_vm() 1732 void *buf, int len, unsigned int gup_flags) in access_remote_vm() argument [all …]
|
D | hugetlb.c | 2550 char buf[32]; in hugetlb_hstate_alloc_pages() local 2552 string_get_size(huge_page_size(h), 1, STRING_UNITS_2, buf, 32); in hugetlb_hstate_alloc_pages() 2554 h->max_huge_pages, buf, i); in hugetlb_hstate_alloc_pages() 2581 char buf[32]; in report_hugepages() local 2583 string_get_size(huge_page_size(h), 1, STRING_UNITS_2, buf, 32); in report_hugepages() 2585 buf, h->free_huge_pages); in report_hugepages() 2808 struct kobj_attribute *attr, char *buf) in nr_hugepages_show_common() argument 2820 return sprintf(buf, "%lu\n", nr_huge_pages); in nr_hugepages_show_common() 2857 struct kobject *kobj, const char *buf, in nr_hugepages_store_common() argument 2865 err = kstrtoul(buf, 10, &count); in nr_hugepages_store_common() [all …]
|
D | page_counter.c | 244 int page_counter_memparse(const char *buf, const char *max, in page_counter_memparse() argument 250 if (!strcmp(buf, max)) { in page_counter_memparse() 255 bytes = memparse(buf, &end); in page_counter_memparse()
|
D | swap_state.c | 906 struct kobj_attribute *attr, char *buf) in vma_ra_enabled_show() argument 908 return sprintf(buf, "%s\n", enable_vma_readahead ? "true" : "false"); in vma_ra_enabled_show() 912 const char *buf, size_t count) in vma_ra_enabled_store() argument 914 if (!strncmp(buf, "true", 4) || !strncmp(buf, "1", 1)) in vma_ra_enabled_store() 916 else if (!strncmp(buf, "false", 5) || !strncmp(buf, "0", 1)) in vma_ra_enabled_store()
|
D | page_poison.c | 16 static int __init early_page_poison_param(char *buf) in early_page_poison_param() argument 18 return kstrtobool(buf, &_page_poisoning_enabled_early); in early_page_poison_param()
|
D | backing-dev.c | 134 const char *buf, size_t count) in read_ahead_kb_store() argument 140 ret = kstrtoul(buf, 10, &read_ahead_kb); in read_ahead_kb_store() 164 struct device_attribute *attr, const char *buf, size_t count) in min_ratio_store() argument 170 ret = kstrtouint(buf, 10, &ratio); in min_ratio_store() 183 struct device_attribute *attr, const char *buf, size_t count) in max_ratio_store() argument 189 ret = kstrtouint(buf, 10, &ratio); in max_ratio_store()
|
D | zsmalloc.c | 1137 char *buf = area->vm_buf; in __zs_map_object() local 1151 memcpy(buf, addr + off, sizes[0]); in __zs_map_object() 1154 memcpy(buf + sizes[0], addr, sizes[1]); in __zs_map_object() 1165 char *buf; in __zs_unmap_object() local 1171 buf = area->vm_buf; in __zs_unmap_object() 1172 buf = buf + ZS_HANDLE_SIZE; in __zs_unmap_object() 1181 memcpy(addr + off, buf, sizes[0]); in __zs_unmap_object() 1184 memcpy(addr, buf + sizes[0], sizes[1]); in __zs_unmap_object()
|
D | shmem.c | 2869 static int shmem_statfs(struct dentry *dentry, struct kstatfs *buf) in shmem_statfs() argument 2873 buf->f_type = TMPFS_MAGIC; in shmem_statfs() 2874 buf->f_bsize = PAGE_SIZE; in shmem_statfs() 2875 buf->f_namelen = NAME_MAX; in shmem_statfs() 2877 buf->f_blocks = sbinfo->max_blocks; in shmem_statfs() 2878 buf->f_bavail = in shmem_statfs() 2879 buf->f_bfree = sbinfo->max_blocks - in shmem_statfs() 2883 buf->f_files = sbinfo->max_inodes; in shmem_statfs() 2884 buf->f_ffree = sbinfo->free_inodes; in shmem_statfs() 4020 struct kobj_attribute *attr, char *buf) in shmem_enabled_show() argument [all …]
|