mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 21:51:05 +00:00
thp: compound_trans_order
Read compound_trans_order safe. Noop for CONFIG_TRANSPARENT_HUGEPAGE=n. Signed-off-by: Andrea Arcangeli <aarcange@redhat.com> Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
91600e9e59
commit
37c2ac7872
3 changed files with 26 additions and 12 deletions
|
@ -450,6 +450,20 @@ static inline int compound_order(struct page *page)
|
|||
return (unsigned long)page[1].lru.prev;
|
||||
}
|
||||
|
||||
static inline int compound_trans_order(struct page *page)
|
||||
{
|
||||
int order;
|
||||
unsigned long flags;
|
||||
|
||||
if (!PageHead(page))
|
||||
return 0;
|
||||
|
||||
flags = compound_lock_irqsave(page);
|
||||
order = compound_order(page);
|
||||
compound_unlock_irqrestore(page, flags);
|
||||
return order;
|
||||
}
|
||||
|
||||
static inline void set_compound_order(struct page *page, unsigned long order)
|
||||
{
|
||||
page[1].lru.prev = (void *)order;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue