Hi All:
Now I am reading binder code,
buffer = proc->buffer;
INIT_LIST_HEAD(&proc->buffers);
list_add(&buffer->entry, &proc->buffers);
buffer->free = 1;
binder_insert_free_buffer(proc, buffer);
proc->free_async_space = proc->buffer_size / 2;
barrier();
proc->files = get_files_struct(current);
proc->vma = vma;
proc->vma_vm_mm = vma->vm_mm;
why use barrier in here?
According the kernel/Documentation/memory-barriers.txt
barrier is an explicit compiler barrier function that prevents the
compiler from moving the memory accesses either side of it to the other side:
if no barrier here, which code will have issue in here?
Thanks
Zhaojunmin