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 Bug: 240196534 Change-Id: Ia2af2ffb752f8405b4289ca88cde09f201548e1f Signed-off-by: Minchan Kim <minchan@google.com> (cherry picked from commit 2488e2e472e7f66933b1f190251a35f13ea67699) Signed-off-by: Georgi Djakov <quic_c_gdjako@quicinc.com>
This commit is contained in:
committed by
Suren Baghdasaryan
parent
4543fde75f
commit
55e076e328
+7
-1
@@ -29,6 +29,7 @@
|
||||
#include <linux/sched.h>
|
||||
#include <linux/pgtable.h>
|
||||
#include <linux/kasan.h>
|
||||
#include <linux/page_pinner.h>
|
||||
#include <linux/memremap.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/rcuwait.h>
|
||||
@@ -1231,8 +1232,13 @@ static inline unsigned int folio_order(const 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
|
||||
|
||||
+11
-3
@@ -57,9 +57,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;
|
||||
|
||||
@@ -255,11 +255,15 @@ err:
|
||||
|
||||
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;
|
||||
|
||||
@@ -285,11 +289,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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user