Page MenuHomeFreeBSD

sbuf: Process more than one char at a time
ClosedPublic

Authored by cem on Sep 22 2015, 10:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 4, 1:15 PM
Unknown Object (File)
Feb 28 2024, 10:57 PM
Unknown Object (File)
Feb 26 2024, 3:22 AM
Unknown Object (File)
Jan 5 2024, 5:46 PM
Unknown Object (File)
Jan 1 2024, 5:07 AM
Unknown Object (File)
Dec 20 2023, 1:33 AM
Unknown Object (File)
Dec 15 2023, 1:09 AM
Unknown Object (File)
Nov 27 2023, 2:39 AM
Subscribers

Details

Summary

Revamp sbuf_put_byte() to sbuf_put_bytes() in the obvious fashion and
fixup callers.

Test Plan

The kproc sysctl was showing up in traces. Make sbuf append less pessimistic.

libsbuf compiles ok. I don't see any kyua tests for it, though.

Standard boilerplate: Is anyone waiting until they are less busy to give feedback? I'd like to commit this soon, so if I don't hear anything for 2-3 days I will go ahead. If you don't have time to review in 2-3 days but believe that *your personal* review must happen before this goes in, just let me know (and please give me an approximate time frame for review). Thanks!

I've been running this kernel (admittedly, not doing much) since yesterday.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

cem retitled this revision from to sbuf: Process more than one char at a time.
cem updated this object.
cem edited the test plan for this revision. (Show Details)
cem added reviewers: markj, ian.
cem added a subscriber: benno.

I'll look at this more closely soon, but note (if you didn't know already) that sbuf is built in userland from lib/libsbuf and linked into a number of programs and libs. Might be useful for doing some ad-hoc testing.

cem edited edge metadata.
In D3717#76705, @markj wrote:

I'll look at this more closely soon, but note (if you didn't know already) that sbuf is built in userland from lib/libsbuf and linked into a number of programs and libs. Might be useful for doing some ad-hoc testing.

No tests in libsbuf; mdconfig has tests and uses libgeom which links libsbuf. I tried running those with the objdir mdconfig and they seem to pass.

Tried usr.bin/apply; make test passes there as well.

IIRC there was some discussion about using sbuf at panic time when someone else brought this up before..

The ci thing is kind of ugly. Maybe provide a simple sbuf_put_byte() wrapper so that it isn't needed? Then the compiler can handle the int -> char conversion transparently.

In D3717#76875, @jhb wrote:

The ci thing is kind of ugly. Maybe provide a simple sbuf_put_byte() wrapper so that it isn't needed? Then the compiler can handle the int -> char conversion transparently.

I agree it's ugly. I only do that to avoid breaking ABI.

We could also just say "the ABI sucks" and replace int c arguments with char c and eliminate ci that way.

Per jhb@, drop 'ci' thing and add sbuf_put_byte wrapper, for now.

markj edited edge metadata.
markj added inline comments.
sys/kern/subr_sbuf.c
435 ↗(On Diff #8919)

Extra newline.

This revision is now accepted and ready to land.Sep 24 2015, 6:51 PM
sys/kern/subr_sbuf.c
435 ↗(On Diff #8919)

Will fix before checkin.

jhb added a reviewer: jhb.
This revision was automatically updated to reflect the committed changes.