From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Dave Airlie <airlied@gmail.com>
Cc: "Christian König" <christian.koenig@amd.com>,
dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 1/4] drm/ttm: add multihop infrastrucutre (v2)
Date: Tue, 10 Nov 2020 17:47:59 +0200 [thread overview]
Message-ID: <20201110154759.GR6112@intel.com> (raw)
In-Reply-To: <CAPM=9tyHOoQwhpfAtjREK6mg6zbmNkBuPGYVUpuv8MpP9UDXgA@mail.gmail.com>
On Tue, Nov 10, 2020 at 03:24:32PM +1000, Dave Airlie wrote:
> On Tue, 10 Nov 2020 at 07:27, Ville Syrjälä
> <ville.syrjala@linux.intel.com> wrote:
> >
> > 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().
>
> It doesn't there's a bit of info out there on what happens, it really
> only matters for structs we are passing to userspace, but it's
> unlikely to matter here,
> but I've changed this to memset in my local tree, because why not.
Structs passed to userspace should really have no implicit padding.
One of those how to botch your ioctl things...
The main problems with memset() are:
- it's ugly
- people often get the sizeof wrong
I guess the latter could be alleviated with a cpp macro that
does the sizeof correctly for you.
--
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-11-10 15:48 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ä
2020-11-10 5:24 ` Dave Airlie
2020-11-10 15:47 ` Ville Syrjälä [this message]
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=20201110154759.GR6112@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=airlied@gmail.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.