ANDROID: page_pinner: add missing page_pinner_put_page
aosp/2369528 missed page_pinner_put_page in put_page_testzero path. Fix it. Bug: 274967172 Change-Id: Ia2af2ffb752f8405b4289ca88cde09f201548e1f Signed-off-by: Minchan Kim <minchan@google.com>
This commit is contained in:
parent
d47c9481da
commit
2488e2e472
@ -28,6 +28,7 @@
|
||||
#include <linux/sched.h>
|
||||
#include <linux/pgtable.h>
|
||||
#include <linux/kasan.h>
|
||||
#include <linux/page_pinner.h>
|
||||
#include <linux/memremap.h>
|
||||
|
||||
struct mempolicy;
|
||||
@ -760,8 +761,13 @@ static inline unsigned int folio_order(struct folio *folio)
|
||||
*/
|
||||
static inline int put_page_testzero(struct page *page)
|
||||
{
|
||||
int ret;
|
||||
|
||||
VM_BUG_ON_PAGE(page_ref_count(page) == 0, page);
|
||||
return page_ref_dec_and_test(page);
|
||||
ret = page_ref_dec_and_test(page);
|
||||
page_pinner_put_page(page);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline int folio_put_testzero(struct folio *folio)
|
||||
|
@ -24,9 +24,6 @@ static inline void page_pinner_put_page(struct page *page)
|
||||
if (!static_branch_unlikely(&page_pinner_inited))
|
||||
return;
|
||||
|
||||
if (!static_branch_unlikely(&failure_tracking))
|
||||
return;
|
||||
|
||||
__page_pinner_put_page(page);
|
||||
}
|
||||
|
||||
@ -35,9 +32,6 @@ static inline void page_pinner_failure_detect(struct page *page)
|
||||
if (!static_branch_unlikely(&page_pinner_inited))
|
||||
return;
|
||||
|
||||
if (!static_branch_unlikely(&failure_tracking))
|
||||
return;
|
||||
|
||||
__page_pinner_failure_detect(page);
|
||||
}
|
||||
#else
|
||||
|
@ -56,9 +56,9 @@ static struct page_pinner_buffer pp_buffer;
|
||||
|
||||
static bool page_pinner_enabled;
|
||||
DEFINE_STATIC_KEY_FALSE(page_pinner_inited);
|
||||
EXPORT_SYMBOL_GPL(page_pinner_inited);
|
||||
|
||||
DEFINE_STATIC_KEY_TRUE(failure_tracking);
|
||||
EXPORT_SYMBOL_GPL(failure_tracking);
|
||||
|
||||
static depot_stack_handle_t failure_handle;
|
||||
|
||||
@ -252,11 +252,15 @@ print_page_pinner(char __user *buf, size_t count, struct captured_pinner *record
|
||||
|
||||
void __page_pinner_failure_detect(struct page *page)
|
||||
{
|
||||
struct page_ext *page_ext = page_ext_get(page);
|
||||
struct page_ext *page_ext;
|
||||
struct page_pinner *page_pinner;
|
||||
struct captured_pinner record;
|
||||
u64 now;
|
||||
|
||||
if (!static_branch_unlikely(&failure_tracking))
|
||||
return;
|
||||
|
||||
page_ext = page_ext_get(page);
|
||||
if (unlikely(!page_ext))
|
||||
return;
|
||||
|
||||
@ -282,11 +286,15 @@ EXPORT_SYMBOL_GPL(__page_pinner_failure_detect);
|
||||
|
||||
void __page_pinner_put_page(struct page *page)
|
||||
{
|
||||
struct page_ext *page_ext = page_ext_get(page);
|
||||
struct page_ext *page_ext;
|
||||
struct page_pinner *page_pinner;
|
||||
struct captured_pinner record;
|
||||
u64 now, ts_usec;
|
||||
|
||||
if (!static_branch_unlikely(&failure_tracking))
|
||||
return;
|
||||
|
||||
page_ext = page_ext_get(page);
|
||||
if (unlikely(!page_ext))
|
||||
return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user