Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1923579rdb; Tue, 20 Feb 2024 10:58:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVjgqaDpD2XDd9VVnDNK5oaFXFfLtCcckmh7+K2siPF9R4HBJycQCs2zmJpNY4DivAo6pqHxgIFVNpzfg6EdvzS6Zp7zkp/f+xaoHAB1g== X-Google-Smtp-Source: AGHT+IFte/48Zy+3pudxVfpUjalUexBsQMghGWb4cdumefb5WgQR7ptJM5nVbhf0j+XUFQaf6OfE X-Received: by 2002:a17:902:d2c1:b0:1db:dd24:9945 with SMTP id n1-20020a170902d2c100b001dbdd249945mr8593220plc.14.1708455531822; Tue, 20 Feb 2024 10:58:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708455531; cv=pass; d=google.com; s=arc-20160816; b=LHxeO03//ExHTc7WXdYgIC1Eo2z2yOQoK204wa2wNHDwzSEIXKi2tYOr55rTSX5X3C vZKVLOOFk3xK7L6rxGGo/dRc7wIzjNeuM/YQjyB9BisxdqwPrp+y8832KVvD0WJ3WzhD 1iSK113Y66mOp8FOMIVDgD/V1soemv0c997BVzrRw5M2Yj2cPVQFaL2ItvQYU6D+ZFyA JGurTVZfjI/kkALNxqYVXlKT0/q2YJnHZHqx/QyiNI7ULBlnw78Y9JdmvU3QVQtcTFsX CQvEzxhj0iINIgzcEpS09fTIi4VUKgYd4Ch0szxNuLvdyuu1aAPJOAX/TLs7Za36uCwp 1gFg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=bhyTkozSilaOI3wTa7vDeTF3frYTM4nImhWGYnX59p0=; fh=7i+2UoiSOtc72ySJBzJFVnT5mqPYGnpeL+8mw91sPfQ=; b=inYmXjorfh0vC4ioz5iP3tok2Aqs7u3FKCxFSUs0v4Zje2XQlPHqYtJawvj+A6bwPx 8kD6itwgLZ4QZchu8wdT5EP42T44v1SLtjACDhIg/AJQBfBGCdWvqiSSkE0hlM1DKIXP St4kyyorM7pogT/Ltj0wN8LZ21D9ibQ6QLeFES9bD1DN5IU0L5rY/8U2JCbEha/x1v9Y 1YK4TKWCAd8BVsk7tWs6CvNXLT6HXcDw77OM2n2e79f7eBpwNxAy0ns8s2J2BB6qpZjO 6NGlw57XqKm5ul7keXndOcUPAkRrNouh6cyDD0rMjNBAwEt1zrnoMUPzCvnw6FKhAEj+ +Q4g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=EbicfXdI; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-kernel+bounces-73556-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73556-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id n18-20020a170902d2d200b001db5ee2a794si6705791plc.562.2024.02.20.10.58.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 10:58:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-73556-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=EbicfXdI; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-kernel+bounces-73556-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73556-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 84A46283026 for ; Tue, 20 Feb 2024 18:58:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 114C713473D; Tue, 20 Feb 2024 18:58:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="EbicfXdI" Received: from smtp.smtpout.orange.fr (smtp-17.smtpout.orange.fr [80.12.242.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A9A6763EB for ; Tue, 20 Feb 2024 18:58:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708455519; cv=none; b=mLg5EiOZa09F2o9xqTjkyyB8C7ZzAMSpQLe5dDWtLyYY0svcYO24nMxOyMKcRXJ7RBX/jj4Ml7XGXPIZM2qMn9oV7ai7L1xhSBVXp2sX8zqkw4ZaU0d+bUekE4eJt9sYWp/2C8wfdeYXfJsIiyanPNDPymzXMgUMp8vG9I6REQk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708455519; c=relaxed/simple; bh=8WzmXc4hkm/h23fftetZwBYuo4crh0kh/mv9qH7713g=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=gkyC2DoTxtZt0H4QZ6hbNBEgq5q+v8NEEPl3/fuXIvw5Do7tgc2l6/GkDct/bV++INDldu4SWsFNjERyW31IrI+mEkONYYsrU7rth0XnXb5yL3pVmRlRN0TmjdZQxjedOX2HtV+n5nxQpPSM0Stx4HAmqU6zKuPuCqsRU5/uWsM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=EbicfXdI; arc=none smtp.client-ip=80.12.242.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Received: from [192.168.1.18] ([92.140.202.140]) by smtp.orange.fr with ESMTPA id cVJ3rZRzMFu9DcVK5ruPxD; Tue, 20 Feb 2024 19:58:35 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1708455515; bh=bhyTkozSilaOI3wTa7vDeTF3frYTM4nImhWGYnX59p0=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=EbicfXdI+a3tOLKcNT4u8AXMI7rRi5z4CZFujYjmHCy5vrdHE5yv95ghh07lElXDp 2DxvgFn7gJyTUAYse4z9umzGRzh0h52oaUk9UDtgMaPotThmucxgjguOg/hHSNQP8R 50eV2NEjKcYEIHljl/V9JoyKWR8dp2Yijpst9X//fyaM465h9din2Mxll7QLkR1w2v 7fs5wltDKP5VyjfPV4r7wA5uoz095fplA5olLFzWtd10b+CNJUJOSuNGuII9Q9MgZp efneR4zRosgVOd4qCAdTs8LpdSjuS6TVEBv8EkRJa8RbA4/iwGq6Tv1x1ip46zqsP7 SE0UlUYX5ro1A== X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 20 Feb 2024 19:58:35 +0100 X-ME-IP: 92.140.202.140 Message-ID: <521e55d5-37e2-41b3-9ed7-0986d503087c@wanadoo.fr> Date: Tue, 20 Feb 2024 19:58:32 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] drm/xe/guc: Remove usage of the deprecated ida_simple_xx() API Content-Language: en-MW To: Lucas De Marchi , Oded Gabbay , =?UTF-8?Q?Thomas_Hellstr=C3=B6m?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org References: From: Christophe JAILLET In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 14/01/2024 à 16:09, Christophe JAILLET a écrit : > ida_alloc() and ida_free() should be preferred to the deprecated > ida_simple_get() and ida_simple_remove(). > > Note that the upper limit of ida_simple_get() is exclusive, but the one of > ida_alloc_max() is inclusive. So a -1 has been added when needed. > > Signed-off-by: Christophe JAILLET > --- > drivers/gpu/drm/xe/xe_guc_submit.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c > index 21ac68e3246f..11ffacd1dd58 100644 > --- a/drivers/gpu/drm/xe/xe_guc_submit.c > +++ b/drivers/gpu/drm/xe/xe_guc_submit.c > @@ -311,7 +311,7 @@ static void __release_guc_id(struct xe_guc *guc, struct xe_exec_queue *q, u32 xa > q->guc->id - GUC_ID_START_MLRC, > order_base_2(q->width)); > else > - ida_simple_remove(&guc->submission_state.guc_ids, q->guc->id); > + ida_free(&guc->submission_state.guc_ids, q->guc->id); > } > > static int alloc_guc_id(struct xe_guc *guc, struct xe_exec_queue *q) > @@ -335,8 +335,8 @@ static int alloc_guc_id(struct xe_guc *guc, struct xe_exec_queue *q) > ret = bitmap_find_free_region(bitmap, GUC_ID_NUMBER_MLRC, > order_base_2(q->width)); > } else { > - ret = ida_simple_get(&guc->submission_state.guc_ids, 0, > - GUC_ID_NUMBER_SLRC, GFP_NOWAIT); > + ret = ida_alloc_max(&guc->submission_state.guc_ids, > + GUC_ID_NUMBER_SLRC - 1, GFP_NOWAIT); > } > if (ret < 0) > return ret; Hi, gentle reminder. All patches to remove the ida_simple API have been sent. And Matthew Wilcox seems happy with the on going work. (see [1]) Based on next-20240220 $git grep ida_simple_get | wc -l 36 https://elixir.bootlin.com/linux/v6.8-rc3/A/ident/ida_simple_get 50 https://elixir.bootlin.com/linux/v6.7.4/A/ident/ida_simple_get 81 Thanks CJ [1]: https://lore.kernel.org/all/ZaqruGVz734zjxrZ@casper.infradead.org/