/kernel/linux/linux-5.10/lib/ |
D | xarray.c | 36 static inline void xas_lock_type(struct xa_state *xas, unsigned int lock_type) in xas_lock_type() argument 39 xas_lock_irq(xas); in xas_lock_type() 41 xas_lock_bh(xas); in xas_lock_type() 43 xas_lock(xas); in xas_lock_type() 46 static inline void xas_unlock_type(struct xa_state *xas, unsigned int lock_type) in xas_unlock_type() argument 49 xas_unlock_irq(xas); in xas_unlock_type() 51 xas_unlock_bh(xas); in xas_unlock_type() 53 xas_unlock(xas); in xas_unlock_type() 124 static void xas_squash_marks(const struct xa_state *xas) in xas_squash_marks() argument 127 unsigned int limit = xas->xa_offset + xas->xa_sibs + 1; in xas_squash_marks() [all …]
|
D | test_xarray.c | 74 XA_STATE_ORDER(xas, xa, index, order); in xa_store_order() 78 xas_lock(&xas); in xa_store_order() 79 curr = xas_store(&xas, entry); in xa_store_order() 80 xas_unlock(&xas); in xa_store_order() 81 } while (xas_nomem(&xas, gfp)); in xa_store_order() 104 XA_STATE(xas, xa, 0); in check_xas_retry() 111 XA_BUG_ON(xa, xas_find(&xas, ULONG_MAX) != xa_mk_value(0)); in check_xas_retry() 113 XA_BUG_ON(xa, !xa_is_retry(xas_reload(&xas))); in check_xas_retry() 114 XA_BUG_ON(xa, xas_retry(&xas, NULL)); in check_xas_retry() 115 XA_BUG_ON(xa, xas_retry(&xas, xa_mk_value(0))); in check_xas_retry() [all …]
|
D | idr.c | 383 XA_STATE(xas, &ida->xa, min / IDA_BITMAP_BITS); in ida_alloc_range() 395 xas_lock_irqsave(&xas, flags); in ida_alloc_range() 397 bitmap = xas_find_marked(&xas, max / IDA_BITMAP_BITS, XA_FREE_MARK); in ida_alloc_range() 398 if (xas.xa_index > min / IDA_BITMAP_BITS) in ida_alloc_range() 400 if (xas.xa_index * IDA_BITMAP_BITS + bit > max) in ida_alloc_range() 408 if (xas.xa_index * IDA_BITMAP_BITS + bit > max) in ida_alloc_range() 412 xas_store(&xas, xa_mk_value(tmp)); in ida_alloc_range() 422 xas_store(&xas, bitmap); in ida_alloc_range() 423 if (xas_error(&xas)) { in ida_alloc_range() 431 if (xas.xa_index * IDA_BITMAP_BITS + bit > max) in ida_alloc_range() [all …]
|
/kernel/linux/linux-5.10/include/linux/ |
D | xarray.h | 1368 #define xas_marked(xas, mark) xa_marked((xas)->xa, (mark)) argument 1369 #define xas_trylock(xas) xa_trylock((xas)->xa) argument 1370 #define xas_lock(xas) xa_lock((xas)->xa) argument 1371 #define xas_unlock(xas) xa_unlock((xas)->xa) argument 1372 #define xas_lock_bh(xas) xa_lock_bh((xas)->xa) argument 1373 #define xas_unlock_bh(xas) xa_unlock_bh((xas)->xa) argument 1374 #define xas_lock_irq(xas) xa_lock_irq((xas)->xa) argument 1375 #define xas_unlock_irq(xas) xa_unlock_irq((xas)->xa) argument 1376 #define xas_lock_irqsave(xas, flags) \ argument 1377 xa_lock_irqsave((xas)->xa, flags) [all …]
|
D | pagemap.h | 898 XA_STATE(xas, &rac->mapping->i_pages, 0); in __readahead_batch() 906 xas_set(&xas, rac->_index); in __readahead_batch() 908 xas_for_each(&xas, page, rac->_index + rac->_nr_pages - 1) { in __readahead_batch() 909 if (xas_retry(&xas, page)) in __readahead_batch() 923 xas_set(&xas, rac->_index + rac->_batch_count); in __readahead_batch()
|
D | swap.h | 323 #define mapping_set_update(xas, mapping) do { \ argument 325 xas_set_update(xas, workingset_update_node); \
|
/kernel/linux/linux-5.10/fs/ |
D | dax.c | 157 static wait_queue_head_t *dax_entry_waitqueue(struct xa_state *xas, in dax_entry_waitqueue() argument 161 unsigned long index = xas->xa_index; in dax_entry_waitqueue() 170 key->xa = xas->xa; in dax_entry_waitqueue() 173 hash = hash_long((unsigned long)xas->xa ^ index, DAX_WAIT_TABLE_BITS); in dax_entry_waitqueue() 195 static void dax_wake_entry(struct xa_state *xas, void *entry, in dax_wake_entry() argument 201 wq = dax_entry_waitqueue(xas, entry, &key); in dax_wake_entry() 223 static void *get_unlocked_entry(struct xa_state *xas, unsigned int order) in get_unlocked_entry() argument 233 entry = xas_find_conflict(xas); in get_unlocked_entry() 241 wq = dax_entry_waitqueue(xas, entry, &ewait.key); in get_unlocked_entry() 244 xas_unlock_irq(xas); in get_unlocked_entry() [all …]
|
D | fs-writeback.c | 361 XA_STATE(xas, &mapping->i_pages, 0); in inode_switch_wbs_work_fn() 405 xas_for_each_marked(&xas, page, ULONG_MAX, PAGECACHE_TAG_DIRTY) { in inode_switch_wbs_work_fn() 412 xas_set(&xas, 0); in inode_switch_wbs_work_fn() 413 xas_for_each_marked(&xas, page, ULONG_MAX, PAGECACHE_TAG_WRITEBACK) { in inode_switch_wbs_work_fn()
|
/kernel/linux/linux-5.10/tools/testing/radix-tree/ |
D | iteration_check.c | 23 XA_STATE(xas, xa, index); in my_item_insert() 28 xas_lock(&xas); in my_item_insert() 30 xas_set_order(&xas, index, order); in my_item_insert() 32 if (xas_find_conflict(&xas)) in my_item_insert() 34 xas_store(&xas, item); in my_item_insert() 35 xas_set_mark(&xas, TAG); in my_item_insert() 38 xas_unlock(&xas); in my_item_insert() 39 if (xas_nomem(&xas, GFP_KERNEL)) in my_item_insert() 69 XA_STATE(xas, &array, 0); in tagged_iteration_fn() 75 xas_set(&xas, 0); in tagged_iteration_fn() [all …]
|
D | multiorder.c | 18 XA_STATE_ORDER(xas, xa, index, order); in item_insert_order() 22 xas_lock(&xas); in item_insert_order() 23 xas_store(&xas, item); in item_insert_order() 24 xas_unlock(&xas); in item_insert_order() 25 } while (xas_nomem(&xas, GFP_KERNEL)); in item_insert_order() 27 if (!xas_error(&xas)) in item_insert_order() 31 return xas_error(&xas); in item_insert_order() 36 XA_STATE(xas, xa, 0); in multiorder_iteration() 56 xas_set(&xas, j); in multiorder_iteration() 57 xas_for_each(&xas, item, ULONG_MAX) { in multiorder_iteration() [all …]
|
D | test.c | 176 XA_STATE(xas, xa, start); in tag_tagged_items() 183 xas_lock_irq(&xas); in tag_tagged_items() 184 xas_for_each_marked(&xas, item, end, iftag) { in tag_tagged_items() 185 xas_set_mark(&xas, thentag); in tag_tagged_items() 189 xas_pause(&xas); in tag_tagged_items() 190 xas_unlock_irq(&xas); in tag_tagged_items() 192 xas_lock_irq(&xas); in tag_tagged_items() 194 xas_unlock_irq(&xas); in tag_tagged_items() 257 XA_STATE(xas, xa, 0); in item_kill_tree() 260 xas_for_each(&xas, entry, ULONG_MAX) { in item_kill_tree() [all …]
|
D | iteration_check_2.c | 15 XA_STATE(xas, arg, 0); in iterator() 21 xas_set(&xas, 0); in iterator() 23 xas_for_each_marked(&xas, entry, ULONG_MAX, XA_MARK_0) in iterator() 26 assert(xas.xa_index >= 100); in iterator()
|
D | regression1.c | 82 XA_STATE(xas, &mt_tree, start); in find_get_pages() 87 xas_for_each(&xas, page, ULONG_MAX) { in find_get_pages() 88 if (xas_retry(&xas, page)) in find_get_pages() 99 if (unlikely(page != xas_reload(&xas))) in find_get_pages() 108 xas_reset(&xas); in find_get_pages()
|
/kernel/linux/linux-5.10/mm/ |
D | memfd.c | 31 static void memfd_tag_pins(struct xa_state *xas) in memfd_tag_pins() argument 38 xas_lock_irq(xas); in memfd_tag_pins() 39 xas_for_each(xas, page, ULONG_MAX) { in memfd_tag_pins() 42 page = find_subpage(page, xas->xa_index); in memfd_tag_pins() 44 xas_set_mark(xas, MEMFD_TAG_PINNED); in memfd_tag_pins() 49 xas_pause(xas); in memfd_tag_pins() 50 xas_unlock_irq(xas); in memfd_tag_pins() 52 xas_lock_irq(xas); in memfd_tag_pins() 54 xas_unlock_irq(xas); in memfd_tag_pins() 68 XA_STATE(xas, &mapping->i_pages, 0); in memfd_wait_for_pins() [all …]
|
D | filemap.c | 123 XA_STATE(xas, &mapping->i_pages, page->index); in page_cache_delete() 126 mapping_set_update(&xas, mapping); in page_cache_delete() 130 xas_set_order(&xas, page->index, compound_order(page)); in page_cache_delete() 138 xas_store(&xas, shadow); in page_cache_delete() 139 xas_init_marks(&xas); in page_cache_delete() 298 XA_STATE(xas, &mapping->i_pages, pvec->pages[0]->index); in page_cache_delete_batch() 303 mapping_set_update(&xas, mapping); in page_cache_delete_batch() 304 xas_for_each(&xas, page, ULONG_MAX) { in page_cache_delete_batch() 326 if (page->index == xas.xa_index) in page_cache_delete_batch() 335 if (page->index + compound_nr(page) - 1 == xas.xa_index) in page_cache_delete_batch() [all …]
|
D | swap_state.c | 133 XA_STATE_ORDER(xas, &address_space->i_pages, idx, compound_order(page)); in add_to_swap_cache() 147 xas_lock_irq(&xas); in add_to_swap_cache() 148 xas_create_range(&xas); in add_to_swap_cache() 149 if (xas_error(&xas)) in add_to_swap_cache() 152 VM_BUG_ON_PAGE(xas.xa_index != idx + i, page); in add_to_swap_cache() 153 old = xas_load(&xas); in add_to_swap_cache() 160 xas_store(&xas, page); in add_to_swap_cache() 161 xas_next(&xas); in add_to_swap_cache() 168 xas_unlock_irq(&xas); in add_to_swap_cache() 169 } while (xas_nomem(&xas, gfp)); in add_to_swap_cache() [all …]
|
D | khugepaged.c | 1643 XA_STATE_ORDER(xas, &mapping->i_pages, start, HPAGE_PMD_ORDER); in collapse_file() 1667 xas_lock_irq(&xas); in collapse_file() 1668 xas_create_range(&xas); in collapse_file() 1669 if (!xas_error(&xas)) in collapse_file() 1671 xas_unlock_irq(&xas); in collapse_file() 1672 if (!xas_nomem(&xas, GFP_KERNEL)) { in collapse_file() 1690 xas_set(&xas, start); in collapse_file() 1692 struct page *page = xas_next(&xas); in collapse_file() 1694 VM_BUG_ON(index != xas.xa_index); in collapse_file() 1703 if (!xas_next_entry(&xas, end - 1)) { in collapse_file() [all …]
|
D | page-writeback.c | 2113 XA_STATE(xas, &mapping->i_pages, start); in tag_pages_for_writeback() 2117 xas_lock_irq(&xas); in tag_pages_for_writeback() 2118 xas_for_each_marked(&xas, page, end, PAGECACHE_TAG_DIRTY) { in tag_pages_for_writeback() 2119 xas_set_mark(&xas, PAGECACHE_TAG_TOWRITE); in tag_pages_for_writeback() 2123 xas_pause(&xas); in tag_pages_for_writeback() 2124 xas_unlock_irq(&xas); in tag_pages_for_writeback() 2126 xas_lock_irq(&xas); in tag_pages_for_writeback() 2128 xas_unlock_irq(&xas); in tag_pages_for_writeback() 2768 XA_STATE(xas, &mapping->i_pages, page_index(page)); in __test_set_page_writeback() 2773 xas_lock_irqsave(&xas, flags); in __test_set_page_writeback() [all …]
|
D | migrate.c | 406 XA_STATE(xas, &mapping->i_pages, page_index(page)); in migrate_page_move_mapping() 429 xas_lock_irq(&xas); in migrate_page_move_mapping() 430 if (page_count(page) != expected_count || xas_load(&xas) != page) { in migrate_page_move_mapping() 431 xas_unlock_irq(&xas); in migrate_page_move_mapping() 436 xas_unlock_irq(&xas); in migrate_page_move_mapping() 464 xas_store(&xas, newpage); in migrate_page_move_mapping() 469 xas_next(&xas); in migrate_page_move_mapping() 470 xas_store(&xas, newpage); in migrate_page_move_mapping() 481 xas_unlock(&xas); in migrate_page_move_mapping() 528 XA_STATE(xas, &mapping->i_pages, page_index(page)); in migrate_huge_page_move_mapping() [all …]
|
D | shmem.c | 417 XA_STATE(xas, &mapping->i_pages, index); in shmem_replace_entry() 422 item = xas_load(&xas); in shmem_replace_entry() 425 xas_store(&xas, replacement); in shmem_replace_entry() 677 XA_STATE_ORDER(xas, &mapping->i_pages, index, compound_order(page)); in shmem_add_to_page_cache() 706 xas_lock_irq(&xas); in shmem_add_to_page_cache() 707 entry = xas_find_conflict(&xas); in shmem_add_to_page_cache() 709 xas_set_err(&xas, -EEXIST); in shmem_add_to_page_cache() 710 xas_create_range(&xas); in shmem_add_to_page_cache() 711 if (xas_error(&xas)) in shmem_add_to_page_cache() 714 xas_store(&xas, page); in shmem_add_to_page_cache() [all …]
|
D | truncate.c | 37 XA_STATE(xas, &mapping->i_pages, index); in __clear_shadow_entry() 39 xas_set_update(&xas, workingset_update_node); in __clear_shadow_entry() 40 if (xas_load(&xas) != entry) in __clear_shadow_entry() 42 xas_store(&xas, NULL); in __clear_shadow_entry()
|
D | madvise.c | 234 XA_STATE(xas, &mapping->i_pages, linear_page_index(vma, start)); in force_shm_swapin_readahead() 239 xas_for_each(&xas, page, end_index) { in force_shm_swapin_readahead() 244 xas_pause(&xas); in force_shm_swapin_readahead()
|
/kernel/linux/linux-5.10/drivers/infiniband/core/ |
D | ib_core_uverbs.c | 268 XA_STATE(xas, &ucontext->mmap_xa, min_pgoff); in rdma_user_mmap_entry_insert_range() 294 xas_find_marked(&xas, max_pgoff, XA_FREE_MARK); in rdma_user_mmap_entry_insert_range() 295 if (xas.xa_node == XAS_RESTART) in rdma_user_mmap_entry_insert_range() 298 xa_first = xas.xa_index; in rdma_user_mmap_entry_insert_range() 308 xas_next_entry(&xas, xa_last - 1); in rdma_user_mmap_entry_insert_range() 309 if (xas.xa_node == XAS_BOUNDS || xas.xa_index >= xa_last) in rdma_user_mmap_entry_insert_range()
|
D | restrack.c | 115 XA_STATE(xas, &rt->xa, 0); in rdma_restrack_count() 119 xas_for_each(&xas, e, U32_MAX) in rdma_restrack_count()
|
D | device.c | 157 XA_STATE(xas, xa, *indexp); in xan_find_marked() 162 entry = xas_find_marked(&xas, ULONG_MAX, filter); in xan_find_marked() 165 } while (xas_retry(&xas, entry)); in xan_find_marked() 169 *indexp = xas.xa_index; in xan_find_marked()
|