Skip to content

cat: unnecessary +1 splice() call with small input #11847

@oech3

Description

@oech3

separated issue from #10832 .

$ head -c 4096 /dev/zero >/tmp/huge
$ strace -c -e splice cat /tmp/huge >/dev/null
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
100.00    0.000007           1         4         1 splice

But we should have 3 splice() as

  1. try to splice() without broker pipe (FAIL)
  2. splice() to broker pipe
  3. splice() to output from broker

related: #11844 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions