--
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/6a4f8797-b56a-42be-81a7-81b659f68257%40googlegroups.com.
--
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/22bcdd3d-65c8-4da7-833d-ec6587d56f99%40googlegroups.com.
On Apr 10, 2020, at 3:42 PM, Piotr Balcer <pi...@balcer.eu> wrote:
Hi,We have benchmarks directory on our repo, it has several different types of benchmarks, including some focused on memory allocation performance.Each heap has only one avl tree (which is protected under a lock) that contains free memory 'chunks'. Each time a thread wants to allocate an object, it first needs to acquire a 'chunk', possibly from the avl tree, subdivide it into smaller 'units', and then return one of more 'unit' to the caller - the rest of the units are placed in the thread's arena for later reuse.This scales well for small sizes, because each time the avl tree is accessed the threads acquires many allocatable units. But for larger allocations the number of those units is smaller, and huge allocations are handled directly from the avl tree.This is done to maximize the amount of memory available in the global heap so that it's accessible for all threads. It's a trade-off between scalability and fragmentation/usability.You can find more information about libpmemobj's allocator in our book (it's free).Piotr
pt., 10 kwi 2020, 21:26 użytkownik Abdullah Al Raqibul Islam <ais...@uncc.edu> napisał:
Compile your example with -fno-omit-frame-pointer and -g and if possible disable optimizations (-O0).I really recommend using FlameGraph [*] for visualization of perf traces.You may need to use the debug version of libpmemobj (the one in pmdk_debug dir) to see reliable stack traces.Marcin
pt., 10 kwi 2020 o 21:09 Karthik Velayutham <karthik....@gmail.com> napisał(a):
Thanks for getting back to me, Piotr!--I ran the workload under perf and this is the results I am getting, which surprised me:As you can see, the majority of the time is spent on the method clht_put, which just acquires a lock to the bucket being modified and then proceeds to insert values . In fact, the performance doesn't seem to be bottlenecked by the resizing allocations at all, at least according to this profiler. Based on the information you have given, I now suspect that the issue comes up when each thread attempts to allocate a new object in persistent memory (which would probably be serialized.) Do you know how I could use "perf" to profile a specific method that I call in clht_put? It doesn't seem to be showing up in the results and I suspect that either the overhead was insignificant or it just was missed by "perf" possibly.Thanks!On Friday, 10 April 2020 01:17:56 UTC-5, Piotr Balcer wrote:Hi,There are some scenarios in which the memory allocator will show increased average latency for operations. The one easiest to encounter is near OOM operation, where the allocator has to scour the entire heap looking for free memory that might simply not be available. Since you mention large allocations, the other possibility is high thread contention on the global heap - the larger the object, the more frequently the global heap lock has to be acquired, and after a threshold (~2 megabytes), all allocations will be performed under a lock.I recommend running your workload under perf and sharing your findings with us - you could also just send us a flamegraph (https://github.com/brendangregg/FlameGraph), which would make it easy to pinpoint the problem.Piotr
W dniu piątek, 10 kwietnia 2020 04:20:02 UTC+2 użytkownik Karthik Velayutham napisał:Hi all,I'm working on a project that involves the use of a hashtable that is allocated in persistent memory. During the load phase of inserting thousands of keys, the hashtable has to be resized and buckets have to be allocated as well. I noticed pmemobj_alloc() is surprisingly slow at the rate of just 3103 operations/second, which was surprising to me. I suspect that my usage of libpmemobj may be incorrect, and I was wondering if anyone had any insights to what could be causing the slow performance.For some additional details, I have followed the proper initialization semantics as much as I can. I have laid out the memory pool properly, initialized the root, etc. I am emulating persistent memory by using a ext4-DAX mount, so there is no actual persistent memory being used as of now. I'm just unsure if PMDK is perhaps not scaling with larger allocations or my use case of the function is simply incorrect e.g.:if (pmemobj_alloc(pop, &table_oid, num_buckets * sizeof(bucket_t), TOID_TYPE_NUM(bucket_t), 0, 0)) {fprintf(stderr, "pmemobj_alloc failed for table_oid in clht_hashtable_create\n");assert(0);}Is it possible I should use another PMDK allocator? Any insights would be much appreciated. I can provide further details if needed.Thanks!
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.

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/5b75b25f-394b-4106-a165-6245a4528719%40googlegroups.com.
Kernels before 4.15 do not support MAP_SYNC flag, which pmdk uses to detect whether it's safe to flush from userspace.If it's just for testing purposes, you can use PMEM_IS_PMEM_FORCE=1 environment variable to override this detection,but if you want your data to be safe you need a newer kernel.Marcin
To view this discussion on the web visit https://groups.google.com/d/msgid/pmem/5b75b25f-394b-4106-a165-6245a4528719%40googlegroups.com.
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/a79e22ff-40eb-4d38-8cb3-b12e0a13e8d8%40googlegroups.com.
Like Marcin said, kernels prior to 4.15 did not support MAP_SYNC, which is necessary for safe user space flushing. Without this feature, libpmemobj falls back to calling msync on every flush - which is why you saw degraded performance.
To view this discussion on the web visit https://groups.google.com/d/msgid/pmem/a79e22ff-40eb-4d38-8cb3-b12e0a13e8d8%40googlegroups.com.