Files
ack-tegra/include/linux/page_pinner.h
Minchan Kim 55e076e328 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>
2025-02-28 08:35:52 -08:00

49 lines
1.2 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __LINUX_PAGE_PINNER_H
#define __LINUX_PAGE_PINNER_H
#include <linux/jump_label.h>
#ifdef CONFIG_PAGE_PINNER
extern struct static_key_false page_pinner_inited;
extern struct static_key_true failure_tracking;
extern struct page_ext_operations page_pinner_ops;
extern void __free_page_pinner(struct page *page, unsigned int order);
void __page_pinner_failure_detect(struct page *page);
void __page_pinner_put_page(struct page *page);
static inline void free_page_pinner(struct page *page, unsigned int order)
{
if (static_branch_unlikely(&page_pinner_inited))
__free_page_pinner(page, order);
}
static inline void page_pinner_put_page(struct page *page)
{
if (!static_branch_unlikely(&page_pinner_inited))
return;
__page_pinner_put_page(page);
}
static inline void page_pinner_failure_detect(struct page *page)
{
if (!static_branch_unlikely(&page_pinner_inited))
return;
__page_pinner_failure_detect(page);
}
#else
static inline void free_page_pinner(struct page *page, unsigned int order)
{
}
static inline void page_pinner_put_page(struct page *page)
{
}
static inline void page_pinner_failure_detect(struct page *page)
{
}
#endif /* CONFIG_PAGE_PINNER */
#endif /* __LINUX_PAGE_PINNER_H */