From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PATCH 1/2] drm: make idr_mutex a spinlock Date: Fri, 29 Aug 2014 15:17:30 +0200 Message-ID: <20140829131729.GV17519@ulmo> References: <1409313661-20696-1-git-send-email-dh.herrmann@gmail.com> <20140829131002.GU17519@ulmo> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1904258056==" Return-path: Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) by gabe.freedesktop.org (Postfix) with ESMTP id B5A786E6E9 for ; Fri, 29 Aug 2014 06:17:34 -0700 (PDT) Received: by mail-wg0-f52.google.com with SMTP id m15so2109051wgh.23 for ; Fri, 29 Aug 2014 06:17:32 -0700 (PDT) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: David Herrmann Cc: Daniel Vetter , "dri-devel@lists.freedesktop.org" List-Id: dri-devel@lists.freedesktop.org --===============1904258056== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="t4k3FX2BKM3OLyzG" Content-Disposition: inline --t4k3FX2BKM3OLyzG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 29, 2014 at 03:11:19PM +0200, David Herrmann wrote: > Hi >=20 > On Fri, Aug 29, 2014 at 3:10 PM, Thierry Reding > wrote: > > On Fri, Aug 29, 2014 at 02:01:00PM +0200, David Herrmann wrote: > >> There is no reason to use a heavy mutex for idr protection. Use a spin= lock > >> and make idr-allocation use idr_preload(). > >> > >> This patch also makes mode-object lookup irq-save, in case you ever wa= nna > >> lookup modeset objects from interrupts. This is just a side-effect of > >> avoiding a mutex. > > > > I don't think that's entirely accurate. idr_preload(GFP_KERNEL) might > > sleep since GFP_KERNEL & __GFP_WAIT !=3D 0. >=20 > idr_preload() is only used in registration, not in lookups. Not sure > what you refer to? Yes, you're right. I wasn't paying close enough attention and somehow applied "makes irq-safe" to the "idr_preload()" change without relating it to "lookup". Thierry --t4k3FX2BKM3OLyzG Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUAH1pAAoJEN0jrNd/PrOhMLgP/A8vOQ++a8WPDS/ogKvQWulb kojUcdlNSwlV+hYlRfkEIQ7HJusRnH2cECFhf0b7SXIsZ+n/3P3T3akXkVi02dfQ HtGRw46jJ0KFNPXMBp8wsCs7Bir0KxIyPtGgQbADYeOESsism4YO/hf9LpGYAFZQ TvrUDiy5pvHNFbmLeA/WrbfDKmjNEbnO6IGj8kPT4f5t4UHBcwGOzR5o3i5hWknI mjxrSycNamMmHsVhNcbRDk17tlgJQiXzwek+iDrjSsWrdi2mJ9MCr1C0G2PILXzW HKjFAEY9UNtzNdhPqWVQqDVLT2NXgyxS1XTcpoqYp2ZAHqkyE088pLzFoJ8/rxA3 M6Pd4uiVOiohgbpKOjQQoUMwqoylDxXvRyJX8ZiNsN8XghdcWxJ8Pe+byruVeUN3 4/u5SPl+6ZvEBz+wmWPnZW8fuU+ZwxfJlh9KrykZPDaF6d1eTbYdKsLrPVqGXwcI r0oETRrjojcudEajD0dlAfae2vWkEuxbenDoBmWTQeSkJTcVTyGUaZp1x6YSnn7O yM0J7akOzLfrPQUa8VzwrgHxE6Q/iswfvxBJANfydUotlsObKTGWY/+7JhgiJadq vNo2Jmfk1NC7WdoXxvZ9HtzlHQM3507/0exWBM8MyyPOXygFbVy+YMkWV7vmgb81 wV7idAXN11pB++89RFrT =JRxV -----END PGP SIGNATURE----- --t4k3FX2BKM3OLyzG-- --===============1904258056== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --===============1904258056==--