From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 36F1F1F4CC; Wed, 8 Jan 2025 04:51:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1736311896; bh=fiqLMSKs6uKw3P2fppwT774/Y1lH5q/gN/AbCqI8RwY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hqIBRmYN/WZ0icETSOR4EboTLbu3xXSyzjFPPwu5D2DNxgynsAQnzerNFjx4DfX0U 75n/eIsrgYNFIZbxheKg3rFmBjPF+ow5bOCelnxzI2OGlTepNZJ0tnLhXSUswINNK9 /vZ01fX21RlsX+anu+C6IS/P2QNewsb7hlrVNElg= Date: Wed, 8 Jan 2025 04:51:35 +0000 From: Eric Wong To: Alyssa Ross Cc: meta@public-inbox.org Subject: Re: [PATCH 2/2] treewide: lose F_SETPIPE_SZ page size assumptions Message-ID: <20250108045136.M43020@dcvr> References: <20250107174624.1504268-1-hi@alyssa.is> <20250107174624.1504268-3-hi@alyssa.is> <20250107222656.M989952@dcvr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20250107222656.M989952@dcvr> List-Id: Eric Wong wrote: > Alyssa Ross 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).