Bug 395841 - hugetlbfs not showing filenames in /dev/shm
Summary: hugetlbfs not showing filenames in /dev/shm
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel   
(Show other bugs)
Version: 5.1
Hardware: i686
OS: Linux
Target Milestone: ---
: ---
Assignee: Josef Bacik
QA Contact: Martin Jenner
Depends On:
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:
Story Points: ---
Clone Of:
Last Closed: 2008-01-02 20:47:54 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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):

How reproducible:

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.