1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
7 #include "xfs_message.h"
11 kmem_alloc(size_t size, xfs_km_flags_t flags)
14 gfp_t lflags = kmem_flags_convert(flags);
17 trace_kmem_alloc(size, flags, _RET_IP_);
20 ptr = kmalloc(size, lflags);
21 if (ptr || (flags & KM_MAYFAIL))
23 if (!(++retries % 100))
25 "%s(%u) possible memory allocation deadlock size %u in %s (mode:0x%x)",
26 current->comm, current->pid,
27 (unsigned int)size, __func__, lflags);
28 memalloc_retry_wait(lflags);