question about memory object allocation

22 views
Skip to first unread message

Awais khan

unread,
Jan 27, 2020, 9:18:52 PM1/27/20
to pmem
Hi,

I am a beginner to PMDK and wants to investigate some low-level details about PMDK espc. libpmemobj. I have a few quick questions and will appreciate if anyone can respond.

1. When you call pmalloc(); what does PMDK library do for it. where will the memory object be allocated on PM address space? Do you have to specify address of memory where the memory object is allocated?
2. Is there any role of OS memory management module when I am using PMDK.

Can anyone point me to some materials where i can find answers to these questions.

Thanks in advance.

Regards,
Awais Khan

Awais khan

unread,
Jan 27, 2020, 10:16:38 PM1/27/20
to pmem, Piotr Balcer
Thank you for the quick response.

On Jan 28, 2020, at 11:29 AM, Piotr Balcer <pi...@balcer.eu> wrote:

Hi,
There's no one easy answer to you first question. Any memory allocator, libpmemobj included, will have multiple policies according to which memory addresses will be given out. 

Does this mean, there might be some policy which enables my application to specify the memory address to allocate objects in pm pool.


As for the second question, one of the unique things about our memory allocator is that it only relies on the kernel for the initial mapping of the pool. Once that's done, there are no additional syscalls made.

At every cost, I need to hit kernel for pool mappings? e.g., in case of pool resizing I need to touch kernel to modify?

Regards,
Awais Khan


You can find more information in chapter 16 of our book:  https://pmem.io/book/. It's free.

Piotr

--
You received this message because you are subscribed to the Google Groups "pmem" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pmem+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pmem/5CC2EFA1-8C43-4EF6-82D5-6B098771568B%40gmail.com.

Piotr Balcer

unread,
Jan 28, 2020, 6:01:28 PM1/28/20
to pmem


W dniu poniedziałek, 27 stycznia 2020 19:16:38 UTC-8 użytkownik Awais khan napisał:
Thank you for the quick response.

On Jan 28, 2020, at 11:29 AM, Piotr Balcer <pi...@balcer.eu> wrote:

Hi,
There's no one easy answer to you first question. Any memory allocator, libpmemobj included, will have multiple policies according to which memory addresses will be given out. 

Does this mean, there might be some policy which enables my application to specify the memory address to allocate objects in pm pool.

The policies I mentioned are implicit - the allocator ultimately controls where the objects are placed. If you want to manually manage object placement than what you really want is to implement your own allocator.
 


As for the second question, one of the unique things about our memory allocator is that it only relies on the kernel for the initial mapping of the pool. Once that's done, there are no additional syscalls made.

At every cost, I need to hit kernel for pool mappings? e.g., in case of pool resizing I need to touch kernel to modify?

Well, yes - the file system manages the file on which the pool is managed - you can't resize the file without kernel involvement.
 

Regards,
Awais Khan


You can find more information in chapter 16 of our book:  https://pmem.io/book/. It's free.

Piotr

pon., 27 sty 2020, 18:18 użytkownik Awais khan <awaisk...@gmail.com> napisał:
Hi,

I am a beginner to PMDK and wants to investigate some low-level details about PMDK espc. libpmemobj. I have a few quick questions and will appreciate if anyone can respond.

1. When you call pmalloc(); what does PMDK library do for it. where will the memory object be allocated on PM address space? Do you have to specify address of memory where the memory object is allocated?
2. Is there any role of OS memory management module when I am using PMDK.

Can anyone point me to some materials where i can find answers to these questions.

Thanks in advance.

Regards,
Awais Khan

--
You received this message because you are subscribed to the Google Groups "pmem" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pm...@googlegroups.com.

Awais khan

unread,
Jan 28, 2020, 9:42:26 PM1/28/20
to Piotr Balcer, pmem
Thank you so much. I appreciate the quick response.

Regards,
Awais Khan


> On Jan 29, 2020, at 8:01 AM, Piotr Balcer <ppbb...@gmail.com> wrote:
>
>

Reply all
Reply to author
Forward
0 new messages