From: "Peter T. Breuer" <ptb@it.uc3m.es>
To: "William Park" <opengeometry@yahoo.ca>
Cc: "linux kernel" <linux-kernel@vger.kernel.org>
Subject: Re: blocks or KB? (was: .. current meaning of blk_size array)
Date: Thu, 15 Nov 2001 13:35:26 +0100 (MET) [thread overview]
Message-ID: <200111151235.fAFCZQY31248@oboe.it.uc3m.es> (raw)
In-Reply-To: <20011115003434.A25883@node0.opengeometry.ca> from "William Park" at "Nov 15, 2001 00:34:34 am"
"A month of sundays ago William Park wrote:"
> On Wed, Nov 14, 2001 at 09:41:11PM +0100, Peter T. Breuer wrote:
> > blk_size is the number of blocks or KB (which?) in a device. blksize is
> > the size of the blocks. Is blk_size in KB or blocks?
> >
> > It should be in blocks if the size of a device is to reach 8 or 16TB.
> > If it is in KB, we are limited to 2 or 4TB.
>
> I've been following this thread intensely. I need to use Network Block
> Device to get very large network-RAID. And, resolution to this issue is
> of great interest to me.
Yes, well, you may be the person on whose behalf I started checking it
out.
To put your mind at rest, all devices (partitions, etc.) are limited by
the 32 bit int that holds the number of sectors on a device. This is
31+9 bits of space (i don't know whether negative sectors are counted
as positive :), which is 1 (or 2, if you use unsigned interpretation)
TB.
So the blk_size/blksize business is irrelevant.
> Judging by 'driver/block/nbd.c', it counts by BLOCK_SIZE=1204
> (BLOCK_SIZE_BITS=10), even though you can set the block size to
> [512,1024,...,PAGE_SIZE=4096]. Since NBD counts this 1KB block using
> 'u64' integer, the ultimate size of filesystem is determined by the
> kernel block device support.
This is correct, but it's quite a deep dependence in the kernel.
Though nbd (and my enbd) use 64 bit sizes in their network protocols,
you can't get rid of the limitation just like that. The kernel is
infested with the limit associated with a 32bit sector count. The
32bit KB count in blk_size is also a limit, but never an active one
as the sector count bites first, before the other is reached. The
kernel's VM thinks those sector counts are 32 bit and that sectors
are 512B, which means the person in charge of the VM must handle any
changes.
To tell the truth, counting in 512B sectors is the only sane way to
go. It sends you mad counting in units of blocks, because that
can be a variable size.
> Looking at 'fs/block_dev.c', you can set the block size to
> [512,1024,...,PAGE_SIZE=4096] also. But, 'max_block()' returns block
> count in whatever block size of the device, not in BLOCK_SIZE:
It looks to me as though block_dev.c has been "prepared" to be more
flexible, and that it will be a short job to either use 64bit sector
counts for it, or move to counting in blocks. The same work
has not gone into ll_rw_blk.c yet.
> In particular, if block size is 512, then the block count is multiplied
> by 2; and if block size if 4096, then the block count is divided by 4.
> It thinks that 'blk_size[][]' is block count in KB. So, I can only
> deduce that block count is in KB.
It still is, yes.
> Also, from 'include/linux/blkdev.h',
> extern int * blk_size[MAX_BLKDEV];
> 'blk_size[][]' is 'int', which means maximum size of block device is
> 2^10 x 2^31 = 2^41 = 2TB. However, because it is always converted to
> 'unsigned int' for block count calculation, I think you can take it as
> 4TB.
>
> Am I right?
As far as I can tell. I was trying to ask here if it had changed, but
evidently it has not.
What is the forward strategy? I see no alternative but moving to 64bit
sector counts.
Peter
next prev parent reply other threads:[~2001-11-15 12:36 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-13 15:08 what is teh current meaning of blk_size? Peter T. Breuer
2001-11-13 18:51 ` blocks or KB? (was: .. current meaning of blk_size array) Peter T. Breuer
2001-11-14 9:44 ` Martin Dalecki
2001-11-14 20:41 ` Peter T. Breuer
2001-11-14 20:51 ` Martin Dalecki
2001-11-14 21:16 ` Andreas Dilger
2001-11-14 21:49 ` Benjamin LaHaise
2001-11-14 22:33 ` Scott Laird
2001-11-15 1:48 ` William Park
2001-11-15 4:58 ` Andreas Dilger
2001-11-15 5:34 ` William Park
2001-11-15 5:55 ` Andreas Dilger
2001-11-15 12:35 ` Peter T. Breuer [this message]
2001-11-15 18:31 ` William Park
2001-11-15 20:19 ` Andreas Dilger
2001-11-15 22:04 ` blocks or KB? William Park
2001-11-15 10:42 ` blocks or KB? (was: .. current meaning of blk_size array) Anton Altaparmakov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200111151235.fAFCZQY31248@oboe.it.uc3m.es \
--to=ptb@it.uc3m.es \
--cc=linux-kernel@vger.kernel.org \
--cc=opengeometry@yahoo.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®