From owner-freebsd-fs@FreeBSD.ORG Mon Jan 28 21:55:55 2013 Return-Path: Delivered-To: fs@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5781C314 for ; Mon, 28 Jan 2013 21:55:55 +0000 (UTC) (envelope-from matthew.ahrens@delphix.com) Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by mx1.freebsd.org (Postfix) with ESMTP id E760BF38 for ; Mon, 28 Jan 2013 21:55:54 +0000 (UTC) Received: by mail-wi0-f179.google.com with SMTP id o1so1888499wic.12 for ; Mon, 28 Jan 2013 13:55:53 -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=y8OpT1j5CjrT1VzbLMRWCOk/mby9FAJJsjTdnEF+mso=; b=GetgPVQ1HdVIyAKc2Y0cIvhFjd1SYtTXxCxpjfZ+5TGSDfrrNJATnur35toaZ+m/IR igVfI1WHVvOtqJxLCtGyWb9Sy21rr1R1ZkSo7vtPcIp6NqdzfBbV79DV0knGbdhsYCGz Q/e55tVaGJmdrMxqO08g4DFU8GnYDIIYR6+dI= 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=y8OpT1j5CjrT1VzbLMRWCOk/mby9FAJJsjTdnEF+mso=; b=CGj0/cZH3l5LPaMnsMi6V4myPuTYyjBBY9ZLHRKGS+j8nmDyH0xYzIkQY1DJAahz6/ KTnp9kArchpdngvUfqs02yj5RRNBygYtZi7Hh1GcYke8C95xOmAQBEudkKXle8MJCFSE fRAZXLlsDGbNb3d9ypD5Qel3lUBEa4gtasdD4J0/8MOnh926JN6VMDxcDMRs7lK31Zep SSOFCy8qeZ7oF9mIOtFGxh1Un8z/qvp88GXtQ5LniRuCVnuOSSOoAN7F4rG7WtRC17Jh /yciM1RWtWmGa12TBTszk6v4J6PL55Oc1bzOexGrHt5kFksAGhc51Cf8Q2hAcbMx2bSe IDNw== MIME-Version: 1.0 X-Received: by 10.194.123.105 with SMTP id lz9mr23895914wjb.43.1359410153419; Mon, 28 Jan 2013 13:55:53 -0800 (PST) Received: by 10.194.32.168 with HTTP; Mon, 28 Jan 2013 13:55:53 -0800 (PST) In-Reply-To: <5105252D.6060502@platinum.linux.pl> References: <5105252D.6060502@platinum.linux.pl> Date: Mon, 28 Jan 2013 13:55:53 -0800 Message-ID: Subject: Re: RAID-Z wasted space - asize roundups to nparity +1 From: Matthew Ahrens To: Adam Nowacki X-Gm-Message-State: ALoCoQmFjZxrlyGjrcnEgskfc5TytCpM4alOcN+vLYpof6HbkJ02aF5UI2FElmGFk0H7/wXAi3Z+ 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: Mon, 28 Jan 2013 21:55:55 -0000 This is so that we won't end up with small, unallocatable segments. E.g. if you are using RAIDZ2, the smallest usable segment would be 3 sectors (1 sector data + 2 sectors parity). If we left a 1 or 2 sector free segment, it would be unusable and you'd be able to get into strange accounting situations where you have free space but can't write because you're "out of space". The amount of waste due to this can be minimized by using larger blocksizes (e.g. the default recordsize of 128k and files larger than 128k), and by using smaller sector sizes (e.g. 512b sector disks rather than 4k sector disks). In your case these techniques would limit the waste to 0.6%. --matt On Sun, Jan 27, 2013 at 5:01 AM, Adam Nowacki wrote: > I've just found something very weird in the ZFS code. > > sys/cddl/contrib/opensolaris/**uts/common/fs/zfs/vdev_raidz.**c:504 in > HEAD > > Can someone explain the reason behind this line of code? What it does is > align on-disk record size to a multiple of number of parity disks + 1 ... > this really doesn't make any sense. So far as I can tell those extra > sectors are just padding - completely unused. > > For the array I'm using this results in 4.8% of wasted disk space - 1.7TB. > It's a 12x 3TB disk RAID-Z2. > ______________________________**_________________ > freebsd-fs@freebsd.org mailing list > http://lists.freebsd.org/**mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@**freebsd.org > " >