From owner-freebsd-fs@FreeBSD.ORG Tue Jan 29 18:14:40 2013 Return-Path: Delivered-To: fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0EDB7287 for ; Tue, 29 Jan 2013 18:14:40 +0000 (UTC) (envelope-from matthew.ahrens@delphix.com) Received: from mail-la0-x235.google.com (mail-la0-x235.google.com [IPv6:2a00:1450:4010:c03::235]) by mx1.freebsd.org (Postfix) with ESMTP id 89A16E49 for ; Tue, 29 Jan 2013 18:14:39 +0000 (UTC) Received: by mail-la0-f53.google.com with SMTP id fr10so533902lab.12 for ; Tue, 29 Jan 2013 10:14:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphix.com; s=google; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=ysQRgwYXD0w0xg518IqGyFdrPwrB5w6+A+jKT8g4WyU=; b=NLTFL0iOEbRABik60N5vh/eqmaXioQQzFDgovUPfrUkpF6MBvSSQR+fGFk4xkVZiyd ML94sFJF1cA9do8TZevBfgyFzxu5+y8bs0rOs3ryHh2pfFGLsYK4ur0L55NlPLKPlgXq 0SEmbMlsn69KMB70sX/5UrYxAB/AhidwROc88= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:x-gm-message-state; bh=ysQRgwYXD0w0xg518IqGyFdrPwrB5w6+A+jKT8g4WyU=; b=QDqMyIzY9q6V0wt/9I6qFCOBIjvmqdtFvuhzvNsdzQaNjzvHGjEeQA9PRMIDoJ1kWW iQ8ya2vp/R8YcD4zh7Pw40DPcst/JuVlwKNuWbneQAiJfgb8eussFKrQjvSSxT4y9qBM I7oktKVg/HOty3UU36oEz6fjgKFpv1FzpZR5rFaVkz0SDPDnhCwzQQlQzD9AUxIhumIq J1gtKSSNWguqPSt9/429maLNSnW3hxqc1kvYeKt+YzPgp/Ld/cU4wto6p6x30BPDs+oO 0bxI5bxzbIXF3lQh701KPQNooo2125KGgN2b1edzU9e9utSK7WkN4dTi719ssN0dWZok 4IOg== MIME-Version: 1.0 X-Received: by 10.152.144.202 with SMTP id so10mr1976797lab.9.1359483278471; Tue, 29 Jan 2013 10:14:38 -0800 (PST) Received: by 10.114.68.109 with HTTP; Tue, 29 Jan 2013 10:14:38 -0800 (PST) In-Reply-To: <5107A9B7.5030803@platinum.linux.pl> References: <5105252D.6060502@platinum.linux.pl> <5107A9B7.5030803@platinum.linux.pl> Date: Tue, 29 Jan 2013 10:14:38 -0800 Message-ID: Subject: Re: RAID-Z wasted space - asize roundups to nparity +1 From: Matthew Ahrens To: Adam Nowacki X-Gm-Message-State: ALoCoQn3bsZdbLdhB6W7iNDz3krWVpHcLic/HP8dTdlpiNiyeSTVvA/l5kIN0m4ZOMkX7RUU/6ft Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: fs@freebsd.org X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2013 18:14:40 -0000 On Tue, Jan 29, 2013 at 2:51 AM, Adam Nowacki wrote: > I've also identified another problem with ZFS wasting disk space. When > compression is off allocations are always a multiple of record size. With > the default recordsize of 128KiB a 129KiB file would use 256KiB of disk > space (+ parity and other inefficiencies mentioned above). This may be > there to help with fragmentation but then it would be good to have a > setting to turn it off - even if by means of a no-op compression that would > count zeroes backwards and return short psize. > The most straightforward way to do this would be, as you alluded, to always compress the last block of the file, even if no compression has been selected. For maximum speed, we could use the already-implemented zle (zero-length encoding) algorithm. --matt