MALI: bifrost: from ARM: Remove references to PageMovable()
The original patch is attached in the mail of Zhigang.Yao@arm.com at 2023-02-08 09:00. Commit message in the original patch: { From d1245d8578ba6ae4fb1b0f70417a97ea6afa920d Mon Sep 17 00:00:00 2001 From: Raffaele Aquilone <raffaele.aquilone@arm.com> Date: Thu, 19 Jan 2023 15:26:12 +0000 Subject: [PATCH] GPUCORE-36657 Remove PageMovable() symbol The PageMovable() function has been removed from the DDK because it cannot be used in Android. The movable status of the page has been duplicated into the status variable of the page metadata, and it's kept up to date every time the movable property is set or cleared, except in those cases where it's not necessary to keep alive the information. The unit test that attempts to migrate a firmware page has been removed because now the driver has no way to detect that a page without metadata is not movable; the driver has to trust that the system doesn't try to isolate pages which are not movable. ... } Its base is not current g15. I applied it manually on DDK g15. Change-Id: I7e8a29f3ce79d991bc8b3a746690e9ef279e572a Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
This commit is contained in:
parent
454734f2dc
commit
ccf3f0670c
2 changed files with 24 additions and 7 deletions
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
|
||||
/*
|
||||
*
|
||||
* (C) COPYRIGHT 2022 ARM Limited. All rights reserved.
|
||||
* (C) COPYRIGHT 2022-2023 ARM Limited. All rights reserved.
|
||||
*
|
||||
* This program is free software and is provided to you under the terms of the
|
||||
* GNU General Public License version 2 as published by the Free Software
|
||||
|
|
@ -51,8 +51,10 @@ bool kbase_alloc_page_metadata(struct kbase_device *kbdev, struct page *p, dma_a
|
|||
spin_lock_init(&page_md->migrate_lock);
|
||||
|
||||
lock_page(p);
|
||||
if (kbdev->mem_migrate.mapping)
|
||||
if (kbdev->mem_migrate.mapping) {
|
||||
__SetPageMovable(p, kbdev->mem_migrate.mapping);
|
||||
page_md->status = PAGE_MOVABLE_SET(page_md->status);
|
||||
}
|
||||
unlock_page(p);
|
||||
|
||||
return true;
|
||||
|
|
@ -81,6 +83,7 @@ static void kbase_free_pages_worker(struct work_struct *work)
|
|||
container_of(work, struct kbase_mem_migrate, free_pages_work);
|
||||
struct kbase_device *kbdev = container_of(mem_migrate, struct kbase_device, mem_migrate);
|
||||
struct page *p, *tmp;
|
||||
struct kbase_page_metadata *page_md;
|
||||
LIST_HEAD(free_list);
|
||||
|
||||
spin_lock(&mem_migrate->free_pages_lock);
|
||||
|
|
@ -91,8 +94,11 @@ static void kbase_free_pages_worker(struct work_struct *work)
|
|||
list_del_init(&p->lru);
|
||||
|
||||
lock_page(p);
|
||||
if (PageMovable(p))
|
||||
page_md = kbase_page_private(p);
|
||||
if (IS_PAGE_MOVABLE(page_md->status)) {
|
||||
__ClearPageMovable(p);
|
||||
page_md->status = PAGE_MOVABLE_CLEAR(page_md->status);
|
||||
}
|
||||
unlock_page(p);
|
||||
|
||||
kbase_free_page_metadata(kbdev, p);
|
||||
|
|
@ -246,6 +252,7 @@ static int kbase_page_migrate(struct address_space *mapping, struct page *new_pa
|
|||
|
||||
kbase_free_page_metadata(kbdev, old_page);
|
||||
__ClearPageMovable(old_page);
|
||||
page_md->status = PAGE_MOVABLE_CLEAR(page_md->status);
|
||||
|
||||
/* Just free new page to avoid lock contention. */
|
||||
INIT_LIST_HEAD(&new_page->lru);
|
||||
|
|
@ -302,6 +309,7 @@ static void kbase_page_putback(struct page *p)
|
|||
struct kbase_mem_migrate *mem_migrate = &kbdev->mem_migrate;
|
||||
|
||||
__ClearPageMovable(p);
|
||||
page_md->status = PAGE_MOVABLE_CLEAR(page_md->status);
|
||||
list_del_init(&p->lru);
|
||||
kbase_free_page_later(kbdev, p);
|
||||
queue_work(mem_migrate->free_pages_workq, &mem_migrate->free_pages_work);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
/*
|
||||
*
|
||||
* (C) COPYRIGHT 2022 ARM Limited. All rights reserved.
|
||||
* (C) COPYRIGHT 2022-2023 ARM Limited. All rights reserved.
|
||||
*
|
||||
* This program is free software and is provided to you under the terms of the
|
||||
* GNU General Public License version 2 as published by the Free Software
|
||||
|
|
@ -23,13 +23,22 @@
|
|||
* DOC: Base kernel page migration implementation.
|
||||
*/
|
||||
|
||||
#define PAGE_STATUS_MASK ((u8)0x7F)
|
||||
#define PAGE_STATUS_MASK ((u8)0x3F)
|
||||
#define PAGE_STATUS_GET(status) (status & PAGE_STATUS_MASK)
|
||||
#define PAGE_STATUS_SET(status, value) ((status & ~PAGE_STATUS_MASK) | (value & PAGE_STATUS_MASK))
|
||||
|
||||
#define PAGE_ISOLATE_SHIFT (7)
|
||||
#define PAGE_ISOLATE_MASK ((u8)1 << PAGE_ISOLATE_SHIFT)
|
||||
#define PAGE_ISOLATE_SET(status, value) \
|
||||
((status & PAGE_STATUS_MASK) | (value << PAGE_ISOLATE_SHIFT))
|
||||
#define IS_PAGE_ISOLATED(status) ((bool)(status & ~PAGE_STATUS_MASK))
|
||||
((status & ~PAGE_ISOLATE_MASK) | (value << PAGE_ISOLATE_SHIFT))
|
||||
#define IS_PAGE_ISOLATED(status) ((bool)(status & PAGE_ISOLATE_MASK))
|
||||
|
||||
#define PAGE_MOVABLE_SHIFT (6)
|
||||
#define PAGE_MOVABLE_MASK ((u8)1 << PAGE_MOVABLE_SHIFT)
|
||||
#define PAGE_MOVABLE_CLEAR(status) ((status) & ~PAGE_MOVABLE_MASK)
|
||||
#define PAGE_MOVABLE_SET(status) (status | PAGE_MOVABLE_MASK)
|
||||
|
||||
#define IS_PAGE_MOVABLE(status) ((bool)(status & PAGE_MOVABLE_MASK))
|
||||
|
||||
/* Global integer used to determine if module parameter value has been
|
||||
* provided and if page migration feature is enabled.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue