[PATCH v3 0/4] drm: Use full allocated minor range for DRM

Michał Winiarski posted 4 patches 3 years, 7 months ago
There is a newer version of this series
drivers/gpu/drm/drm_drv.c | 55 ++++++++++++++++++++++-----------------
lib/radix-tree.c          |  3 +++
2 files changed, 34 insertions(+), 24 deletions(-)
[PATCH v3 0/4] drm: Use full allocated minor range for DRM
Posted by Michał Winiarski 3 years, 7 months ago
64 DRM device nodes is not enough for everyone.
Upgrade it to ~512K (which definitely is more than enough).

To allow testing userspace support for >64 devices, add additional DRM
modparam (skip_legacy_minors) which causes DRM to skip allocating minors
in 0-192 range.
Additionally - one minor tweak around minor DRM IDR locking and IDR lockdep
annotations.

v1 -> v2:
Don't touch DRM_MINOR_CONTROL and its range (Simon Ser)

v2 -> v3:
Don't use legacy scheme for >=192 minor range (Dave Airlie)
Add modparam for testing (Dave Airlie)
Add lockdep annotation for IDR (Daniel Vetter)

Michał Winiarski (4):
  drm: Expand max DRM device number to full MINORBITS
  drm: Introduce skip_legacy_minors modparam
  drm: Use mutex for minors
  idr: Add might_alloc() annotation

 drivers/gpu/drm/drm_drv.c | 55 ++++++++++++++++++++++-----------------
 lib/radix-tree.c          |  3 +++
 2 files changed, 34 insertions(+), 24 deletions(-)

-- 
2.37.3

Re: [PATCH v3 0/4] drm: Use full allocated minor range for DRM
Posted by Matthew Wilcox 3 years, 7 months ago
On Tue, Sep 06, 2022 at 04:01:13PM +0200, Michał Winiarski wrote:
> 64 DRM device nodes is not enough for everyone.
> Upgrade it to ~512K (which definitely is more than enough).
> 
> To allow testing userspace support for >64 devices, add additional DRM
> modparam (skip_legacy_minors) which causes DRM to skip allocating minors
> in 0-192 range.
> Additionally - one minor tweak around minor DRM IDR locking and IDR lockdep
> annotations.

The IDR is deprecated; rather than making all these changes around
the IDR, could you convert it to use the XArray instead?  I did it
once before, but those patches bounced off the submissions process.

Re: [PATCH v3 0/4] drm: Use full allocated minor range for DRM
Posted by Michał Winiarski 3 years, 7 months ago
On Tue, Sep 06, 2022 at 03:21:25PM +0100, Matthew Wilcox wrote:
> On Tue, Sep 06, 2022 at 04:01:13PM +0200, Michał Winiarski wrote:
> > 64 DRM device nodes is not enough for everyone.
> > Upgrade it to ~512K (which definitely is more than enough).
> > 
> > To allow testing userspace support for >64 devices, add additional DRM
> > modparam (skip_legacy_minors) which causes DRM to skip allocating minors
> > in 0-192 range.
> > Additionally - one minor tweak around minor DRM IDR locking and IDR lockdep
> > annotations.
> 
> The IDR is deprecated; rather than making all these changes around
> the IDR, could you convert it to use the XArray instead?  I did it
> once before, but those patches bounced off the submissions process.

Sure. The IDR annotation can still be useful for existing users though,
are you saying I should drop it as well?

-Michał