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

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

Merge "ion: Convert allocation counters to long"

parents 9199121e e4640069
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -760,16 +760,7 @@ static int __arm_lpae_unmap(struct arm_lpae_io_pgtable *data,
		if (!iopte_tblcnt(*ptep)) {
			/* no valid mappings left under this table. free it. */
			__arm_lpae_set_pte(ptep, 0, &iop->cfg);
			io_pgtable_tlb_add_flush(iop, iova,
						 entries * entry_size,
						 ARM_LPAE_GRANULE(data),
						 false);
			__arm_lpae_free_pgtable(data, lvl + 1, table_base);
		} else {
			io_pgtable_tlb_add_flush(iop, iova,
						 entries * entry_size,
						 ARM_LPAE_GRANULE(data),
						 true);
		}

		return entries * entry_size;
+8 −8
Original line number Diff line number Diff line
@@ -265,7 +265,7 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap,
	mutex_lock(&dev->buffer_lock);
	ion_buffer_add(dev, buffer);
	mutex_unlock(&dev->buffer_lock);
	atomic_add(len, &heap->total_allocated);
	atomic_long_add(len, &heap->total_allocated);
	return buffer;

err:
@@ -283,7 +283,7 @@ void ion_buffer_destroy(struct ion_buffer *buffer)
		buffer->heap->ops->unmap_kernel(buffer->heap, buffer);
	buffer->heap->ops->unmap_dma(buffer->heap, buffer);

	atomic_sub(buffer->size, &buffer->heap->total_allocated);
	atomic_long_sub(buffer->size, &buffer->heap->total_allocated);
	buffer->heap->ops->free(buffer);
	vfree(buffer->pages);
	kfree(buffer);
@@ -321,7 +321,7 @@ static void ion_buffer_add_to_handle(struct ion_buffer *buffer)
{
	mutex_lock(&buffer->lock);
	if (buffer->handle_count == 0)
		atomic_add(buffer->size, &buffer->heap->total_handles);
		atomic_long_add(buffer->size, &buffer->heap->total_handles);

	buffer->handle_count++;
	mutex_unlock(&buffer->lock);
@@ -347,7 +347,7 @@ static void ion_buffer_remove_from_handle(struct ion_buffer *buffer)
		task = current->group_leader;
		get_task_comm(buffer->task_comm, task);
		buffer->pid = task_pid_nr(task);
		atomic_sub(buffer->size, &buffer->heap->total_handles);
		atomic_long_sub(buffer->size, &buffer->heap->total_handles);
	}
	mutex_unlock(&buffer->lock);
}
@@ -1848,10 +1848,10 @@ void show_ion_usage(struct ion_device *dev)
		"Total orphaned size");
	pr_info("---------------------------------\n");
	plist_for_each_entry(heap, &dev->heaps, node) {
		pr_info("%16.s 0x%16.x 0x%16.x\n",
			heap->name, atomic_read(&heap->total_allocated),
			atomic_read(&heap->total_allocated) -
			atomic_read(&heap->total_handles));
		pr_info("%16.s 0x%16.lx 0x%16.lx\n",
			heap->name, atomic_long_read(&heap->total_allocated),
			atomic_long_read(&heap->total_allocated) -
			atomic_long_read(&heap->total_handles));
		if (heap->debug_show)
			heap->debug_show(heap, NULL, 0);
	}
+2 −2
Original line number Diff line number Diff line
@@ -216,8 +216,8 @@ struct ion_heap {
	struct task_struct *task;

	int (*debug_show)(struct ion_heap *heap, struct seq_file *, void *);
	atomic_t total_allocated;
	atomic_t total_handles;
	atomic_long_t total_allocated;
	atomic_long_t total_handles;
};

/**