Lines Matching full:ra

137  * memset *ra to zero.
140 file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping) in file_ra_state_init() argument
142 ra->ra_pages = inode_to_bdi(mapping->host)->ra_pages; in file_ra_state_init()
143 ra->prev_pos = -1; in file_ra_state_init()
163 * Clean up the remaining folios. The sizes in ->ra in read_pages()
171 rac->ra->size -= nr; in read_pages()
172 if (rac->ra->async_size >= nr) { in read_pages()
173 rac->ra->async_size -= nr; in read_pages()
311 struct file_ra_state *ra = ractl->ra; in force_page_cache_ra() local
323 max_pages = max_t(unsigned long, bdi->io_pages, ra->ra_pages); in force_page_cache_ra()
341 * for 128k (32 page) max ra
362 static unsigned long get_next_ra_size(struct file_ra_state *ra, in get_next_ra_size() argument
365 unsigned long cur = ra->size; in get_next_ra_size()
435 struct file_ra_state *ra, in try_context_readahead() argument
458 ra->start = index; in try_context_readahead()
459 ra->size = min(size + req_size, max); in try_context_readahead()
460 ra->async_size = 1; in try_context_readahead()
501 struct file_ra_state *ra, unsigned int new_order) in page_cache_ra_order() argument
506 pgoff_t mark = index + ra->size - ra->async_size; in page_cache_ra_order()
510 if (!mapping_large_folio_support(mapping) || ra->size < 4) in page_cache_ra_order()
513 limit = min(limit, index + ra->size - 1); in page_cache_ra_order()
519 while ((1 << new_order) > ra->size) in page_cache_ra_order()
545 ra->size += index - limit - 1; in page_cache_ra_order()
546 ra->async_size += index - limit - 1; in page_cache_ra_order()
560 do_page_cache_ra(ractl, ra->size, ra->async_size); in page_cache_ra_order()
570 struct file_ra_state *ra = ractl->ra; in ondemand_readahead() local
571 unsigned long max_pages = ra->ra_pages; in ondemand_readahead()
594 expected = round_up(ra->start + ra->size - ra->async_size, in ondemand_readahead()
596 if (index == expected || index == (ra->start + ra->size)) { in ondemand_readahead()
597 ra->start += ra->size; in ondemand_readahead()
598 ra->size = get_next_ra_size(ra, max_pages); in ondemand_readahead()
599 ra->async_size = ra->size; in ondemand_readahead()
620 ra->start = start; in ondemand_readahead()
621 ra->size = start - index; /* old async_size */ in ondemand_readahead()
622 ra->size += req_size; in ondemand_readahead()
623 ra->size = get_next_ra_size(ra, max_pages); in ondemand_readahead()
624 ra->async_size = ra->size; in ondemand_readahead()
639 prev_index = (unsigned long long)ra->prev_pos >> PAGE_SHIFT; in ondemand_readahead()
647 if (try_context_readahead(ractl->mapping, ra, index, req_size, in ondemand_readahead()
659 ra->start = index; in ondemand_readahead()
660 ra->size = get_init_ra_size(req_size, max_pages); in ondemand_readahead()
661 ra->async_size = ra->size > req_size ? ra->size - req_size : ra->size; in ondemand_readahead()
670 if (index == ra->start && ra->size == ra->async_size) { in ondemand_readahead()
671 add_pages = get_next_ra_size(ra, max_pages); in ondemand_readahead()
672 if (ra->size + add_pages <= max_pages) { in ondemand_readahead()
673 ra->async_size = add_pages; in ondemand_readahead()
674 ra->size += add_pages; in ondemand_readahead()
676 ra->size = max_pages; in ondemand_readahead()
677 ra->async_size = max_pages >> 1; in ondemand_readahead()
681 ractl->_index = ra->start; in ondemand_readahead()
682 page_cache_ra_order(ractl, ra, order); in ondemand_readahead()
696 if (!ractl->ra->ra_pages || blk_cgroup_congested()) { in page_cache_sync_ra()
717 if (!ractl->ra->ra_pages) in page_cache_async_ra()
795 struct file_ra_state *ra = ractl->ra; in readahead_expand() local
844 if (ra) { in readahead_expand()
845 ra->size++; in readahead_expand()
846 ra->async_size++; in readahead_expand()