Re: [PATCH 2/2] drm/vram-helper: Alternate between bottom-up and top-down placement

2020-04-29 Thread Christian König
Am 29.04.20 um 09:25 schrieb Gerd Hoffmann: Hi, It's not that easy. Current cursors n ast are statically allocated. As soon as you add dynamic cursors into the mix, you'd get OOMs. Well, with the split you can simply allocate dynamic cursors with top-bottom to keep them out of the way. It'

Re: [PATCH 2/2] drm/vram-helper: Alternate between bottom-up and top-down placement

2020-04-29 Thread Gerd Hoffmann
Hi, > It's not that easy. Current cursors n ast are statically allocated. As > soon as you add dynamic cursors into the mix, you'd get OOMs. Well, with the split you can simply allocate dynamic cursors with top-bottom to keep them out of the way. It's not 100% perfect, the area where the curso

Re: [PATCH 2/2] drm/vram-helper: Alternate between bottom-up and top-down placement

2020-04-28 Thread Thomas Zimmermann
Hi Gerd Am 24.04.20 um 11:38 schrieb Gerd Hoffmann: > Hi, > >> At some point one has to choose to switch to top-down, and then back >> again at one of the next BOs. So the current patch effectively splits >> vram into a lower half and an upper half and puts BOs in alternating halves. > > Hmm,

Re: [PATCH 2/2] drm/vram-helper: Alternate between bottom-up and top-down placement

2020-04-24 Thread Gerd Hoffmann
Hi, > At some point one has to choose to switch to top-down, and then back > again at one of the next BOs. So the current patch effectively splits > vram into a lower half and an upper half and puts BOs in alternating halves. Hmm, so maybe just make the split explicit instead of playing tricks

Re: [PATCH 2/2] drm/vram-helper: Alternate between bottom-up and top-down placement

2020-04-24 Thread Christian König
Am 24.04.20 um 09:03 schrieb Thomas Zimmermann: Hi Am 24.04.20 um 08:56 schrieb Christian König: Am 24.04.20 um 08:27 schrieb Thomas Zimmermann: Hi Christian Am 23.04.20 um 17:04 schrieb Christian König: Hi guys, one thing you don't seem to have considered yet is that not setting the top-do

Re: [PATCH 2/2] drm/vram-helper: Alternate between bottom-up and top-down placement

2020-04-24 Thread Thomas Zimmermann
Hi Am 24.04.20 um 08:56 schrieb Christian König: > Am 24.04.20 um 08:27 schrieb Thomas Zimmermann: >> Hi Christian >> >> Am 23.04.20 um 17:04 schrieb Christian König: >>> Hi guys, >>> >>> one thing you don't seem to have considered yet is that not setting the >>> top-down flag also won't get you t

Re: [PATCH 2/2] drm/vram-helper: Alternate between bottom-up and top-down placement

2020-04-23 Thread Thomas Zimmermann
Hi Gerd Am 23.04.20 um 15:57 schrieb Gerd Hoffmann: >>> I don't think it is that simple. >>> >>> First: How will that interact with cursor bo allocations? IIRC the >>> strategy for them is to allocate top-down, for similar reasons (avoid >>> small cursor bo allocs fragment vram memory). >> >> In

Re: [PATCH 2/2] drm/vram-helper: Alternate between bottom-up and top-down placement

2020-04-23 Thread Christian König
Am 24.04.20 um 08:27 schrieb Thomas Zimmermann: Hi Christian Am 23.04.20 um 17:04 schrieb Christian König: Hi guys, one thing you don't seem to have considered yet is that not setting the top-down flag also won't get you the bottom-up approach, but rather the best fit. Kind of unrelated: Woul

Re: [PATCH 2/2] drm/vram-helper: Alternate between bottom-up and top-down placement

2020-04-23 Thread Thomas Zimmermann
Hi Christian Am 23.04.20 um 17:04 schrieb Christian König: > Hi guys, > > one thing you don't seem to have considered yet is that not setting the > top-down flag also won't get you the bottom-up approach, but rather the > best fit. Kind of unrelated: Would it pick the smallest free area that can

Re: [PATCH 2/2] drm/vram-helper: Alternate between bottom-up and top-down placement

2020-04-23 Thread Christian König
Hi guys, one thing you don't seem to have considered yet is that not setting the top-down flag also won't get you the bottom-up approach, but rather the best fit. Additional to that the top-down allocations have quite a bit more CPU overhead since they don't walk the size tree, but the addre

Re: [PATCH 2/2] drm/vram-helper: Alternate between bottom-up and top-down placement

2020-04-23 Thread Gerd Hoffmann
> > I don't think it is that simple. > > > > First: How will that interact with cursor bo allocations? IIRC the > > strategy for them is to allocate top-down, for similar reasons (avoid > > small cursor bo allocs fragment vram memory). > > In ast, 2 cursor BOs are allocated during driver initia

Re: [PATCH 2/2] drm/vram-helper: Alternate between bottom-up and top-down placement

2020-04-23 Thread Thomas Zimmermann
Hi Gerd, thanks for the feedback. Am 23.04.20 um 13:18 schrieb Gerd Hoffmann: > On Wed, Apr 22, 2020 at 04:40:55PM +0200, Thomas Zimmermann wrote: >> With limited VRAM available, fragmentation can lead to OOM errors. >> Alternating between bottom-up and top-down placement keeps BOs near the >> en

Re: [PATCH 2/2] drm/vram-helper: Alternate between bottom-up and top-down placement

2020-04-23 Thread Gerd Hoffmann
On Wed, Apr 22, 2020 at 04:40:55PM +0200, Thomas Zimmermann wrote: > With limited VRAM available, fragmentation can lead to OOM errors. > Alternating between bottom-up and top-down placement keeps BOs near the > ends of the VRAM and the available pages consecutively near the middle. > > A real-wor

[PATCH 2/2] drm/vram-helper: Alternate between bottom-up and top-down placement

2020-04-22 Thread Thomas Zimmermann
With limited VRAM available, fragmentation can lead to OOM errors. Alternating between bottom-up and top-down placement keeps BOs near the ends of the VRAM and the available pages consecutively near the middle. A real-world example with 16 MiB of VRAM is shown below. > cat /sys/kernel/debug/dri