Hugetables question - Mailing list pgsql-hackers

From Radosław Smogura
Subject Hugetables question
Date
Msg-id 201106191156.15487.rsmogura@softperience.eu
Whole thread Raw
Responses Re: Hugetables question
Re: Hugetables question
List pgsql-hackers
I want to implement hugepages for shared memory, to make it transparent I want 
to do in this fashion:
1. Reserve memory M of size s
2. Try to allocate hugepage memory of as big size as possible (hs), attach at 
M.
3. Allocate normal shared memory of size hs - s, and attach it at M+hs.
This soulution should work for Linux and Windows, and make no difference for 
usage of such shared memory in application.

(...and this actually works)

But in sysv_shmem i saw some checking for memory belonging to other (probably 
failed) processes, because I can't put new header in step 3, i would like to 
ask if will be suefficient to:
1. Check creator pid by shmctl.
2. Remove checking of shmem magic
3. Or maybe instead of this better will be to split shared memory, header will 
be stored under one key and it will contain keys to other individually 
allocated blocks?

Ofocourse moving to POSIX may be much more better, but according to commit 
feast thread it may be impossible.

Maybe some other ideas.

Regards,
Radek


pgsql-hackers by date:

Previous
From: Florian Pflug
Date:
Subject: Re: Range Types and extensions
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Hugetables question