+CC btrfs
On 4/1/21 12:51 PM, Wang Yugui wrote:
> Hi,
>
> an unexpected -ENOMEM from percpu_counter_init() happened when xfstest
> with kernel 5.11.10 and 5.10.27
Is there a dmesg log showing allocation failure or something?
> direct caller:
> int btrfs_drew_lock_init(struct btrfs_drew_lock *lock)
> {
> int ret;
>
> ret = percpu_counter_init(&lock->writers, 0, GFP_KERNEL);
> if (ret)
> return ret;
>
> atomic_set(&lock->readers, 0);
> init_waitqueue_head(&lock->pending_readers);
> init_waitqueue_head(&lock->pending_writers);
>
> return 0;
> }
>
> upper caller:
> nofs_flag = memalloc_nofs_save();
> ret = btrfs_drew_lock_init(&root->snapshot_lock);
> memalloc_nofs_restore(nofs_flag);
> if (ret == -ENOMEM) printk("ENOMEM btrfs_drew_lock_init\n");
> if (ret)
> goto fail;
>
> The hardware of this server:
> CPU: Xeon(R) CPU E5-2660 v2(10 core) *2
> memory: 192G, no swap
>
> Only one xfstests job is running in this server, and about 7% of memory
> is used.
>
> Any advice please.
>
> Best Regards
> Wang Yugui ([email protected])
> 2021/04/01
>
>