Skip to content

Commit 7632b7c

Browse files
committed
Correctly set the value of UVM_KMALLOC_THRESHOLD
1 parent 0de451b commit 7632b7c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

kernel-open/common/inc/nv-nanos.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,8 @@ typedef struct nvidia_event
507507
#define vmalloc(size) kmalloc(size, 0)
508508
#define vzalloc(size) kzalloc(size, 0)
509509
#define ksize(p) objcache_from_object(u64_from_pointer(p), PAGESIZE_2M)->pagesize
510-
#define is_vmalloc_addr(p) false
511-
#define vfree kfree
510+
#define is_vmalloc_addr(p) (objcache_from_object(u64_from_pointer(p), PAGESIZE_2M) == INVALID_ADDRESS)
511+
#define vfree NV_KFREE
512512

513513
static inline void *kmalloc(unsigned long size, int flags)
514514
{

kernel-open/nvidia-uvm/uvm_kvmalloc.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@
4141
//
4242
// This is in the header so callers can use it to inform their allocation sizes
4343
// if they wish.
44-
#define UVM_KMALLOC_THRESHOLD infinity
44+
//
45+
// Default value is 16. See: https://github.com/nanovms/nanos/blob/103518003874e7c8c3cb6e5a93d81fd0f197fde6/src/config.h#L84-L85
46+
#define UVM_KMALLOC_THRESHOLD 16
4547

4648
NV_STATUS uvm_kvmalloc_init(void);
4749
void uvm_kvmalloc_exit(void);

0 commit comments

Comments
 (0)