1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
7 #include <linux/backing-dev.h>
8 #include "xfs_message.h"
12 kmem_alloc(size_t size, xfs_km_flags_t flags)
15 gfp_t lflags = kmem_flags_convert(flags);
18 trace_kmem_alloc(size, flags, _RET_IP_);
21 ptr = kmalloc(size, lflags);
22 if (ptr || (flags & KM_MAYFAIL))
24 if (!(++retries % 100))
26 "%s(%u) possible memory allocation deadlock size %u in %s (mode:0x%x)",
27 current->comm, current->pid,
28 (unsigned int)size, __func__, lflags);
29 congestion_wait(BLK_RW_ASYNC, HZ/50);