[PATCH] drm/qxl: optimize idr_preload allocation flags

lirongqing posted 1 patch 2 days, 4 hours ago
drivers/gpu/drm/qxl/qxl_cmd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] drm/qxl: optimize idr_preload allocation flags
Posted by lirongqing 2 days, 4 hours ago
From: Li RongQing <lirongqing@baidu.com>

idr_preload() is called in a sleepable context before acquiring a
spinlock. Change the allocation flag from GFP_ATOMIC to GFP_KERNEL
to allow direct reclaim and improve allocation success rate under
memory pressure.

Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
 drivers/gpu/drm/qxl/qxl_cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/qxl/qxl_cmd.c b/drivers/gpu/drm/qxl/qxl_cmd.c
index 2e3200d..dd61d2a 100644
--- a/drivers/gpu/drm/qxl/qxl_cmd.c
+++ b/drivers/gpu/drm/qxl/qxl_cmd.c
@@ -423,7 +423,7 @@ int qxl_surface_id_alloc(struct qxl_device *qdev,
 	uint32_t handle;
 	int idr_ret;
 again:
-	idr_preload(GFP_ATOMIC);
+	idr_preload(GFP_KERNEL);
 	spin_lock(&qdev->surf_id_idr_lock);
 	idr_ret = idr_alloc(&qdev->surf_id_idr, NULL, 1, 0, GFP_NOWAIT);
 	spin_unlock(&qdev->surf_id_idr_lock);
-- 
2.9.4