From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 461A2C433EF for ; Thu, 17 Mar 2022 22:06:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229492AbiCQWHY (ORCPT ); Thu, 17 Mar 2022 18:07:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229529AbiCQWHX (ORCPT ); Thu, 17 Mar 2022 18:07:23 -0400 Received: from drax.kayaks.hungrycats.org (drax.kayaks.hungrycats.org [174.142.148.226]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1DD211B0BF6 for ; Thu, 17 Mar 2022 15:06:05 -0700 (PDT) Received: by drax.kayaks.hungrycats.org (Postfix, from userid 1002) id D783A264B19; Thu, 17 Mar 2022 18:06:04 -0400 (EDT) Date: Thu, 17 Mar 2022 18:06:04 -0400 From: Zygo Blaxell To: Phillip Susi Cc: Andrei Borzenkov , Jan Ziak <0xe2.0x9a.0x9b@gmail.com>, linux-btrfs@vger.kernel.org Subject: Re: Btrfs autodefrag wrote 5TB in one day to a 0.5TB SSD without a measurable benefit Message-ID: References: <87tuc9q1fc.fsf@vps.thesusis.net> <87tuc7gdzp.fsf@vps.thesusis.net> <87ee34cnaq.fsf@vps.thesusis.net> <5bfd9f15-c696-3962-aaf9-7d0eb4a79694@gmail.com> <87bky5wxt6.fsf@vps.thesusis.net> <87wngspb9x.fsf@vps.thesusis.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87wngspb9x.fsf@vps.thesusis.net> Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Thu, Mar 17, 2022 at 04:34:51PM -0400, Phillip Susi wrote: > Zygo Blaxell writes: > > You can get a 1-byte file reference if you make a reflink of the last > > block of a 4097-byte file, or punch a hole in the first 4096 bytes of a > > 4097-byte file. This creates a file containing only a reference to the > > last byte of the original extent. > > So the inode only refers to one byte of the extent, but the extent is > still always a multiple of 4k right? Yes. In theory, the on-disk format specifies extent locations and sizes in bytes. In practice, the kernel enforces that all the extent physical boundaries be a multiple of the CPU page size (or multiples of _some_ CPU's page size, with the subpage patches). On read, anything with a logical length that isn't a multiple of 4K is zero-filled.