From: Kevin Buhr <buhr@telus.net>
To: Rob Landley <landley@trommello.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Alright, I give up. What does the "i" in "inode" stand for?
Date: 19 Jul 2002 19:20:28 -0700 [thread overview]
Message-ID: <87eldzjg2b.fsf@saurus.asaurus.invalid> (raw)
In-Reply-To: <fa.m2aun2v.khulp2@ifi.uio.no>
Rob Landley <landley@trommello.org> writes:
>
> I've been sitting on this question for years, hoping I'd come across the
> answer, and I STILL don't know what the "i" is short for. Somebody here has
> got to know this. :)
Boy, how newbie can you get? Fortunately, you've got lots of people
setting you straight, and they've given you all those different
answers to choose from! ;)
> Another question I'm unclear about is "does every userspace-visible memory
> allocation have an inode"? Loaded programs are basically mmaped files, and
> shared memory is now its own filesystem out of which you mmap stuff. But I
> don't know about a process's stack and heap.
I'd say a mapping "has an inode" if its associated "vm_area_struct"
has a non-NULL "->vm_file" (in which case the inode number is stored
in "->vm_file->f_dentry->d_inode->i_ino"). By this standard, it's
pretty easy to see what parts of a process's address space have an
inode. Just "cat /proc/nnn/maps". Each map line will have an inode
number in the fifth column or zero if there's no associated inode.
In general, executable text (including shared libraries) and other
pages mmapped from real files have inodes. Pages mmapped anonymously
don't---if they're private---or do---if they're shared. In the latter
case, they have a nameless (i.e., unlinked) inode in the shmfs though
its name shows up as "/dev/zero" in "/proc/nnn/maps". Both System V
and POSIX shared memory have inodes in shmfs, I believe. Pages
allocated with brk/sbrk (including heap for C programs) don't have an
inode.
Mmapping "/dev/zero" is a special case. Private (or read-only) maps
of "/dev/zero" will be associated with "/dev/zero"'s inode. Make a
shared, writable map of "/dev/zero", and it acts like a shared
anonymous page: it's associated with an unlinked inode in shmfs, but
its name shows up as "/dev/zero" in "/proc/nnn/maps".
Mmapping other devices could do anything... By default, the maps stay
associated with the device inode but could be changed by the device
code at its whim.
> Then earlier today I wander across kerneltrap's interview with Larry McVoy,
> who espouses the viewpoint that Linux VM design should store statistics in
> inodes rather than worrying so much about individual pages, and I get
> confused again.
Well, if I recall correclty, Larry made it clear in that interview
that he wasn't 100% sure how the Linux MM was doing things right now,
and he certainly wasn't claiming his scheme would plug right in. If
his scheme were to be adopted, presumably we would want to introduce
inodes associated with private, anonymous pages (including brk/sbrk
pages).
--
Kevin Buhr <buhr@telus.net>
next parent reply other threads:[~2002-07-20 2:17 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <fa.m2aun2v.khulp2@ifi.uio.no>
2002-07-20 2:20 ` Kevin Buhr [this message]
2002-07-30 20:58 Alright, I give up. What does the "i" in "inode" stand for? Jesse Pollard
-- strict thread matches above, loose matches on Subject: below --
2002-07-25 13:54 Jesse Pollard
2002-07-20 2:51 Kevin Puetz
2002-07-19 13:32 Jesse Pollard
2002-07-30 20:07 ` Mark H. Wood
2002-07-19 13:21 Nicholas Berry
2002-07-19 5:08 Mohamed Ghouse , Gurgaon
2002-07-18 22:33 Rob Landley
2002-07-19 4:38 ` Kelledin
2002-07-19 4:38 ` Larry McVoy
2002-07-19 4:45 ` CaT
2002-07-18 23:34 ` Rob Landley
2002-07-19 5:40 ` Thunder from the hill
2002-07-19 0:21 ` Rob Landley
2002-07-19 12:38 ` Kelledin
2002-07-19 13:09 ` Ryan Cumming
2002-07-19 7:00 ` dalecki
2002-07-19 19:58 ` Måns Rullgård
2002-07-19 20:17 ` Cort Dougan
2002-07-20 1:06 ` Kelsey Hudson
2002-07-19 14:20 ` yodaiken
2002-07-20 14:22 ` Georg Nikodym
2002-07-20 14:31 ` yodaiken
2002-07-22 13:10 ` Jesse Pollard
2002-07-20 6:01 ` John Kacur
2002-07-19 4:52 ` Albert D. Cahalan
2002-07-22 22:23 ` Joe DiMartino
2002-07-22 22:49 ` Hiten Pandya
2002-07-25 0:24 ` Daniel Mose
2002-07-25 1:16 ` Andrew Rodland
2002-07-25 2:43 ` jw schultz
2002-07-25 3:18 ` Christian Lavoie
2002-07-25 5:30 ` Ross Vandegrift
2002-07-25 11:08 ` Alan Cox
2002-07-25 6:03 ` Thunder from the hill
2002-07-26 8:24 ` jbradford
2002-07-28 9:01 ` Thunder from the hill
2002-08-04 15:11 ` Gert Menke
2002-07-26 12:54 ` Rob Landley
2002-07-25 18:06 ` Kevin Buhr
2002-07-26 23:39 ` Daniel Mose
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=87eldzjg2b.fsf@saurus.asaurus.invalid \
--to=buhr@telus.net \
--cc=landley@trommello.org \
--cc=linux-kernel@vger.kernel.org \
/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