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:10:03 +0200 Message-ID: <20140829131002.GU17519@ulmo> References: <1409313661-20696-1-git-send-email-dh.herrmann@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1197565894==" Return-path: Received: from mail-we0-f180.google.com (mail-we0-f180.google.com [74.125.82.180]) by gabe.freedesktop.org (Postfix) with ESMTP id 063126E6F2 for ; Fri, 29 Aug 2014 06:10:05 -0700 (PDT) Received: by mail-we0-f180.google.com with SMTP id w61so2156637wes.11 for ; Fri, 29 Aug 2014 06:10:05 -0700 (PDT) In-Reply-To: <1409313661-20696-1-git-send-email-dh.herrmann@gmail.com> 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 --===============1197565894== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cbsCxbAnPLQXdgdB" Content-Disposition: inline --cbsCxbAnPLQXdgdB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 spinlock > and make idr-allocation use idr_preload(). >=20 > This patch also makes mode-object lookup irq-save, in case you ever wanna > 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. Thierry --cbsCxbAnPLQXdgdB Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUAHuqAAoJEN0jrNd/PrOhOpAP/0KELhf3PGpvG6ZXQGXG91IS KhAS29pmB83mIvvtZZ+I326LvSSms1XZ4P9gh+kA6iLS2Kn7NLVeo6LEqF4HWbFh 6gn0rnLMDzuvfyOrf4/U/vHVnbXMMd79/ngKOWUF0Bl3dBmlnVJvx5Q3jzlvb8FP c/LrbEDj2N/DCgIrDc04sgVh1hYfPOZicoc+28k+dIK4hcvNt3hiJ+Kk2IybDvRX X3TVeVIm6sGgzAHZPTI+SC5T2ZAgc8K5aUNgGs/fy/5cNE+aDnAmqIvMtknvLE05 y0pwhkhgLafl5CVZaqjo/3nvn/YqMt0SsZg0wFLirv3ETOr8WRW3fd45o3jm0fva jlNf7kWzY0Xcr4X85uvddygAiguSbDJ5M437MlsYO36ZDMiqCx0xquZqsSeN34jm oc/yffwceeCZX2gfXR5ueQzdaVwaPaPoB5kQSDzAR8XywDQ5+DusPA1aR4BFMisJ iUdY5Tz+PGlTiE594pYQk+iIKf7l1T3uPM90zp7KPjfkiPPH3hvhbaGGlQTELsNj s3D8+Jv4djfOcsK/CDTHh1oH6h2FaC3GU0XIs/RpUj2oyC5wmU/nxgLWzlRVv5Xy /iewqrIMPZpyPEoGorxvkec8oUAzuvmTyaGwDPwbQ6sEONxJnwQnsqhGl0vg1Hmt 9LDzWLF6wiiUpoCgbJ7Q =3Cx3 -----END PGP SIGNATURE----- --cbsCxbAnPLQXdgdB-- --===============1197565894== 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 --===============1197565894==--