Whamcloud - gitweb
LU-16609 target: top_trans_create cannot alloc memory
authorAndrew Perepechko <andrew.perepechko@hpe.com>
Tue, 10 Jan 2023 21:53:38 +0000 (16:53 -0500)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 9 Nov 2023 08:43:02 +0000 (08:43 +0000)
top_trans_create() requests __GFP_IO memory allocation,
which does not allow direct reclaim. However, if the
memory shortage is temporary, direct reclaim is reasonable.
GFP_NOFS is __GFP_IO with additional reclaim bits.

Lustre-change: https://review.whamcloud.com/50176
Lustre-commit: 9d1f8f1e3557ee3349c623f4f5596df44f60b082

Change-Id: I2c84d9d74188660063c948573780745a2b59a688
Signed-off-by: Andrew Perepechko <andrew.perepechko@hpe.com>
HPE-bug-id: LUS-11293
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alexey Lyashkov <alexey.lyashkov@hpe.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53031
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Andreas Dilger <adilger@whamcloud.com>
lustre/target/update_trans.c

index c8dae80..900cda1 100644 (file)
@@ -592,7 +592,7 @@ top_trans_create(const struct lu_env *env, struct dt_device *master_dev)
        struct top_thandle      *top_th;
        struct thandle          *child_th;
 
-       OBD_ALLOC_GFP(top_th, sizeof(*top_th), __GFP_IO);
+       OBD_ALLOC_GFP(top_th, sizeof(*top_th), GFP_NOFS);
        if (top_th == NULL)
                return ERR_PTR(-ENOMEM);