Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1c41fbd0 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Defer the pagetable destroy to a separate thread"

parents 1ce228c1 711352e2
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -26,6 +26,17 @@

static void pagetable_remove_sysfs_objects(struct kgsl_pagetable *pagetable);

static void _deferred_destroy(struct work_struct *ws)
{
	struct kgsl_pagetable *pagetable = container_of(ws,
					struct kgsl_pagetable, destroy_ws);

	if (PT_OP_VALID(pagetable, mmu_destroy_pagetable))
		pagetable->pt_ops->mmu_destroy_pagetable(pagetable);

	kfree(pagetable);
}

static void kgsl_destroy_pagetable(struct kref *kref)
{
	struct kgsl_pagetable *pagetable = container_of(kref,
@@ -33,10 +44,7 @@ static void kgsl_destroy_pagetable(struct kref *kref)

	kgsl_mmu_detach_pagetable(pagetable);

	if (PT_OP_VALID(pagetable, mmu_destroy_pagetable))
		pagetable->pt_ops->mmu_destroy_pagetable(pagetable);

	kfree(pagetable);
	kgsl_schedule_work(&pagetable->destroy_ws);
}

static inline void kgsl_put_pagetable(struct kgsl_pagetable *pagetable)
@@ -299,6 +307,7 @@ kgsl_mmu_createpagetableobject(struct kgsl_mmu *mmu, unsigned int name)
	kref_init(&pagetable->refcount);

	spin_lock_init(&pagetable->lock);
	INIT_WORK(&pagetable->destroy_ws, _deferred_destroy);

	pagetable->mmu = mmu;
	pagetable->name = name;
+1 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ struct kgsl_pagetable {
	struct list_head list;
	unsigned int name;
	struct kobject *kobj;
	struct work_struct destroy_ws;

	struct {
		atomic_t entries;