From: Andrew Morton <akpm@osdl.org>
To: "Takashi Sato" <sho@tnes.nec.co.jp>
Cc: torvalds@osdl.org, viro@zeniv.linux.org.uk,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
trond.myklebust@fys.uio.no
Subject: Re: [PATCH 2/3] Fix problems on multi-TB filesystem and file
Date: Fri, 13 Jan 2006 12:28:20 -0800 [thread overview]
Message-ID: <20060113122820.18b751b0.akpm@osdl.org> (raw)
In-Reply-To: <000101c61848$4dd3b5b0$4168010a@bsd.tnes.nec.co.jp>
"Takashi Sato" <sho@tnes.nec.co.jp> wrote:
>
> > > This is a patch to add blkcnt_t as the type of inode.i_blocks.
> > > This enables you to make the size of blkcnt_t either 4 bytes or 8 bytes
> > > on 32 bits architecture with CONFIG_LSF.
> >
> > What was the rationale behind CONFIG_LSF? It's a bit of an ugly thing and
> > I'm wondering if we wouldn't be better off just removing it and simply
> > fixing >2TB support for all .configs?
>
> We should avoid needless growth of heavily-used structure such as
> inode for a small system like embedded system.
> So I make it possible to configure the size of i_blocks with CONFIG_LSF.
Variables whose size varies according to Kconfig are surprisingly expensive
with respect to maintenence cost and runtime stability risk. The main
offended is sector_t.
I am forever fixing people's code which does
printk("%ld", some_sector_t);
With CONFIG_LBD=n that's fine. With CONFIG_LBD=y it generates a warning.
The consequences of that warning are:
a) It'll probably print a garbage number
b) If the printk did
printk("%d %s", some_sector_t, some_string);
then printk might well oops the kernel, because `some_string' will be
passed in either the wrong register or in the wrong stack slot.
And because printks are almost always in rare error paths, such an
oops will probably sail through everyone's kernel testing and will only
hit users when rare things like I/O errors or disk corruption occur.
The best fix for the printk(sector_t) problem is
printk("%llu", (unsigned long long)some_sector_t);
All other solutions have subtle problems.
So now we're proposing to repeat the sector_t problem with a bunch of new
fields. Fortunately we're less likely to be putting these particular
fields into printk statements but I note that CIFS (at least) has a couple
such statements and with your patch they're now generating warnings (and
potential runtime bugs).
On the other hand, for a fairly fat .config which has 17 filesystems in
.vmlinux:
text data bss dec hex filename
4633032 1011304 248288 5892624 59ea10 vmlinux CONFIG_LSF=y
4633680 1011304 248288 5893272 59ec98 vmlinux CONFIG_LSF=n
It's probably less 0.5 kbytes for usual embedded .config.
I just don't think the benefit of CONFIG_LSF outweighs its costs.
next prev parent reply other threads:[~2006-01-13 20:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-05 10:04 [PATCH 2/3] Fix problems on multi-TB filesystem and file Takashi Sato
2006-01-13 2:33 ` Andrew Morton
2006-01-13 13:50 ` Takashi Sato
2006-01-13 20:28 ` Andrew Morton [this message]
2006-01-13 20:51 ` Andreas Dilger
2006-01-13 21:19 ` Andrew Morton
2006-01-18 12:54 ` Takashi Sato
2006-01-18 21:22 ` Trond Myklebust
-- strict thread matches above, loose matches on Subject: below --
2005-12-16 13:10 Takashi Sato
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=20060113122820.18b751b0.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sho@tnes.nec.co.jp \
--cc=torvalds@osdl.org \
--cc=trond.myklebust@fys.uio.no \
--cc=viro@zeniv.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).