All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Christian König" <christian.koenig@amd.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/4] drm/ttm: add multihop infrastrucutre (v2)
Date: Mon, 9 Nov 2020 23:27:31 +0200	[thread overview]
Message-ID: <20201109212731.GQ6112@intel.com> (raw)
In-Reply-To: <a0179f84-8890-e694-b94c-dbe93605ace5@amd.com>

On Mon, Nov 09, 2020 at 09:48:04PM +0100, Christian König wrote:
> Am 09.11.20 um 17:43 schrieb Ville Syrjälä:
> > On Mon, Nov 09, 2020 at 05:20:17PM +0100, Christian König wrote:
> >> Am 09.11.20 um 17:18 schrieb Ville Syrjälä:
> >>> On Mon, Nov 09, 2020 at 04:57:29PM +0100, Christian König wrote:
> >>>> Am 09.11.20 um 16:16 schrieb Ville Syrjälä:
> >>>>> On Wed, Nov 11, 2020 at 06:13:02PM +0100, Christian König wrote:
> >>>>>> Am 09.11.20 um 01:54 schrieb Dave Airlie:
> >>>>>>> @@ -1432,15 +1479,18 @@ int ttm_bo_swapout(struct ttm_operation_ctx *ctx)
> >>>>>>>      	if (bo->mem.mem_type != TTM_PL_SYSTEM) {
> >>>>>>>      		struct ttm_operation_ctx ctx = { false, false };
> >>>>>>>      		struct ttm_resource evict_mem;
> >>>>>>> +		struct ttm_place hop = {};
> >>>>>> Please always use memset() if you want to zero initialize something in
> >>>>>> the kernel, we had enough trouble with that.
> >>>>> What trouble is that? I've not heard of anything, and we use
> >>>>> ={} quite extensively in drm land.
> >>>> ={} initializes only named fields, not padding.
> >>> Has that actually happened?
> >> YES! Numerous times!
> > You wouldn't happen to have links/etc. to the discussion?
> > I'd like to check them out.
> 
> Uff, that was years ago. Just google for something like "mesa memset 
> hash", there was recently (~ the last year) another discussion because 
> somebody ran into exactly that problem once more.

Found this:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/2071
which does suprise me a bit. Though I suspect ={} might
behave differently since the compiler might treat it
more like a memset().

Also makes me wonder about padding in general, because IIRC
the standard allows padding to be clobbered even after
initialization whenever any member is getting written. So
I think technically there is no guaranteed way to clear
the padding unless you never store anything into the struct.

-- 
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-11-09 21:27 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-09  0:54 ttm multihop split out v2 Dave Airlie
2020-11-09  0:54 ` [PATCH 1/4] drm/ttm: add multihop infrastrucutre (v2) Dave Airlie
2020-11-10 14:34   ` Daniel Vetter
2020-11-11 17:13   ` Christian König
2020-11-09 15:16     ` Ville Syrjälä
2020-11-09 15:57       ` Christian König
2020-11-09 16:18         ` Ville Syrjälä
2020-11-09 16:20           ` Christian König
2020-11-09 16:43             ` Ville Syrjälä
2020-11-09 20:48               ` Christian König
2020-11-09 21:27                 ` Ville Syrjälä [this message]
2020-11-10  5:24                   ` Dave Airlie
2020-11-10 15:47                     ` Ville Syrjälä
2020-11-10 17:11                       ` Daniel Vetter
2020-11-18 13:56                         ` Christian König
2020-11-09  0:54 ` [PATCH 2/4] drm/amdgpu/ttm: use multihop Dave Airlie
2020-11-10 14:38   ` Daniel Vetter
2020-11-11 17:15   ` Christian König
2020-12-13  1:44   ` Mike Lothian
2020-12-14  9:08     ` Daniel Vetter
2020-12-14 20:37       ` Alex Deucher
2020-11-09  0:54 ` [PATCH 3/4] drm/nouveau/ttm: " Dave Airlie
2020-11-09  0:54 ` [PATCH 4/4] drm/radeon/ttm: " Dave Airlie
2020-11-16 12:51   ` Thomas Zimmermann
2020-11-16 14:25     ` Christian König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201109212731.GQ6112@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.