History

mm: move readahead prototypes from mm.h

Patch series "Change readahead API", v11. This series adds a readahead address_space operation to replace the readpages operation. The key difference is that pages are added to the page cache as they are allocated (and then looked up by the filesystem) instead of passing them on a list to the readpages operation and having the filesystem add them to the page cache. It's a net reduction in code for each implementation, more efficient than walking a list, and solves the direct-write vs buffered-read problem reported by yu kuai at http://lkml.kernel.org/r/20200116063601.39201-1-yukuai3@huawei.com The only unconverted filesystems are those which use fscache. Their conversion is pending Dave Howells' rewrite which will make the conversion substantially easier. This should be completed by the end of the year. I want to thank the reviewers/testers; Dave Chinner, John Hubbard, Eric Biggers, Johannes Thumshirn, Dave Sterba, Zi Yan, Christoph Hellwig and Miklos Szeredi have done a marvellous job of providing constructive criticism. These patches pass an xfstests run on ext4, xfs & btrfs with no regressions that I can tell (some of the tests seem a little flaky before and remain flaky afterwards). This patch (of 25): The readahead code is part of the page cache so should be found in the pagemap.h file. force_page_cache_readahead is only used within mm, so move it to mm/internal.h instead. Remove the parameter names where they add no value, and rename the ones which were actively misleading.

Matthew Wilcox (Oracle) committed 6 years ago

Commit cee9a0c1 parent 002ae705 files · +13 −19Browse files

Showing the changes to include/linux (2 of 5 files). Show all

Unified · Split

2 files
  1. include/linux/mm.h +0 −19
  2. include/linux/pagemap.h +8 −0
include/linux/mm.h+0−19
@@ -2612,25 +2612,6 @@ extern vm_fault_t filemap_page_mkwrite(struct vm_fault *vmf); · 2611 unmodified lines
2612int __must_check write_one_page(struct page *page);2612int __must_check write_one_page(struct page *page);
2613void task_dirty_inc(struct task_struct *tsk);2613void task_dirty_inc(struct task_struct *tsk);
2614 2614
2615/* readahead.c */
2616#define VM_READAHEAD_PAGES (SZ_128K / PAGE_SIZE)
2617
2618int force_page_cache_readahead(struct address_space *mapping, struct file *filp,
2619 pgoff_t offset, unsigned long nr_to_read);
2620
2621void page_cache_sync_readahead(struct address_space *mapping,
2622 struct file_ra_state *ra,
2623 struct file *filp,
2624 pgoff_t offset,
2625 unsigned long size);
2626
2627void page_cache_async_readahead(struct address_space *mapping,
2628 struct file_ra_state *ra,
2629 struct file *filp,
2630 struct page *pg,
2631 pgoff_t offset,
2632 unsigned long size);
2633
2634extern unsigned long stack_guard_gap;2615extern unsigned long stack_guard_gap;
2635/* Generic expand stack which grows the stack according to GROWS{UP,DOWN} */2616/* Generic expand stack which grows the stack according to GROWS{UP,DOWN} */
2636extern int expand_stack(struct vm_area_struct *vma, unsigned long address);2617extern int expand_stack(struct vm_area_struct *vma, unsigned long address);
include/linux/pagemap.h+8−0
@@ -618,6 +618,14 @@ int replace_page_cache_page(struct page *old, struct page *new, gfp_t gfp_mask); · 617 unmodified lines
618void delete_from_page_cache_batch(struct address_space *mapping,618void delete_from_page_cache_batch(struct address_space *mapping,
619 struct pagevec *pvec);619 struct pagevec *pvec);
620 620
621#define VM_READAHEAD_PAGES (SZ_128K / PAGE_SIZE)
622
623void page_cache_sync_readahead(struct address_space *, struct file_ra_state *,
624 struct file *, pgoff_t index, unsigned long req_count);
625void page_cache_async_readahead(struct address_space *, struct file_ra_state *,
626 struct file *, struct page *, pgoff_t index,
627 unsigned long req_count);
628
621/*629/*
622 * Like add_to_page_cache_locked, but used to add newly allocated pages:630 * Like add_to_page_cache_locked, but used to add newly allocated pages:
623 * the page is new, so we can just run __SetPageLocked() against it.631 * the page is new, so we can just run __SetPageLocked() against it.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t