Bug 395841 - hugetlbfs not showing filenames in /dev/shm
Summary: hugetlbfs not showing filenames in /dev/shm
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel
Version: 5.1
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Josef Bacik
QA Contact: Martin Jenner
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-11-22 16:43 UTC by Nick Strugnell
Modified: 2008-01-02 20:47 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-01-02 20:47:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Nick Strugnell 2007-11-22 16:43:13 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)

Description of problem:
If I mount hugetlbfs at /dev/shm, rather than the default tmpfs, the filenames of shared memory segments are no longer listed in /dev/shm

Version-Release number of selected component (if applicable):
kernel-2.6.18-8.1.0.el5

How reproducible:
Always


Steps to Reproduce:
1. mount hugetlbfs at /dev/shm e.g. sysctl vm.nr_hugepages=3000 ; umount /dev/shm ; mount -t hugetlbfs /dev/shm -o size=6G
2. Run a program that allocated shared memory with shm_open(), e.g.  http://mij.oltrelinux.com/devel/unixprg/srcs/ipc__shm/1/shm_msgserver.c
3. ls /dev/shm
4. Run a program to read the shared memory e.g. http://mij.oltrelinux.com/devel/unixprg/srcs/ipc__shm/1/shm_msgclient.c 

Actual Results:
ls /dev/shm returns nothing, even though the programs work and shared memory is clearly being allocated.

Expected Results:
ls /dev/shm should return the name associated with the shm descriptor.

Additional info:

Comment 2 Josef Bacik 2008-01-02 20:47:54 UTC
hugetlbfs is only used as a method to allow non-super user users to allocate hugepages.  If 
you mount a hugetlbfs fs, that user can allocate hugepages using mmap on that fs.  If you 
look at Documentation/vm/hugetlbpage.txt you will see this.  It is not meant as a different 
way to mount /dev/shm.  This isn't a bug, closing.


Note You need to log in before you can comment on or make changes to this bug.