mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
Revert "binder: add lockless binder_alloc_(set|get)_vma()"
This reverts commit d7cee853bc.
It breaks the Android KABI and will be brought back at a later time when
it is safe to do so.
Bug: 161946584
Change-Id: I192028d99847d9a4421ed953a765fb8dadbbfce7
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -310,18 +310,17 @@ err_no_vma:
|
|||||||
return vma ? -ENOMEM : -ESRCH;
|
return vma ? -ENOMEM : -ESRCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void binder_alloc_set_vma(struct binder_alloc *alloc,
|
|
||||||
struct vm_area_struct *vma)
|
|
||||||
{
|
|
||||||
/* pairs with smp_load_acquire in binder_alloc_get_vma() */
|
|
||||||
smp_store_release(&alloc->vma, vma);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline struct vm_area_struct *binder_alloc_get_vma(
|
static inline struct vm_area_struct *binder_alloc_get_vma(
|
||||||
struct binder_alloc *alloc)
|
struct binder_alloc *alloc)
|
||||||
{
|
{
|
||||||
/* pairs with smp_store_release in binder_alloc_set_vma() */
|
struct vm_area_struct *vma = NULL;
|
||||||
return smp_load_acquire(&alloc->vma);
|
|
||||||
|
if (alloc->vma) {
|
||||||
|
/* Look at description in binder_alloc_set_vma */
|
||||||
|
smp_rmb();
|
||||||
|
vma = alloc->vma;
|
||||||
|
}
|
||||||
|
return vma;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool debug_low_async_space_locked(struct binder_alloc *alloc, int pid)
|
static bool debug_low_async_space_locked(struct binder_alloc *alloc, int pid)
|
||||||
@@ -384,7 +383,6 @@ static struct binder_buffer *binder_alloc_new_buf_locked(
|
|||||||
size_t size, data_offsets_size;
|
size_t size, data_offsets_size;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* Check binder_alloc is fully initialized */
|
|
||||||
if (!binder_alloc_get_vma(alloc)) {
|
if (!binder_alloc_get_vma(alloc)) {
|
||||||
binder_alloc_debug(BINDER_DEBUG_USER_ERROR,
|
binder_alloc_debug(BINDER_DEBUG_USER_ERROR,
|
||||||
"%d: binder_alloc_buf, no vma\n",
|
"%d: binder_alloc_buf, no vma\n",
|
||||||
@@ -781,9 +779,7 @@ int binder_alloc_mmap_handler(struct binder_alloc *alloc,
|
|||||||
buffer->free = 1;
|
buffer->free = 1;
|
||||||
binder_insert_free_buffer(alloc, buffer);
|
binder_insert_free_buffer(alloc, buffer);
|
||||||
alloc->free_async_space = alloc->buffer_size / 2;
|
alloc->free_async_space = alloc->buffer_size / 2;
|
||||||
|
alloc->vma = vma;
|
||||||
/* Signal binder_alloc is fully initialized */
|
|
||||||
binder_alloc_set_vma(alloc, vma);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -965,7 +961,7 @@ int binder_alloc_get_allocated_count(struct binder_alloc *alloc)
|
|||||||
*/
|
*/
|
||||||
void binder_alloc_vma_close(struct binder_alloc *alloc)
|
void binder_alloc_vma_close(struct binder_alloc *alloc)
|
||||||
{
|
{
|
||||||
binder_alloc_set_vma(alloc, NULL);
|
alloc->vma = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user