aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/objdiff
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2019-11-15 13:30:32 +0000
committerDavid Howells <dhowells@redhat.com>2019-10-31 15:12:34 +0000
commit8cefc107ca54c8b06438b7dc9cc08bc0a11d5b98 (patch)
tree3e01800bf202ddff7841a717ddc47d1e5771768a /scripts/objdiff
parentAdd wake_up_interruptible_sync_poll_locked() (diff)
downloadlinux-8cefc107ca54c8b06438b7dc9cc08bc0a11d5b98.tar.gz
linux-8cefc107ca54c8b06438b7dc9cc08bc0a11d5b98.zip
pipe: Use head and tail pointers for the ring, not cursor and length
Convert pipes to use head and tail pointers for the buffer ring rather than pointer and length as the latter requires two atomic ops to update (or a combined op) whereas the former only requires one. (1) The head pointer is the point at which production occurs and points to the slot in which the next buffer will be placed. This is equivalent to pipe->curbuf + pipe->nrbufs. The head pointer belongs to the write-side. (2) The tail pointer is the point at which consumption occurs. It points to the next slot to be consumed. This is equivalent to pipe->curbuf. The tail pointer belongs to the read-side. (3) head and tail are allowed to run to UINT_MAX and wrap naturally. They are only masked off when the array is being accessed, e.g.: pipe->bufs[head & mask] This means that it is not necessary to have a dead slot in the ring as head == tail isn't ambiguous. (4) The ring is empty if "head == tail". A helper, pipe_empty(), is provided for this. (5) The occupancy of the ring is "head - tail". A helper, pipe_occupancy(), is provided for this. (6) The number of free slots in the ring is "pipe->ring_size - occupancy". A helper, pipe_space_for_user() is provided to indicate how many slots userspace may use. (7) The ring is full if "head - tail >= pipe->ring_size". A helper, pipe_full(), is provided for this. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'scripts/objdiff')
0 files changed, 0 insertions, 0 deletions
ptrace-abi.h?id=cba4b65d359268c40679ca75ac92c0b93cecf6de&follow=1'>x86, ptrace: add buffer size checksMarkus Metzger2-10/+29 2008-01-30x86, ptrace: support 32bit-cross-64bit BTS recordingMarkus Metzger4-54/+53 2008-01-30x86, ptrace: rlimit BTS buffer allocationMarkus Metzger1-46/+103 2008-01-30x86: move deeply indented code to reenter_kprobeMasami Hiramatsu1-23/+23 2008-01-30x86: add reenter_kprobe helperHarvey Harrison1-11/+15 2008-01-30x86: fix kprobe_handler reenable preemptionMasami Hiramatsu1-1/+2 2008-01-30x86: voluntary leave_mm before entering ACPI C3Venki Pallipadi7-4/+19 2008-01-30x86: add some pirq debuggingIngo Molnar1-1/+13 2008-01-30PCI: remove default PCI expansion ROM memory allocationGary Hade1-0/+17 2008-01-30x86: fix dmi_alloc() to not advance alloc index in case ofParag Warudkar1-1/+2 2008-01-30x86: fix DMI out of memory problemsParag Warudkar1-3/+21 2008-01-30x86: remove unused include/asm-x86/processor_32/64.hIngo Molnar2-163/+0 2008-01-30x86: finish processor.h integrationGlauber de Oliveira Costa1-3/+137 2008-01-30x86: remove __init modifier from header declarationGlauber de Oliveira Costa1-1/+1 2008-01-30x86: x86 ptrace generic requestsRoland McGrath1-36/+1 2008-01-30x86: x86 core dump TLSRoland McGrath2-0/+2 2008-01-30x86: x86 ia32_binfmt removalRoland McGrath1-284/+0 2008-01-30x86: compat_binfmt_elfRoland McGrath4-26/+99 2008-01-30x86: x86 user_regset cleanupRoland McGrath7-232/+9 2008-01-30x86: x86 ptrace user_regsetRoland McGrath1-159/+77 2008-01-30x86: x86 CORE_DUMP_USE_REGSETRoland McGrath1-0/+1 2008-01-30x86: x86 user_regset_viewRoland McGrath1-0/+87 2008-01-30x86: x86 user_regset general regsRoland McGrath1-0/+109 2008-01-30x86: x86 user_regset TLSRoland McGrath2-6/+104 2008-01-30x86: x86 TLS desc_struct cleanupRoland McGrath2-46/+54 2008-01-30x86: x86 i387 cleanupRoland McGrath5-824/+374 2008-01-30x86: x86 i387 user_regsetRoland McGrath8-254/+265 2008-01-30x86: i387 renamingRoland McGrath2-1/+2 2008-01-30x86: x86 user_regset math_emuRoland McGrath1-32/+54 2008-01-30x86: x86 i387 header cleanupRoland McGrath2-113/+233 2008-01-30x86: x86 i387 unify structsRoland McGrath1-50/+42 2008-01-30x86: x86-64 wired cpu_has macrosRoland McGrath1-0/+12 2008-01-30x86: compat_sys_ptraceRoland McGrath2-0/+53 2008-01-30x86: compat_ptrace_requestRoland McGrath2-0/+42 2008-01-30x86: ptrace_request peekdata/pokedataRoland McGrath1-0/+7 2008-01-30x86: user_regset user-copy helpersRoland McGrath1-0/+46 2008-01-30x86: compat_binfmt_elf KconfigRoland McGrath2-0/+5