Message ID | 20220509131416.17553-9-linmiaohe@huawei.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | A few cleanup patches for swap | expand |
On 09.05.22 15:14, Miaohe Lin wrote: > Make page_swapcount and __lru_add_drain_all static. They are only used > within the file now. > > Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Reviewed-by: David Hildenbrand <david@redhat.com>
On Mon, May 09, 2022 at 09:14:09PM +0800, Miaohe Lin wrote: > Make page_swapcount and __lru_add_drain_all static. They are only used > within the file now. > > Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> I think the commit message is missing the "static" word. Reviewed-by: Oscar Salvador <osalvador@suse.de> > --- > include/linux/swap.h | 7 ------- > mm/swap.c | 2 +- > mm/swapfile.c | 2 +- > 3 files changed, 2 insertions(+), 9 deletions(-) > > diff --git a/include/linux/swap.h b/include/linux/swap.h > index 999c7d79c2d5..8772132d21dc 100644 > --- a/include/linux/swap.h > +++ b/include/linux/swap.h > @@ -490,7 +490,6 @@ int swap_type_of(dev_t device, sector_t offset); > int find_first_swap(dev_t *device); > extern unsigned int count_swap_pages(int, int); > extern sector_t swapdev_block(int, pgoff_t); > -extern int page_swapcount(struct page *); > extern int __swap_count(swp_entry_t entry); > extern int __swp_swapcount(swp_entry_t entry); > extern int swp_swapcount(swp_entry_t entry); > @@ -562,12 +561,6 @@ static inline void put_swap_page(struct page *page, swp_entry_t swp) > { > } > > - > -static inline int page_swapcount(struct page *page) > -{ > - return 0; > -} > - > static inline int __swap_count(swp_entry_t entry) > { > return 0; > diff --git a/mm/swap.c b/mm/swap.c > index 7e320ec08c6a..6d2c37f781f8 100644 > --- a/mm/swap.c > +++ b/mm/swap.c > @@ -748,7 +748,7 @@ static void lru_add_drain_per_cpu(struct work_struct *dummy) > * Calling this function with cpu hotplug locks held can actually lead > * to obscure indirect dependencies via WQ context. > */ > -inline void __lru_add_drain_all(bool force_all_cpus) > +static inline void __lru_add_drain_all(bool force_all_cpus) > { > /* > * lru_drain_gen - Global pages generation number > diff --git a/mm/swapfile.c b/mm/swapfile.c > index 7b4c99ca2aea..133e03fea104 100644 > --- a/mm/swapfile.c > +++ b/mm/swapfile.c > @@ -1430,7 +1430,7 @@ void swapcache_free_entries(swp_entry_t *entries, int n) > * This does not give an exact answer when swap count is continued, > * but does include the high COUNT_CONTINUED flag to allow for that. > */ > -int page_swapcount(struct page *page) > +static int page_swapcount(struct page *page) > { > int count = 0; > struct swap_info_struct *p; > -- > 2.23.0 > >
On 2022/5/18 17:46, Oscar Salvador wrote: > On Mon, May 09, 2022 at 09:14:09PM +0800, Miaohe Lin wrote: >> Make page_swapcount and __lru_add_drain_all static. They are only used >> within the file now. >> >> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> > > I think the commit message is missing the "static" word. Yes, you're right. The commit message should be "mm/swap: make page_swapcount and __lru_add_drain_all static". :) Hi Andrew, Could you please help tweak the commit message? Or I will send a new version soon if requested. Thanks a lot! > > Reviewed-by: Oscar Salvador <osalvador@suse.de> Many thanks for your review and comment! > >> --- >> include/linux/swap.h | 7 ------- >> mm/swap.c | 2 +- >> mm/swapfile.c | 2 +- >> 3 files changed, 2 insertions(+), 9 deletions(-) >> >> diff --git a/include/linux/swap.h b/include/linux/swap.h >> index 999c7d79c2d5..8772132d21dc 100644 >> --- a/include/linux/swap.h >> +++ b/include/linux/swap.h >> @@ -490,7 +490,6 @@ int swap_type_of(dev_t device, sector_t offset); >> int find_first_swap(dev_t *device); >> extern unsigned int count_swap_pages(int, int); >> extern sector_t swapdev_block(int, pgoff_t); >> -extern int page_swapcount(struct page *); >> extern int __swap_count(swp_entry_t entry); >> extern int __swp_swapcount(swp_entry_t entry); >> extern int swp_swapcount(swp_entry_t entry); >> @@ -562,12 +561,6 @@ static inline void put_swap_page(struct page *page, swp_entry_t swp) >> { >> } >> >> - >> -static inline int page_swapcount(struct page *page) >> -{ >> - return 0; >> -} >> - >> static inline int __swap_count(swp_entry_t entry) >> { >> return 0; >> diff --git a/mm/swap.c b/mm/swap.c >> index 7e320ec08c6a..6d2c37f781f8 100644 >> --- a/mm/swap.c >> +++ b/mm/swap.c >> @@ -748,7 +748,7 @@ static void lru_add_drain_per_cpu(struct work_struct *dummy) >> * Calling this function with cpu hotplug locks held can actually lead >> * to obscure indirect dependencies via WQ context. >> */ >> -inline void __lru_add_drain_all(bool force_all_cpus) >> +static inline void __lru_add_drain_all(bool force_all_cpus) >> { >> /* >> * lru_drain_gen - Global pages generation number >> diff --git a/mm/swapfile.c b/mm/swapfile.c >> index 7b4c99ca2aea..133e03fea104 100644 >> --- a/mm/swapfile.c >> +++ b/mm/swapfile.c >> @@ -1430,7 +1430,7 @@ void swapcache_free_entries(swp_entry_t *entries, int n) >> * This does not give an exact answer when swap count is continued, >> * but does include the high COUNT_CONTINUED flag to allow for that. >> */ >> -int page_swapcount(struct page *page) >> +static int page_swapcount(struct page *page) >> { >> int count = 0; >> struct swap_info_struct *p; >> -- >> 2.23.0 >> >> >
diff --git a/include/linux/swap.h b/include/linux/swap.h index 999c7d79c2d5..8772132d21dc 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -490,7 +490,6 @@ int swap_type_of(dev_t device, sector_t offset); int find_first_swap(dev_t *device); extern unsigned int count_swap_pages(int, int); extern sector_t swapdev_block(int, pgoff_t); -extern int page_swapcount(struct page *); extern int __swap_count(swp_entry_t entry); extern int __swp_swapcount(swp_entry_t entry); extern int swp_swapcount(swp_entry_t entry); @@ -562,12 +561,6 @@ static inline void put_swap_page(struct page *page, swp_entry_t swp) { } - -static inline int page_swapcount(struct page *page) -{ - return 0; -} - static inline int __swap_count(swp_entry_t entry) { return 0; diff --git a/mm/swap.c b/mm/swap.c index 7e320ec08c6a..6d2c37f781f8 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -748,7 +748,7 @@ static void lru_add_drain_per_cpu(struct work_struct *dummy) * Calling this function with cpu hotplug locks held can actually lead * to obscure indirect dependencies via WQ context. */ -inline void __lru_add_drain_all(bool force_all_cpus) +static inline void __lru_add_drain_all(bool force_all_cpus) { /* * lru_drain_gen - Global pages generation number diff --git a/mm/swapfile.c b/mm/swapfile.c index 7b4c99ca2aea..133e03fea104 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -1430,7 +1430,7 @@ void swapcache_free_entries(swp_entry_t *entries, int n) * This does not give an exact answer when swap count is continued, * but does include the high COUNT_CONTINUED flag to allow for that. */ -int page_swapcount(struct page *page) +static int page_swapcount(struct page *page) { int count = 0; struct swap_info_struct *p;
Make page_swapcount and __lru_add_drain_all static. They are only used within the file now. Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> --- include/linux/swap.h | 7 ------- mm/swap.c | 2 +- mm/swapfile.c | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-)