- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- MMAP failures
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-27-2006 06:40 PM
тАО08-27-2006 06:40 PM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-28-2006 11:23 PM
тАО08-28-2006 11:23 PM
Re: MMAP failures
is this a repeat of your previous posting ?
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1037936
Same application, or has something changed?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-29-2006 01:22 AM
тАО08-29-2006 01:22 AM
Re: MMAP failures
Its different application. I tried tunning kernel parameter also. I reduced maxdsiz parameter. I increased maxssiz & maxtsiz parameter. But still I get error during mapping. I am attaching code with this thread.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-29-2006 05:04 AM
тАО08-29-2006 05:04 AM
SolutionYou're using MAP_SHARED -- so these go in the Shared quadrant(s).
First question -- why? If you're only reading data, you don't need your changes to be preserved to the file itself (a big reason not to use MAP_PRIVATE) and if your model is only MT via pthreads, all the threads can see the mmap segment anyway. [Which also begs the question... if this is the same file why not just mmap() it *once* in the first place, MAP_PRIVATE and let all the child threads read using that pointer? If these are multiple different files, then multiple mmaps makes sense... you just aren't clear above]. If only one thread needs to keep track of a mapping at a time (i.e. thread maps file X, reads, unmaps X) then MAP_PRIVATE is more than sufficient.
Setting all that aside -- if you in fact need MAP_SHARED, then you're likely running into virtual address space exhaustion in the shared quadrants. You're on PA, so using defaults, you have 1.75Gb of shared address space shared among every process on the system (64-bit shares this plus additional space, 32-bit is limited to only this). Each mapping will take a system page size of that sysconf(_SC_PAGE_SIZE), so with the stock 4k that gives 458,752 maximum possible mmaps extant at any given time.
However, shared libraries and other shared objects will be sitting in that space. (Search the forums for shminfo -- there's a leaked URL). If you must stay with MAP_SHARED and can't handle exhaustion... [and might I add, if you want to do anything else with your system while this runs... because when you exhaust the Global shared virtual address space, you're going to fail on every other app trying to make an object there... which will likely be an application or command you care about], I'd look into using Memory Windows to isolate your process into a separate shared address space (at least for Q3).
Again -- I'm unclear on why you need MAP_SHARED in the first place and think you'd be better off using MAP_PRIVATE (and likely some linker flags... you should link with both text and data in the first quadrant (I believe that's EXEC_MAGIC) and you may need to go with Q3 private to give yourself enough private address space.
Even better -- go 64-bit and get 4Tb (minus maxssiz_64bit) to work with. Thats your best bet.
Alternately, your algorithm could handle resource exhaustion cleanly and have the threads pause and then retry (to give time for other threads to release address space) or fail cleanly. In any event, I highly recommend you rethink exhausting the global shared address space.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-29-2006 05:08 AM
тАО08-29-2006 05:08 AM
Re: MMAP failures
If the filename stuff is accurate though -- then you are mmap'ing the same file... and again, I have to ask "Why?" Are you just trying to benchmark mmap/munmap or something? All of your threads can see a mmap in the process address space anyway (that's why you're using threads, not multiple processes!)...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-29-2006 05:50 PM
тАО08-29-2006 05:50 PM
Re: MMAP failures
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-30-2006 07:34 AM
тАО08-30-2006 07:34 AM
Re: MMAP failures
On HP-UX current releases, mmap() of the same file to the same address in the same process (shared, private or otherwise) will *always* fail with ENOMEM. [Except for MAP_IO, which supports 'nested' mmap]. What you want to make this model work is MPAS [11.23 and higher, IPF only... PA doesn't do this because the hardware won't support it] where each mapping request will actually generate a new unique mapping. There's no way to do things in this fashion on 11.11.
I would think if you keep a central table indexed by file descriptor so you can check if each thread is already mapped, and keep a hold count [and probably a per-fd lock if you want to synchronize...] such that only when the hold count drops to 0 you do the unmap and conversely, the first holder does the mapping you'll be ok. You have to have someplace to do the fd --> mapping address translation in any event.