From nobody Sun Feb 8 11:59:24 2026 Received: from outbound.baidu.com (mx24.baidu.com [111.206.215.185]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C1EC34D3BB for ; Thu, 5 Feb 2026 06:12:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=111.206.215.185 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770271947; cv=none; b=CwhlzKapJ9DB5Ygnh5SHAgQDC7CwTScgnRIfetMeipASqNG1q/MvUOjb1Vf2lq5+74MFlr2oeh8YMcqjsdBGE4yIwkfiSmqlpuYwVgWaVrzPB2C/RZRCzXzFf3+9USwCoaK2BhbNt2ZJcAajN9IYPYwn0AiRlraAAQUJWufU5SE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770271947; c=relaxed/simple; bh=qLlSk4jrWMDSo61nQufqN59pzS6ZTouScPCXY18T6WY=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=jcDq1xnTFzT3cN4ghB6sh28L15L12hlQBcaD2uI/DkB4E5ioD+3fr1WqdcfKdss4ub1r/0Puf19Dv7blmFKz9rKyM56lGup5Jj6Ky27RvUAI0BEI/gCKnwlgKFh4b4xDGGPpkRoUszM+L/liytdE+H60Z4HIYTbuxEVXr2j/LUg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=baidu.com; spf=pass smtp.mailfrom=baidu.com; arc=none smtp.client-ip=111.206.215.185 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=baidu.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baidu.com From: lirongqing To: Dave Airlie , Gerd Hoffmann , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , , , , CC: Li RongQing Subject: [PATCH] drm/qxl: optimize idr_preload allocation flags Date: Thu, 5 Feb 2026 01:09:06 -0500 Message-ID: <20260205060906.4059-1-lirongqing@baidu.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: bjhj-exc7.internal.baidu.com (172.31.3.17) To bjkjy-exc3.internal.baidu.com (172.31.50.47) X-FEAS-Client-IP: 172.31.50.47 X-FE-Policy-ID: 52:10:53:SYSTEM Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Li RongQing 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 --- 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 =3D idr_alloc(&qdev->surf_id_idr, NULL, 1, 0, GFP_NOWAIT); spin_unlock(&qdev->surf_id_idr_lock); --=20 2.9.4