From owner-freebsd-hackers@FreeBSD.ORG Tue Mar 20 20:02:38 2012 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3003C106566B for ; Tue, 20 Mar 2012 20:02:37 +0000 (UTC) (envelope-from rank1seeker@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id AC4488FC08 for ; Tue, 20 Mar 2012 20:02:36 +0000 (UTC) Received: by bkcjc3 with SMTP id jc3so490602bkc.13 for ; Tue, 20 Mar 2012 13:02:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:from:to:subject:date:content-type :content-transfer-encoding:in-reply-to:references:x-mailer; bh=wx3C3MeSsWtNzW4wYh6JSvInnqncu4QOS4vLIYHF8+c=; b=t1TQLT0pdiSZ2QxqVOHnp7lKuz+GczdMb1OtJUsLqsn6eIsQEAJa/TMcgDiYYC10l6 Cp5Ooj2Xwwd+3mtaqR/2X2x47n6afLBQ86lk6Ecp99G+CVJ7GRR0q1Hmlsn09D5CfRWl +Y84vN29lBp8xQoDtaI5bUcKdVzE/NVKKfQLJ8p/eYKmlU9nC8d0e558aBTNuP1dqQBY zF+tQsX2LHJnleMwd6TYptJpOIPQ15AQ7gGREO3c7xfHiGFI43cv7tBO+0Xz2m2uQ926 qcsY/VOYKsWoeUxNDYVqJ7a/kgGMWUIHrx3SiLIF3xmNan9jWV8UqxYz1gGTlgoW0lEQ c0bQ== Received: by 10.204.173.11 with SMTP id n11mr414921bkz.120.1332273755565; Tue, 20 Mar 2012 13:02:35 -0700 (PDT) Received: from DOMYPC ([82.193.208.173]) by mx.google.com with ESMTPS id u14sm5341576bkp.2.2012.03.20.13.02.31 (version=SSLv3 cipher=OTHER); Tue, 20 Mar 2012 13:02:33 -0700 (PDT) Message-ID: <20120320.200234.909.1@DOMY-PC> From: rank1seeker@gmail.com To: "RW" , hackers@freebsd.org Date: Tue, 20 Mar 2012 21:02:34 +0100 Content-Type: text/plain; charset="Windows-1250" Content-Transfer-Encoding: quoted-printable In-Reply-To: <20120318134156.61d6db61@gumby.homeunix.com> References: <20120318.130139.003.1@DOMY-PC> <20120318134156.61d6db61@gumby.homeunix.com> X-Mailer: POP Peeper (3.8.1.0) Cc: Subject: Re: BUG: REL 9.0 - MD malloc of custom sector size X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2012 20:02:38 -0000 ----- Original Message -----=0D=0AFrom: RW = =0D=0ATo: = freebsd-hackers@freebsd.org=0D=0ADate: Sun, 18 Mar 2012 13:41:56 = +0000=0D=0ASubject: Re: BUG: REL 9.0 - MD malloc of custom sector = size=0D=0A=0D=0A> On Sun, 18 Mar 2012 14:01:39 +0100=0D=0A> = rank1seeker@gmail.com wrote:=0D=0A> =0D=0A> > man mdconfig=0D=0A> > = ----=0D=0A> > -S sectorsize to use for malloc backed device=0D=0A> > = ----=0D=0A> > =0D=0A> > I want to create MD device, with sector size of 4 = Kb.=0D=0A> > =0D=0A> > It is CRITICAL to NOT append ANY suffixes, when = specifing size, via=0D=0A> > '-s' flag in order to use sectors, to set = it's size. # mdconfig -a -t=0D=0A> > malloc -S 4096 -s 32768=0D=0A> > = =0D=0A> > This should created dev of 128 Mb in size.=0D=0A> > 32768 = sectors * 4 Kb each =3D 131072 Kb =3D 128 Mb=0D=0A> > Not! It created dev = of 16 Mb in size, because sector size remained at=0D=0A> > 512 = bytes.=0D=0A> =0D=0A> =0D=0A> From mdconfig 8=0D=0A> =0D=0A> "Size is the = number of 512 byte sectors unless ..."=0D=0A> =0D=0A> Looks to me like = it's doing what it said it would.=0D=0A> =0D=0A> BTW are you sure you = want to use "-t malloc". This keeps the files=0D=0A> (even the deleted = ones) in memory unconditionally while ordinary=0D=0A> process memory is = paged-out. =0D=0A> =0D=0A=0D=0AMy MAIN reason to hassle with MD here, is = to test a custom sector size.=0D=0AThis can be done with '-S' flag only, = in order to set sectorsize of /dev/md*=0D=0ABut as it is malloc ONLY = option/flag, I must combine it with '-t malloc'=0D=0A=0D=0AThen I've = defined it's size by amount of sectors and as I've redefined size of 1 = sector, it simply isn't doing it's task.=0D=0ABecause it enforces = hardcoded size of 512 bytes, so documentation should not misleadingly = refer to sector in any way, but a hardcode value of 0.5 Kb, no matter of = real/actual sector size is.=0D=0A=0D=0A=0D=0A=0D=0ADomagoj Smol=E8i=E6