From: Alyssa Ross <hi@alyssa.is>
To: Eric Wong <e@80x24.org>
Cc: meta@public-inbox.org
Subject: Re: [PATCH 2/2] treewide: lose F_SETPIPE_SZ page size assumptions
Date: Thu, 09 Jan 2025 17:59:29 +0100 [thread overview]
Message-ID: <87tta7ly8e.fsf@alyssa.is> (raw)
In-Reply-To: <20250108045136.M43020@dcvr>
[-- Attachment #1: Type: text/plain, Size: 1034 bytes --]
Eric Wong <e@80x24.org> writes:
> Eric Wong <e@80x24.org> wrote:
>> Alyssa Ross <hi@alyssa.is> wrote:
>> > fcntl(2) is documented as rounding up sizes to an integer multiple of
>> > the page size. When a pipe buffer as small as possible is desired,
>> > it's cleaner to pass 0 and let the kernel set the pipe buffer to
>> > exactly one page than it is to assume that pages are 4096 bytes.
>>
>> OK. I suppose the Linux kernel has enough testers that it's
>> chances of it mishandling someday 0 would be caught before any
>> release.
>
> Well, that was only thinking about potential future bugs...
>
> Looking backwards, older Linux appeared to handle 0 improperly before
> d3f14c485867 (pipe: avoid round_pipe_size() nr_pages overflow on 32-bit, 2017-11-17)
> https://yhbt.net/lore/lkml/d3f14c485867cfb2e0c48aa88c41d0ef4bf5209c/s/
>
> I haven't tried an ancient kernel to verify and my arithmetic is awful
> (d3f14c485867 also got backported to older distro kernels).
Okay, let's just leave it as-is then.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]
next prev parent reply other threads:[~2025-01-09 17:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-07 17:46 [PATCH 1/2] t/lei-sigpipe.t: use correct pipe size Alyssa Ross
2025-01-07 17:46 ` [PATCH 2/2] treewide: lose F_SETPIPE_SZ page size assumptions Alyssa Ross
2025-01-07 22:26 ` Eric Wong
2025-01-08 4:51 ` Eric Wong
2025-01-09 16:59 ` Alyssa Ross [this message]
2025-01-07 22:22 ` [PATCH 1/2] t/lei-sigpipe.t: use correct pipe size Eric Wong
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
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87tta7ly8e.fsf@alyssa.is \
--to=hi@alyssa.is \
--cc=e@80x24.org \
--cc=meta@public-inbox.org \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).