Re: KMSAN: kernel-infoleak in compat_drm_wait_vblank

2021-03-03 Thread Michel Dänzer
ialize req.reply.tval_usec = req32.reply.tval_usec; before calling drm_ioctl_kernel, since it's not aliased by any req.request.* member, and drm_wait_vblank_ioctl doesn't always write to it. -- Earthling Michel Dänzer | https://redhat.com Libre software enth

Re: [PATCH v3] kcmp: Support selection of SYS_kcmp without CHECKPOINT_RESTORE

2021-02-12 Thread Michel Dänzer
an issue and mesa was using SYS_kcmp to compare device node fds. A far shorter and more portable solution is possible, so let me prepare a Mesa patch. Make sure to read my comments on https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6881 first. :) -- Earthling Michel Dänzer

Re: [PATCH] kernel: Expose SYS_kcmp by default

2021-02-08 Thread Michel Dänzer
On 2021-02-08 2:34 p.m., Daniel Vetter wrote: On Mon, Feb 8, 2021 at 12:49 PM Michel Dänzer wrote: On 2021-02-05 9:53 p.m., Daniel Vetter wrote: On Fri, Feb 5, 2021 at 7:37 PM Kees Cook wrote: On Fri, Feb 05, 2021 at 04:37:52PM +, Chris Wilson wrote: Userspace has discovered

Re: [PATCH] kernel: Expose SYS_kcmp by default

2021-02-08 Thread Michel Dänzer
On 2021-02-08 12:49 p.m., Michel Dänzer wrote: On 2021-02-05 9:53 p.m., Daniel Vetter wrote: On Fri, Feb 5, 2021 at 7:37 PM Kees Cook wrote: On Fri, Feb 05, 2021 at 04:37:52PM +, Chris Wilson wrote: Userspace has discovered the functionality offered by SYS_kcmp and has started to depend

Re: [PATCH] kernel: Expose SYS_kcmp by default

2021-02-08 Thread Michel Dänzer
ly needed I think. Per above, not sure this is really true. -- Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and X developer

[PATCH] drm/ttm: Use __GFP_NOWARN for huge pages in ttm_pool_alloc_page

2021-01-28 Thread Michel Dänzer
From: Michel Dänzer Without __GFP_NOWARN, attempts at allocating huge pages can trigger dmesg splats like below (which are essentially noise, since TTM falls back to normal pages if it can't get a huge one). [ 9556.710241] clinfo: page allocation failure: order:9, mode:0x194dc2(GFP_HIGHUSER

Re: amdgpu crashes on OOM

2020-10-26 Thread Michel Dänzer
. -- Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and X developer

Re: [PATCH 3/3] RFC: dma-buf: Add an API for importing and exporting sync files (v5)

2020-09-30 Thread Michel Dänzer
(if DMA_BUF_IOCTL_IMPORT_SYNC_FILE is still controversial). -- Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and X developer

Re: [PATCH AUTOSEL 5.4 13/15] drm/amdgpu/dc: Require primary plane to be enabled whenever the CRTC is

2020-09-21 Thread Michel Dänzer
On 2020-09-21 4:40 p.m., Sasha Levin wrote: From: Michel Dänzer [ Upstream commit 2f228aab21bbc74e90e267a721215ec8be51daf7 ] Don't check drm_crtc_state::active for this either, per its documentation in include/drm/drm_crtc.h: * Hence drivers must not consult @active in their various

Re: [PATCH v1 0/2] video: fbdev: radeonfb: PCI PM framework upgrade and fix-ups.

2020-09-07 Thread Michel Dänzer
n't support suspend-to-RAM on Apple PowerPC notebooks. -- Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and X developer

Re: [PATCH 00/49] DRM driver for Hikey 970

2020-08-20 Thread Michel Dänzer
ell, because you didn't trim the quoted text (hint, hint). -- Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and X developer

Re: [PATCH] gpu/drm: Remove TTM_PL_FLAG_WC of VRAM to fix writecombine issue for Loongson64

2020-08-10 Thread Michel Dänzer
> In this case the patch is a clear NAK since you haven't root caused the > issue and are just working around it in a very questionable manner. To be fair though, amdgpu & radeon are already disabling write-combining for system memory pages in 32-bit x86 kernels for similar reasons. -- Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and X developer

Re: [PATCH AUTOSEL 5.6 33/50] drm/amdgpu: bump version for invalidate L2 before SDMA IBs

2020-05-07 Thread Michel Dänzer
3 > -#define KMS_DRIVER_MINOR 36 > +#define KMS_DRIVER_MINOR 37 > #define KMS_DRIVER_PATCHLEVEL0 > > int amdgpu_vram_limit = 0; > This requires the parent commit fdf83646c0542ecfb9adc4db8f741a1f43dca058 "drm/amdgpu: invalidate L2 before SDMA IBs (v2)

Re: [PATCH AUTOSEL 4.19 044/167] drm/amdgpu: validate user pitch alignment

2019-09-04 Thread Michel Dänzer
r the brouhaha, I just honestly didn't realize before how tricky this case was for the scripts. -- Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and X developer

Re: [PATCH AUTOSEL 4.19 044/167] drm/amdgpu: validate user pitch alignment

2019-09-04 Thread Michel Dänzer
On 2019-09-03 10:16 p.m., Daniel Vetter wrote: > On Tue, Sep 3, 2019 at 10:01 PM Sasha Levin wrote: >> On Tue, Sep 03, 2019 at 07:03:47PM +0200, Greg KH wrote: >>> On Tue, Sep 03, 2019 at 06:40:43PM +0200, Michel Dänzer wrote: >>>> On 2019-09-03 6:23 p.m., Sasha Le

Re: [PATCH AUTOSEL 4.19 044/167] drm/amdgpu: validate user pitch alignment

2019-09-03 Thread Michel Dänzer
h didn't have other corresponding changes, so they ended up breaking stuff instead of fixing anything. -- Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and X developer

Re: Support for 2D engines/blitters in V4L2 and DRM

2019-04-24 Thread Michel Dänzer
not). Note that variable refresh rate (Adaptive Sync / FreeSync / G-Sync) changes things in this regard. It makes the vblank length variable, and if you wait for multiple vblanks between flips, you get the maximum vblank length corresponding to the minimum refresh rate / timing granularity. T

Re: [PATCH v2] gpu: radeon: fix a potential NULL-pointer dereference

2019-03-26 Thread Michel Dänzer
On 2019-03-25 10:05 p.m., Kangjie Lu wrote: > In case alloc_workqueue fails, the fix frees memory and > returns -ENOMEM to avoid potential NULL pointer dereference. > > Signed-off-by: Kangjie Lu > --- > v2: use radeon_crtc_destroy to properly clean up resources as > sugge

Re: [RFC PATCH] drm: disable WC optimization for cache coherent devices on non-x86

2019-01-24 Thread Michel Dänzer
cache coherent likely not working *at >>> all* unless the optimization is enabled. >> >> As Michel tried to explain this CAN'T happen. The optimization is a >> purely optional request from userspace. >> > > Right. > > So in that case,

Re: [RFC PATCH] drm: disable WC optimization for cache coherent devices on non-x86

2019-01-24 Thread Michel Dänzer
t; - if (bo->flags & AMDGPU_GEM_CREATE_CPU_GTT_USWC) >> - DRM_INFO_ONCE("Please enable CONFIG_MTRR and CONFIG_X86_PAT >> for " >> - "better performance thanks to >> write-combining\n"); FWIW, pleas

Re: [RFC PATCH] drm: disable WC optimization for cache coherent devices on non-x86

2019-01-21 Thread Michel Dänzer
On 2019-01-21 7:28 p.m., Ard Biesheuvel wrote: > On Mon, 21 Jan 2019 at 19:24, Michel Dänzer wrote: >> On 2019-01-21 7:20 p.m., Ard Biesheuvel wrote: >>> On Mon, 21 Jan 2019 at 19:04, Michel Dänzer wrote: >>>> On 2019-01-21 6:59 p.m., Ard Biesheuvel wrote: >

Re: [RFC PATCH] drm: disable WC optimization for cache coherent devices on non-x86

2019-01-21 Thread Michel Dänzer
On 2019-01-21 7:20 p.m., Ard Biesheuvel wrote: > On Mon, 21 Jan 2019 at 19:04, Michel Dänzer wrote: >> >> On 2019-01-21 6:59 p.m., Ard Biesheuvel wrote: >>> On Mon, 21 Jan 2019 at 18:55, Michel Dänzer wrote: >>>> >>>> On 2019-01-21 5:30 p.m., Ard B

Re: [RFC PATCH] drm: disable WC optimization for cache coherent devices on non-x86

2019-01-21 Thread Michel Dänzer
On 2019-01-21 6:59 p.m., Ard Biesheuvel wrote: > On Mon, 21 Jan 2019 at 18:55, Michel Dänzer wrote: >> >> On 2019-01-21 5:30 p.m., Ard Biesheuvel wrote: >>> On Mon, 21 Jan 2019 at 17:22, Christoph Hellwig wrote: >>> >>>> Until that happens we sh

Re: [RFC PATCH] drm: disable WC optimization for cache coherent devices on non-x86

2019-01-21 Thread Michel Dänzer
; 'optimization' to get things working. FWIW, the amdgpu driver doesn't rely on non-snooped transfers for correct basic operation (the scenario Christian brought up is a very specialized use-case), so that shouldn't be an issue. -- Earthling Michel Dänzer |

Re: [RFC PATCH] drm/ttm: force cached mappings for system RAM on ARM

2019-01-10 Thread Michel Dänzer
for this, because other TTM / driver code will still consider the memory uncacheable. E.g. the amdgpu driver will program the GPU to treat the memory as uncacheable, so it won't participate in cache coherency protocol for it, which is unlikely to work as expected in general if the CP

Re: [PATCH AUTOSEL 4.20 034/117] drm/amdgpu: Correct get_crtc_scanoutpos behavior when vpos >= vtotal

2019-01-09 Thread Michel Dänzer
needed in older kernels. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer

Re: [PATCH v6 1/2] drm/amd: validate user pitch alignment

2019-01-08 Thread Michel Dänzer
> > Cc: sta...@vger.kernel.org # v4.2+ > Signed-off-by: Yu Zhao Both patches applied to amd-staging-drm-next (should land in 5.0), thanks! -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer

Re: [PATCH v5 1/2] drm/amd: validate user pitch alignment

2019-01-07 Thread Michel Dänzer
On 2019-01-07 5:00 a.m., Yu Zhao wrote: > On Thu, Jan 03, 2019 at 05:33:19PM +0100, Michel Dänzer wrote: >> On 2018-12-30 2:00 a.m., Yu Zhao wrote: >>> Userspace may request pitch alignment that is not supported by GPU. >>> Some requests 32, but GPU ignores it and uses d

Re: [PATCH v5 1/2] drm/amd: validate user pitch alignment

2019-01-03 Thread Michel Dänzer
return ERR_PTR(-EINVAL); > + } > > obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]); > if (obj == NULL) { > Apart from the above, the v5 series looks good to me. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer

Re: [PATCH 2/3] drm/amd: validate user pitch alignment

2018-12-27 Thread Michel Dänzer
On 2018-12-23 10:44 p.m., Yu Zhao wrote: > On Fri, Dec 21, 2018 at 10:07:26AM +0100, Michel Dänzer wrote: >> On 2018-12-21 4:10 a.m., Yu Zhao wrote: >>> Userspace may request pitch alignment that is not supported by GPU. >>> Some requests 32, but GPU ignores it a

Re: [PATCH] drm: add capability DRM_CAP_ASYNC_UPDATE

2018-12-21 Thread Michel Dänzer
On 2018-12-21 2:26 p.m., Daniel Vetter wrote: > On Fri, Dec 21, 2018 at 10:47:27AM +0100, Michel Dänzer wrote: >> On 2018-12-20 6:16 p.m., Michel Dänzer wrote: >>> On 2018-12-20 6:09 p.m., Daniel Vetter wrote: >>>> On Thu, Dec 20, 2018 at 6:03 PM Alex Deucher wro

Re: [PATCH] drm: add capability DRM_CAP_ASYNC_UPDATE

2018-12-21 Thread Michel Dänzer
t even a single one could cause a frame drop. I assume the issue is that gamma updates are done as separate atomic commits, which can delay other commits for page flips. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer

Re: [PATCH] drm: add capability DRM_CAP_ASYNC_UPDATE

2018-12-21 Thread Michel Dänzer
On 2018-12-20 6:16 p.m., Michel Dänzer wrote: > On 2018-12-20 6:09 p.m., Daniel Vetter wrote: >> On Thu, Dec 20, 2018 at 6:03 PM Alex Deucher wrote: >>> On Thu, Dec 20, 2018 at 11:54 AM Daniel Vetter wrote: >> >>>> Not sure about the gamma thing since we

Re: [PATCH 3/3] drm/amd: validate user GEM object size

2018-12-21 Thread Michel Dänzer
>height, 8); > + if (obj->size < pitch * height) { > + dev_err(>pdev->dev, "Invalid GEM size: expecting %d but > got %d\n", > + pitch * height, obj->size); Same comment as patch 2, and maybe write "expecting >= %d but

Re: [PATCH 2/3] drm/amd: validate user pitch alignment

2018-12-21 Thread Michel Dänzer
pu_align_pitch(adev, mode_cmd->width, cpp, false); Also, this needs to use mode_cmd->pitches[0] instead of mode_cmd->width, otherwise it'll spuriously fail for larger but well-aligned pitches. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer

Re: [PATCH 2/3] drm/amd: validate user pitch alignment

2018-12-21 Thread Michel Dänzer
dn't be printed by default, or buggy / malicious userspace can spam dmesg. I suggest using DRM_DEBUG_KMS or DRM_DEBUG_DRIVER. > + return ERR_PTR(-EINVAL); > + } > > obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]); > if (obj == NULL) { &

Re: [PATCH 1/3] drm/amd: fix race in page flip job

2018-12-21 Thread Michel Dänzer
_status thus will refuse to notify the job > completion. The job will eventually times out. > > Reverse the order of calling page_flip and setting pflip_status to > fix the race. There is no race, amdgpu_crtc->pflip_status is protected by dev->event_lock.

Re: [PATCH] drm: add capability DRM_CAP_ASYNC_UPDATE

2018-12-20 Thread Michel Dänzer
new commit otherwise? Otherwise the atomic API just moves this same problem to be solved by userspace. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer

[PATCH] drm/ttm: Use drm_debug_printer for all ttm_bo_mem_space_debug output

2018-12-20 Thread Michel Dänzer
From: Michel Dänzer No need for pr_err here, the pr_err message in ttm_bo_evict is enough to draw attention to something not going as planned. Signed-off-by: Michel Dänzer --- Similar to a previous patch, but this one leaves the pr_err messages in ttm_bo_evict untouched. drivers/gpu/drm/ttm

Re: [PATCH 2/2] drm/ttm: Use pr_debug for all output from ttm_bo_evict

2018-12-06 Thread Michel Dänzer
On 2018-12-06 5:46 p.m., Joe Perches wrote: > On Thu, 2018-12-06 at 17:39 +0800, Zhang, Jerry(Junwei) wrote: >> On 12/6/18 5:33 PM, Koenig, Christian wrote: >>> Am 06.12.18 um 10:09 schrieb Michel Dänzer: >>>> On 2018-12-06 3:43 a.m., Zhang, Jerry(Junwei) wrote: >

Re: [PATCH 1/2] drm: Only #define DEBUG if CONFIG_DYNAMIC_DEBUG is disabled

2018-12-06 Thread Michel Dänzer
On 2018-12-06 5:10 p.m., Daniel Thompson wrote: > On Thu, Dec 06, 2018 at 03:41:16PM +0100, Michel Dänzer wrote: >> On 2018-12-06 1:23 p.m., Joe Perches wrote: >>> On Thu, 2018-12-06 at 12:52 +0100, Michel Dänzer wrote: >>>> In contrast to the 2b case, the pr_debug o

Re: [PATCH 1/2] drm: Only #define DEBUG if CONFIG_DYNAMIC_DEBUG is disabled

2018-12-06 Thread Michel Dänzer
On 2018-12-06 1:23 p.m., Joe Perches wrote: > On Thu, 2018-12-06 at 12:52 +0100, Michel Dänzer wrote: >> In contrast to the 2b case, the pr_debug output isn't visible by default >> with 1b, so the latter doesn't fit "always produce output" either. > > I think you ar

Re: [PATCH 3/5] drm: fix drm_mode_addfb() on big endian machines.

2018-09-04 Thread Michel Dänzer
ieve that ADDFB should be made to always prefer host byte > order -- this is how all of the existing implementations work in > practice. However e.g. nouveau wants DRM_FORMAT_XRGB. But it still > treats it as host byte order. This will become more important in a > world where

Re: [PATCH 3/5] drm: fix drm_mode_addfb() on big endian machines.

2018-09-04 Thread Michel Dänzer
ieve that ADDFB should be made to always prefer host byte > order -- this is how all of the existing implementations work in > practice. However e.g. nouveau wants DRM_FORMAT_XRGB. But it still > treats it as host byte order. This will become more important in a > world where

Re: [PATCH 3/5] drm: fix drm_mode_addfb() on big endian machines.

2018-09-03 Thread Michel Dänzer
changes as they did before. So no concerns from my side anymore. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer

Re: [PATCH 3/5] drm: fix drm_mode_addfb() on big endian machines.

2018-09-03 Thread Michel Dänzer
changes as they did before. So no concerns from my side anymore. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer

Re: [PATCH] swiotlb: Fix inversed DMA_ATTR_NO_WARN test

2018-05-25 Thread Michel Dänzer
On 2018-05-25 10:41 AM, Christoph Hellwig wrote: > On Tue, May 22, 2018 at 03:13:58PM +0200, Christian König wrote: >> Am 02.05.2018 um 18:59 schrieb Michel Dänzer: >>> On 2018-05-02 06:21 PM, Christoph Hellwig wrote: >>>> On Wed, May 02, 2018 at 04:31:0

Re: [PATCH] swiotlb: Fix inversed DMA_ATTR_NO_WARN test

2018-05-25 Thread Michel Dänzer
On 2018-05-25 10:41 AM, Christoph Hellwig wrote: > On Tue, May 22, 2018 at 03:13:58PM +0200, Christian König wrote: >> Am 02.05.2018 um 18:59 schrieb Michel Dänzer: >>> On 2018-05-02 06:21 PM, Christoph Hellwig wrote: >>>> On Wed, May 02, 2018 at 04:31:0

Re: [PATCH] swiotlb: Fix inversed DMA_ATTR_NO_WARN test

2018-05-02 Thread Michel Dänzer
On 2018-05-02 06:21 PM, Christoph Hellwig wrote: > On Wed, May 02, 2018 at 04:31:09PM +0200, Michel Dänzer wrote: >>> No. __GFP_NOWARN (and gfp_t flags in general) are the wrong interface >>> for dma allocations and just cause problems. I actually plan to >>>

Re: [PATCH] swiotlb: Fix inversed DMA_ATTR_NO_WARN test

2018-05-02 Thread Michel Dänzer
On 2018-05-02 06:21 PM, Christoph Hellwig wrote: > On Wed, May 02, 2018 at 04:31:09PM +0200, Michel Dänzer wrote: >>> No. __GFP_NOWARN (and gfp_t flags in general) are the wrong interface >>> for dma allocations and just cause problems. I actually plan to >>>

Re: [PATCH] swiotlb: Fix inversed DMA_ATTR_NO_WARN test

2018-05-02 Thread Michel Dänzer
c_attrs sooner, and only > allow either GFP_KERNEL or GFP_DMA passed in dma_alloc_coherent. How about GFP_TRANSHUGE_LIGHT? TTM uses that to opportunistically allocate huge pages (GFP_TRANSHUGE can result in unacceptably long delays with memory pressure). -- Earthling Michel Dänzer

Re: [PATCH] swiotlb: Fix inversed DMA_ATTR_NO_WARN test

2018-05-02 Thread Michel Dänzer
c_attrs sooner, and only > allow either GFP_KERNEL or GFP_DMA passed in dma_alloc_coherent. How about GFP_TRANSHUGE_LIGHT? TTM uses that to opportunistically allocate huge pages (GFP_TRANSHUGE can result in unacceptably long delays with memory pressure). -- Earthling Michel Dänzer

Re: [PATCH v2 1/2] drm/ttm: Only allocate huge pages with new flag TTM_PAGE_FLAG_TRANSHUGE

2018-05-02 Thread Michel Dänzer
On 2018-04-29 01:56 AM, Ilia Mirkin wrote: > On Sat, Apr 28, 2018 at 7:02 PM, Michel Dänzer <mic...@daenzer.net> wrote: >> >> Unfortunately, there was an swiotlb regression (not directly related to >> Christian's work) shortly after this fix, also in 4.16-rc1, which

Re: [PATCH v2 1/2] drm/ttm: Only allocate huge pages with new flag TTM_PAGE_FLAG_TRANSHUGE

2018-05-02 Thread Michel Dänzer
On 2018-04-29 01:56 AM, Ilia Mirkin wrote: > On Sat, Apr 28, 2018 at 7:02 PM, Michel Dänzer wrote: >> >> Unfortunately, there was an swiotlb regression (not directly related to >> Christian's work) shortly after this fix, also in 4.16-rc1, which is now >> fixed in 4.17

Re: [PATCH v2 1/2] drm/ttm: Only allocate huge pages with new flag TTM_PAGE_FLAG_TRANSHUGE

2018-05-01 Thread Michel Dänzer
commit 0176adb004065d6815a8e67946752df4cd947c5b "swiotlb: refactor coherent buffer allocation" in 4.16-rc1. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer

Re: [PATCH v2 1/2] drm/ttm: Only allocate huge pages with new flag TTM_PAGE_FLAG_TRANSHUGE

2018-05-01 Thread Michel Dänzer
commit 0176adb004065d6815a8e67946752df4cd947c5b "swiotlb: refactor coherent buffer allocation" in 4.16-rc1. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer

[PATCH] swiotlb: Fix inversed DMA_ATTR_NO_WARN test

2018-05-01 Thread Michel Dänzer
From: Michel Dänzer <michel.daen...@amd.com> The result was printing the warning only when we were explicitly asked not to. Cc: sta...@vger.kernel.org Fixes: 0176adb004065d6815a8e67946752df4cd947c5b "swiotlb: refactor coherent buffer allocation" Signed-off-by: Michel Dän

[PATCH] swiotlb: Fix inversed DMA_ATTR_NO_WARN test

2018-05-01 Thread Michel Dänzer
From: Michel Dänzer The result was printing the warning only when we were explicitly asked not to. Cc: sta...@vger.kernel.org Fixes: 0176adb004065d6815a8e67946752df4cd947c5b "swiotlb: refactor coherent buffer allocation" Signed-off-by: Michel Dänzer --- lib/swiotlb.c | 2 +- 1 fi

Re: [PATCH v2 1/2] drm/ttm: Only allocate huge pages with new flag TTM_PAGE_FLAG_TRANSHUGE

2018-04-30 Thread Michel Dänzer
On 2018-04-29 09:02 AM, Christian König wrote: > Am 29.04.2018 um 01:02 schrieb Michel Dänzer: >> On 2018-04-28 06:30 PM, Ilia Mirkin wrote: >>> On Fri, Apr 27, 2018 at 9:08 AM, Michel Dänzer <mic...@daenzer.net> >>> wrote: >>>> From: Michel Dänzer

Re: [PATCH v2 1/2] drm/ttm: Only allocate huge pages with new flag TTM_PAGE_FLAG_TRANSHUGE

2018-04-30 Thread Michel Dänzer
On 2018-04-29 09:02 AM, Christian König wrote: > Am 29.04.2018 um 01:02 schrieb Michel Dänzer: >> On 2018-04-28 06:30 PM, Ilia Mirkin wrote: >>> On Fri, Apr 27, 2018 at 9:08 AM, Michel Dänzer >>> wrote: >>>> From: Michel Dänzer

Re: [PATCH v2 1/2] drm/ttm: Only allocate huge pages with new flag TTM_PAGE_FLAG_TRANSHUGE

2018-04-28 Thread Michel Dänzer
On 2018-04-28 06:30 PM, Ilia Mirkin wrote: > On Fri, Apr 27, 2018 at 9:08 AM, Michel Dänzer <mic...@daenzer.net> wrote: >> From: Michel Dänzer <michel.daen...@amd.com> >> >> Previously, TTM would always (with CONFIG_TRANSPARENT_HUGEPAGE enabled) >> try t

Re: [PATCH v2 1/2] drm/ttm: Only allocate huge pages with new flag TTM_PAGE_FLAG_TRANSHUGE

2018-04-28 Thread Michel Dänzer
On 2018-04-28 06:30 PM, Ilia Mirkin wrote: > On Fri, Apr 27, 2018 at 9:08 AM, Michel Dänzer wrote: >> From: Michel Dänzer >> >> Previously, TTM would always (with CONFIG_TRANSPARENT_HUGEPAGE enabled) >> try to allocate huge pages. However, not all drivers can take

[PATCH v2 1/2] drm/ttm: Only allocate huge pages with new flag TTM_PAGE_FLAG_TRANSHUGE

2018-04-27 Thread Michel Dänzer
From: Michel Dänzer <michel.daen...@amd.com> Previously, TTM would always (with CONFIG_TRANSPARENT_HUGEPAGE enabled) try to allocate huge pages. However, not all drivers can take advantage of huge pages, but they would incur the overhead for allocating and freeing them anyway. Now, drivers

[PATCH v2 1/2] drm/ttm: Only allocate huge pages with new flag TTM_PAGE_FLAG_TRANSHUGE

2018-04-27 Thread Michel Dänzer
From: Michel Dänzer Previously, TTM would always (with CONFIG_TRANSPARENT_HUGEPAGE enabled) try to allocate huge pages. However, not all drivers can take advantage of huge pages, but they would incur the overhead for allocating and freeing them anyway. Now, drivers which can take advantage

Re: [PATCH 1/2] drm/ttm: Add TTM_PAGE_FLAG_TRANSHUGE

2018-04-27 Thread Michel Dänzer
[ Dropping Roger He, his e-mail address seems to bounce ] On 2018-04-27 04:51 AM, zhoucm1 wrote: > On 2018年04月26日 23:06, Michel Dänzer wrote: >> From: Michel Dänzer <michel.daen...@amd.com> >> >> When it's set, TTM tries to allocate huge pages if possible. > Do yo

Re: [PATCH 1/2] drm/ttm: Add TTM_PAGE_FLAG_TRANSHUGE

2018-04-27 Thread Michel Dänzer
[ Dropping Roger He, his e-mail address seems to bounce ] On 2018-04-27 04:51 AM, zhoucm1 wrote: > On 2018年04月26日 23:06, Michel Dänzer wrote: >> From: Michel Dänzer >> >> When it's set, TTM tries to allocate huge pages if possible. > Do you mean original driver doesn't

[PATCH 2/2] drm/ttm: Use GFP_TRANSHUGE_LIGHT for allocating huge pages

2018-04-26 Thread Michel Dänzer
From: Michel Dänzer <michel.daen...@amd.com> GFP_TRANSHUGE tries very hard to allocate huge pages, which can result in long delays with high memory pressure. I have observed firefox freezing for up to around a minute due to this while restic was taking a full system backup. Since we don't

[PATCH 2/2] drm/ttm: Use GFP_TRANSHUGE_LIGHT for allocating huge pages

2018-04-26 Thread Michel Dänzer
From: Michel Dänzer GFP_TRANSHUGE tries very hard to allocate huge pages, which can result in long delays with high memory pressure. I have observed firefox freezing for up to around a minute due to this while restic was taking a full system backup. Since we don't really need huge pages, use

[PATCH 1/2] drm/ttm: Add TTM_PAGE_FLAG_TRANSHUGE

2018-04-26 Thread Michel Dänzer
From: Michel Dänzer <michel.daen...@amd.com> When it's set, TTM tries to allocate huge pages if possible. Drivers which can take advantage of huge pages should set it. Drivers not setting this flag no longer incur any overhead related to allocating or freeing huge pages. C

[PATCH 1/2] drm/ttm: Add TTM_PAGE_FLAG_TRANSHUGE

2018-04-26 Thread Michel Dänzer
From: Michel Dänzer When it's set, TTM tries to allocate huge pages if possible. Drivers which can take advantage of huge pages should set it. Drivers not setting this flag no longer incur any overhead related to allocating or freeing huge pages. Cc: sta...@vger.kernel.org Signed-off

Re: [PATCH] drm/radeon: Change the default to PCI on PowerPC

2018-04-25 Thread Michel Dänzer
o #95017) */ > +int radeon_agpmode = -1; > +#else > int radeon_agpmode = 0; > +#endif > int radeon_vram_limit = 0; > int radeon_gart_size = -1; /* auto */ > int radeon_benchmarking = 0; > Pushed to amd-staging-drm-next, thanks! -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer

Re: [PATCH] drm/radeon: Change the default to PCI on PowerPC

2018-04-25 Thread Michel Dänzer
int radeon_agpmode = 0; > +#endif > int radeon_vram_limit = 0; > int radeon_gart_size = -1; /* auto */ > int radeon_benchmarking = 0; > Pushed to amd-staging-drm-next, thanks! -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer

Re: [PATCH 2/3] drm/scheduler: Don't call wait_event_killable for signaled process.

2018-04-24 Thread Michel Dänzer
; entity->fini_status = -ERESTARTSYS; > else > entity->fini_status = wait_event_killable(sched->job_scheduled, > -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer

Re: [PATCH 2/3] drm/scheduler: Don't call wait_event_killable for signaled process.

2018-04-24 Thread Michel Dänzer
fini_status = -ERESTARTSYS; > else > entity->fini_status = wait_event_killable(sched->job_scheduled, > -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer

Re: AMD graphics performance regression in 4.15 and later

2018-04-23 Thread Michel Dänzer
On 2018-04-20 09:40 PM, Felix Kuehling wrote: > On 2018-04-20 10:47 AM, Michel Dänzer wrote: >> On 2018-04-11 11:37 AM, Christian König wrote: >>> Am 11.04.2018 um 06:00 schrieb Gabriel C: >>>> 2018-04-09 11:42 GMT+02:00 Christian König >>>> <ckoenig.l

Re: AMD graphics performance regression in 4.15 and later

2018-04-23 Thread Michel Dänzer
On 2018-04-20 09:40 PM, Felix Kuehling wrote: > On 2018-04-20 10:47 AM, Michel Dänzer wrote: >> On 2018-04-11 11:37 AM, Christian König wrote: >>> Am 11.04.2018 um 06:00 schrieb Gabriel C: >>>> 2018-04-09 11:42 GMT+02:00 Christian König >>>> : >>&g

Re: AMD graphics performance regression in 4.15 and later

2018-04-20 Thread Michel Dänzer
_nodemask to be more precise), called from ttm_alloc_new_pages. At least in the case of Firefox, this happens due to Mesa internal BO allocations for glTex(Sub)Image, so it's not obvious that Firefox is doing something wrong. I never noticed this before this week. Before, I was running 4.15.y + DRM subsystem changes from 4.16. Maybe something has changed in core code, trying harder to allocate huge pages. Maybe TTM should only try to use any huge pages that happen to be available, not spend any (/ "too much"?) additional effort trying to free up huge pages? -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer

Re: AMD graphics performance regression in 4.15 and later

2018-04-20 Thread Michel Dänzer
led from ttm_alloc_new_pages. At least in the case of Firefox, this happens due to Mesa internal BO allocations for glTex(Sub)Image, so it's not obvious that Firefox is doing something wrong. I never noticed this before this week. Before, I was running 4.15.y + DRM subsystem changes from 4.16. Maybe something has changed in core code, trying harder to allocate huge pages. Maybe TTM should only try to use any huge pages that happen to be available, not spend any (/ "too much"?) additional effort trying to free up huge pages? -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer

Re: [RFC] Per file OOM badness

2018-04-04 Thread Michel Dänzer
On 2018-04-04 11:36 AM, Lucas Stach wrote: > Am Mittwoch, den 04.04.2018, 11:09 +0200 schrieb Michel Dänzer: >> On 2018-03-26 04:36 PM, Lucas Stach wrote: >>> Am Dienstag, den 30.01.2018, 11:28 +0100 schrieb Michal Hocko: >>>> On Tue 30-01-18 10:29:10, Michel Dänzer

Re: [RFC] Per file OOM badness

2018-04-04 Thread Michel Dänzer
On 2018-04-04 11:36 AM, Lucas Stach wrote: > Am Mittwoch, den 04.04.2018, 11:09 +0200 schrieb Michel Dänzer: >> On 2018-03-26 04:36 PM, Lucas Stach wrote: >>> Am Dienstag, den 30.01.2018, 11:28 +0100 schrieb Michal Hocko: >>>> On Tue 30-01-18 10:29:10, Michel Dänzer

Re: [RFC] Per file OOM badness

2018-04-04 Thread Michel Dänzer
On 2018-03-26 04:36 PM, Lucas Stach wrote: > Am Dienstag, den 30.01.2018, 11:28 +0100 schrieb Michal Hocko: >> On Tue 30-01-18 10:29:10, Michel Dänzer wrote: >>> On 2018-01-24 12:50 PM, Michal Hocko wrote: >>>> On Wed 24-01-18 12:23:10, Michel Dänzer wrote: >&g

Re: [RFC] Per file OOM badness

2018-04-04 Thread Michel Dänzer
On 2018-03-26 04:36 PM, Lucas Stach wrote: > Am Dienstag, den 30.01.2018, 11:28 +0100 schrieb Michal Hocko: >> On Tue 30-01-18 10:29:10, Michel Dänzer wrote: >>> On 2018-01-24 12:50 PM, Michal Hocko wrote: >>>> On Wed 24-01-18 12:23:10, Michel Dänzer wrote: >&g

Re: [PATCH] radeon: hide pointless #warning when compile testing

2018-02-21 Thread Michel Dänzer
CONFIG_MTRR and CONFIG_X86_PAT for better performance > \ >thanks to write-combining > +#endif > > if (bo->flags & RADEON_GEM_GTT_WC) > DRM_INFO_ONCE("Please enable CONFIG_MTRR and CONFIG_X86_PAT for > " > Merged on the internal amd-sta

Re: [PATCH] radeon: hide pointless #warning when compile testing

2018-02-21 Thread Michel Dänzer
6_PAT for better performance > \ >thanks to write-combining > +#endif > > if (bo->flags & RADEON_GEM_GTT_WC) > DRM_INFO_ONCE("Please enable CONFIG_MTRR and CONFIG_X86_PAT for > " > Merged on the internal amd-staging-drm-next branch, thanks! -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer

Re: [RFC] Per file OOM badness

2018-01-30 Thread Michel Dänzer
On 2018-01-30 12:56 PM, Christian König wrote: > Am 30.01.2018 um 12:42 schrieb Michel Dänzer: >> On 2018-01-30 12:36 PM, Nicolai Hähnle wrote: >>> On 30.01.2018 12:34, Michel Dänzer wrote: >>>> On 2018-01-30 12:28 PM, Christian König wrote: >>>>>

Re: [RFC] Per file OOM badness

2018-01-30 Thread Michel Dänzer
On 2018-01-30 12:56 PM, Christian König wrote: > Am 30.01.2018 um 12:42 schrieb Michel Dänzer: >> On 2018-01-30 12:36 PM, Nicolai Hähnle wrote: >>> On 30.01.2018 12:34, Michel Dänzer wrote: >>>> On 2018-01-30 12:28 PM, Christian König wrote: >>>>>

Re: [RFC] Per file OOM badness

2018-01-30 Thread Michel Dänzer
On 2018-01-30 12:36 PM, Nicolai Hähnle wrote: > On 30.01.2018 12:34, Michel Dänzer wrote: >> On 2018-01-30 12:28 PM, Christian König wrote: >>> Am 30.01.2018 um 12:02 schrieb Michel Dänzer: >>>> On 2018-01-30 11:40 AM, Christian König wrote: >>>>>

Re: [RFC] Per file OOM badness

2018-01-30 Thread Michel Dänzer
On 2018-01-30 12:36 PM, Nicolai Hähnle wrote: > On 30.01.2018 12:34, Michel Dänzer wrote: >> On 2018-01-30 12:28 PM, Christian König wrote: >>> Am 30.01.2018 um 12:02 schrieb Michel Dänzer: >>>> On 2018-01-30 11:40 AM, Christian König wrote: >>>>>

Re: [RFC] Per file OOM badness

2018-01-30 Thread Michel Dänzer
On 2018-01-30 12:28 PM, Christian König wrote: > Am 30.01.2018 um 12:02 schrieb Michel Dänzer: >> On 2018-01-30 11:40 AM, Christian König wrote: >>> Am 30.01.2018 um 10:43 schrieb Michel Dänzer: >>>> [SNIP] >>>>> Would it be ok to hang onto potentially

Re: [RFC] Per file OOM badness

2018-01-30 Thread Michel Dänzer
On 2018-01-30 12:28 PM, Christian König wrote: > Am 30.01.2018 um 12:02 schrieb Michel Dänzer: >> On 2018-01-30 11:40 AM, Christian König wrote: >>> Am 30.01.2018 um 10:43 schrieb Michel Dänzer: >>>> [SNIP] >>>>> Would it be ok to hang onto potentially

Re: [RFC] Per file OOM badness

2018-01-30 Thread Michel Dänzer
On 2018-01-30 11:40 AM, Christian König wrote: > Am 30.01.2018 um 10:43 schrieb Michel Dänzer: >> [SNIP] >>> Would it be ok to hang onto potentially arbitrary mmget references >>> essentially forever? If that's ok I think we can do your process based >>> acc

Re: [RFC] Per file OOM badness

2018-01-30 Thread Michel Dänzer
On 2018-01-30 11:40 AM, Christian König wrote: > Am 30.01.2018 um 10:43 schrieb Michel Dänzer: >> [SNIP] >>> Would it be ok to hang onto potentially arbitrary mmget references >>> essentially forever? If that's ok I think we can do your process based >>> acc

Re: [RFC] Per file OOM badness

2018-01-30 Thread Michel Dänzer
On 2018-01-30 11:42 AM, Daniel Vetter wrote: > On Tue, Jan 30, 2018 at 10:43:10AM +0100, Michel Dänzer wrote: >> On 2018-01-30 10:31 AM, Daniel Vetter wrote: >> >>> I guess a good first order approximation would be if we simply charge any >>> newly allocated bu

Re: [RFC] Per file OOM badness

2018-01-30 Thread Michel Dänzer
On 2018-01-30 11:42 AM, Daniel Vetter wrote: > On Tue, Jan 30, 2018 at 10:43:10AM +0100, Michel Dänzer wrote: >> On 2018-01-30 10:31 AM, Daniel Vetter wrote: >> >>> I guess a good first order approximation would be if we simply charge any >>> newly allocated bu

Re: [RFC] Per file OOM badness

2018-01-30 Thread Michel Dänzer
On 2018-01-30 10:31 AM, Daniel Vetter wrote: > On Wed, Jan 24, 2018 at 01:11:09PM +0100, Christian König wrote: >> Am 24.01.2018 um 12:50 schrieb Michal Hocko: >>> On Wed 24-01-18 12:23:10, Michel Dänzer wrote: >>>> On 2018-01-24 12:01 PM, Michal Hocko wrote: >>

Re: [RFC] Per file OOM badness

2018-01-30 Thread Michel Dänzer
On 2018-01-30 10:31 AM, Daniel Vetter wrote: > On Wed, Jan 24, 2018 at 01:11:09PM +0100, Christian König wrote: >> Am 24.01.2018 um 12:50 schrieb Michal Hocko: >>> On Wed 24-01-18 12:23:10, Michel Dänzer wrote: >>>> On 2018-01-24 12:01 PM, Michal Hocko wrote: >>

Re: [RFC] Per file OOM badness

2018-01-30 Thread Michel Dänzer
On 2018-01-24 12:50 PM, Michal Hocko wrote: > On Wed 24-01-18 12:23:10, Michel Dänzer wrote: >> On 2018-01-24 12:01 PM, Michal Hocko wrote: >>> On Wed 24-01-18 11:27:15, Michel Dänzer wrote: > [...] >>>> 2. If the OOM killer kills a process which is shar

Re: [RFC] Per file OOM badness

2018-01-30 Thread Michel Dänzer
On 2018-01-24 12:50 PM, Michal Hocko wrote: > On Wed 24-01-18 12:23:10, Michel Dänzer wrote: >> On 2018-01-24 12:01 PM, Michal Hocko wrote: >>> On Wed 24-01-18 11:27:15, Michel Dänzer wrote: > [...] >>>> 2. If the OOM killer kills a process which is shar

Re: [RFC] Per file OOM badness

2018-01-24 Thread Michel Dänzer
On 2018-01-24 12:50 PM, Michal Hocko wrote: > On Wed 24-01-18 12:23:10, Michel Dänzer wrote: >> On 2018-01-24 12:01 PM, Michal Hocko wrote: >>> On Wed 24-01-18 11:27:15, Michel Dänzer wrote: > [...] >>>> 2. If the OOM killer kills a process which is shar

Re: [RFC] Per file OOM badness

2018-01-24 Thread Michel Dänzer
On 2018-01-24 12:50 PM, Michal Hocko wrote: > On Wed 24-01-18 12:23:10, Michel Dänzer wrote: >> On 2018-01-24 12:01 PM, Michal Hocko wrote: >>> On Wed 24-01-18 11:27:15, Michel Dänzer wrote: > [...] >>>> 2. If the OOM killer kills a process which is shar

  1   2   3   4   >