All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <j6t@kdbg.org>
Cc: Patrick Steinhardt <ps@pks.im>,
	 Ben Knoble <ben.knoble@gmail.com>, Jeff King <peff@peff.net>,
	 "brian m. carlson" <sandals@crustytoothpaste.net>,
	 "Randall S. Becker" <randall.becker@nexbridge.ca>,
	 Phillip Wood <phillip.wood@dunelm.org.uk>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	 git@vger.kernel.org
Subject: Re: [PATCH 0/5] Reintroduce writev(3p)
Date: Mon, 27 Jul 2026 08:44:39 -0700	[thread overview]
Message-ID: <xmqqo6fso2s8.fsf@gitster.g> (raw)
In-Reply-To: <f8050598-392f-44c9-8d66-0454740a7a12@kdbg.org> (Johannes Sixt's message of "Thu, 16 Jul 2026 20:56:06 +0200")

Johannes Sixt <j6t@kdbg.org> writes:

> Am 16.07.26 um 09:52 schrieb Patrick Steinhardt:
>> this patch series reintroduces the writev(3p) wrapper. This wrapper was
>> originally introduced as part of Git 2.54 [1], but was ejected due to
>> issues on NonStop [2].
>
> Please don't call the function "writev" so that nobody associates it
> with the guarantees that only POSIX provides, but none of the
> emulations. Call it "write_gather", for example.
>
> Also, clearly document that its only purpose is to reduce sequences of
> write() calls to a single function call, but that the additional writev
> guarantees are not needed.

It is philosophically more "pure" to have a two-level abstraction
where write_gather(), which may be inspired by writev(2) but with
specific subset of semantics that the application needs, is used by
the application and have platforms with good enough writev(2) to
implement it in terms of it.  Other platforms may implement it
differently, like a series of write(2) calls, and as long as it
fulfills the need of write_gather(), we are OK.

Doing so would also help in a minuscule way to avoid adding to the
complaints we sometimes hear that our internal implementation
assumes platform support for POSIX API and semantics way too much
even when we do not need to.

So I do not mind going in that direction.  It feels a slightly
roundabout approach, but in the longer run, I think it would place
us in a much better place.

I think Patrick's writev(2) follows the pattern our previous compat/
routines have taken.  We use real writev(2) where it is available,
and in the fake implementations in compat/ we have comments that
essentially say "the real function offers X, Y, and Z, but we only
want X and Z and do not need Y, so this implementation does not
support Y".  It is harder to maintain because the application side
may be tempted over time to start depending on Y.  If some platforms
cannot easily provide an equivalent of the real function, it is
easier for them if the rules explicitly state from the beginning
that we do not require and will never require Y, needing only X and
Z from either the fake or real implementation.

At that point, we are not describing the real function anymore, so
your proposal to give it a specific name is one step away from that,
and that step is in the right direction.

Thanks.

PS.  I was going over the list of "waiting for response" topics, and
this was one of them.  I suspect Patrick and the GitLab team are
still away at an offsite [*], so this is in no way poking him for an
immediate reroll, but rather a note sent while my attention is on
these stalled topics.

https://lore.kernel.org/git/amLgMqkqxR8mKIbT@pks.im/

      reply	other threads:[~2026-07-27 15:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16  7:52 [PATCH 0/5] Reintroduce writev(3p) Patrick Steinhardt
2026-07-16  7:52 ` [PATCH 1/5] compat/posix: introduce writev(3p) wrapper Patrick Steinhardt
2026-07-16  8:47   ` Simon Richter
2026-07-16 20:09     ` Junio C Hamano
2026-07-16 20:44       ` Junio C Hamano
2026-07-16  7:52 ` [PATCH 2/5] wrapper: introduce writev(3p) wrappers Patrick Steinhardt
2026-07-16  7:52 ` [PATCH 3/5] wrapper: properly handle MAX_IO_SIZE in writev(3p) Patrick Steinhardt
2026-07-16  7:52 ` [PATCH 4/5] sideband: use writev(3p) to send pktlines Patrick Steinhardt
2026-07-16  7:52 ` [PATCH 5/5] fast-import: use writev(3p) to send cat-blob responses Patrick Steinhardt
2026-07-16 18:56 ` [PATCH 0/5] Reintroduce writev(3p) Johannes Sixt
2026-07-27 15:44   ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqo6fso2s8.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=ben.knoble@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    --cc=peff@peff.net \
    --cc=phillip.wood@dunelm.org.uk \
    --cc=ps@pks.im \
    --cc=randall.becker@nexbridge.ca \
    --cc=sandals@crustytoothpaste.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.