mirror of
https://github.com/torvalds/linux.git
synced 2026-06-02 19:43:40 +02:00
bcachefs: bch2_kvmalloc() mem alloc profiling
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
bcaea61adc
commit
c9b5d9cd26
|
|
@ -55,15 +55,16 @@ static inline size_t buf_pages(void *p, size_t len)
|
|||
PAGE_SIZE);
|
||||
}
|
||||
|
||||
static inline void *bch2_kvmalloc(size_t n, gfp_t flags)
|
||||
static inline void *bch2_kvmalloc_noprof(size_t n, gfp_t flags)
|
||||
{
|
||||
void *p = unlikely(n >= INT_MAX)
|
||||
? vmalloc(n)
|
||||
: kvmalloc(n, flags & ~__GFP_ZERO);
|
||||
? vmalloc_noprof(n)
|
||||
: kvmalloc_noprof(n, flags & ~__GFP_ZERO);
|
||||
if (p && (flags & __GFP_ZERO))
|
||||
memset(p, 0, n);
|
||||
return p;
|
||||
}
|
||||
#define bch2_kvmalloc(...) alloc_hooks(bch2_kvmalloc_noprof(__VA_ARGS__))
|
||||
|
||||
#define init_heap(heap, _size, gfp) \
|
||||
({ \
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user