* maximum block size in buffer_head
@ 2002-05-10 5:11 David Mosberger
2002-05-10 5:38 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: David Mosberger @ 2002-05-10 5:11 UTC (permalink / raw)
To: linux-kernel
The current Linux kernel (both 2.4.xx and 2.5.xx) declare the b_size
member in struct buffer_head as an "unsigned short". This obviously
limits the maximum block size to something less than 65536. This is
bad because on some platforms (e.g., ia64), the page size can be up to
64KB large.
Two questions:
- does anyone object to widening b_size to "unsigned int"?
- does anyone know of any other code paths where the block
size is assumed to fit into 16 bits?
Thanks,
--david
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: maximum block size in buffer_head
2002-05-10 5:11 maximum block size in buffer_head David Mosberger
@ 2002-05-10 5:38 ` Andrew Morton
2002-05-10 6:35 ` David Mosberger
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2002-05-10 5:38 UTC (permalink / raw)
To: davidm; +Cc: linux-kernel
David Mosberger wrote:
>
> The current Linux kernel (both 2.4.xx and 2.5.xx) declare the b_size
> member in struct buffer_head as an "unsigned short". This obviously
> limits the maximum block size to something less than 65536. This is
> bad because on some platforms (e.g., ia64), the page size can be up to
> 64KB large.
>
> Two questions:
>
> - does anyone object to widening b_size to "unsigned int"?
Sounds OK to me for 2.5.
I do have vague plans to remove b_data and to replace all instances
with buffer_data(), which would kmap the page and calculate the address.
Not that I've really thought this through...
This may lead to the introduction of a `b_offset'. Which would be 16
bits, which would snuggle in with the 16-bit b_size. But I would
scale both these values by 256 or 512, for the reasons which you
identify.
For 2.4, a 32-bit b_size would push sizeof(buffer_head) from 96 up
to 100 bytes, which does not pack as well into the slab. This would
be an intensely unpopular move. So you'd have to ifdef it. Which
makes it an ia64-only problem, which greatly improves your merge
chances ;)
> - does anyone know of any other code paths where the block
> size is assumed to fit into 16 bits?
Not off the top, but they're probably there.
-
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: maximum block size in buffer_head
2002-05-10 5:38 ` Andrew Morton
@ 2002-05-10 6:35 ` David Mosberger
0 siblings, 0 replies; 3+ messages in thread
From: David Mosberger @ 2002-05-10 6:35 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
>>>>> On Thu, 09 May 2002 22:38:13 -0700, Andrew Morton <akpm@zip.com.au> said:
Andrew> Sounds OK to me for 2.5.
Will you make the change then? I'd appreciate that.
Andrew> For 2.4, a 32-bit b_size would push sizeof(buffer_head) from
Andrew> 96 up to 100 bytes, which does not pack as well into the
Andrew> slab. This would be an intensely unpopular move. So you'd
Andrew> have to ifdef it. Which makes it an ia64-only problem,
Andrew> which greatly improves your merge chances ;)
For 2.4, I suspect I need to keep this in the ia64 patch anyhow
because it is also necessary to fix scsi_dma.c so it can deal with
allocation bitmaps that are bigger than 32 bits.
I believe ia64 is currently the only platform that supports 64KB
pages. If so, there is probably not much point trying to get this
past Marcelo (and the patch is large enough to have the potential for
introducing new bugs). If another platform cares about this, please
speak up.
>> - does anyone know of any other code paths where the block size
>> is assumed to fit into 16 bits?
Andrew> Not off the top, but they're probably there.
I'll keep an eye on it. It's working fine so far, but that doesn't
replace a code audit. If you happen to bump into something during
your normal work, please let me know.
Thanks,
--david
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-05-10 6:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-10 5:11 maximum block size in buffer_head David Mosberger
2002-05-10 5:38 ` Andrew Morton
2002-05-10 6:35 ` David Mosberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox