lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 29 Jul 2009 10:59:33 +0200
From:	Jerome Glisse <glisse@...edesktop.org>
To:	Thomas Hellström <thomas@...pmail.org>
Cc:	linux-kernel@...r.kernel.org, dri-devel@...ts.sf.net
Subject: Re: ttm_mem_global

On Tue, 2009-07-28 at 20:55 +0200, Thomas Hellström wrote:
> Jerome Glisse skrev:
> > On Wed, 2009-07-22 at 10:37 +0200, Thomas Hellström wrote:
> >   
> >> TTM has a device struct per device and an optional global struct that is 
> >> common for all devices and intended to be per subsystem.
> >>
> >> The only subsystem currently having a global structure is the memory 
> >> accounting subsystem:
> >> struct ttm_mem_global
> >>     
> >
> > Thomas i don't think the way we init ttm_mem_global today make
> > it follow the 1 struct ttm_mem_global for everyone. I think it
> > should be initialized and refcounted by device struct.
> >
> > So on first device creation a ttm_mem_global is created and
> > then anytime a new device is created the refcount of ttm_mem_global
> > is increased. 
> Jerome,
> This is exactly what the current code intends to do.
> 
> Are you seeing something different?

I definitly don't see that :) In radeon we do create a structure
which hold the ttm_mem_global struct so it's not shared at all
it got inited & destroyed along the driver. This is why i think
it's better to remove the driver initialization and let bo_device
init path take care of initializing one and only one object which
can be shared by multiple driverttm_mem_global_inits.

So what i propose is remove mem_glob parameter from :
ttm_bo_device_init, add a call to ttm_mem_global_init in
ttm_bo_device_init and add some static refcount in ttm_memory.c
if refcount = 0 then ttm_mem_global_init create a ttm_mem_global
struct and initialize things, if refcount > 0 then it gives
back the already initialized ttm_mem_global.

Of course we unref with ttm_mem_global_release and destroy
once refcount reach 0.

Cheers,
Jerome

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ