All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>, WeiLiu <wl@xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Tim Deegan <tim@xen.org>, Ian Jackson <ian.jackson@citrix.com>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [Xen-devel] [PATCH] xen/typesafe: Force helpers to be always_inline
Date: Tue, 1 Oct 2019 21:59:39 +0100	[thread overview]
Message-ID: <41d5ccea-b58c-ed3b-5cc8-8966d2850125@citrix.com> (raw)
In-Reply-To: <f8eb4fdc-bec8-a6cd-2657-f163169eeee5@suse.com>

On 01/10/2019 09:38, Jan Beulich wrote:
> On 30.09.2019 21:16, Andrew Cooper wrote:
>> Clang in particular has a habit of out-of-lining these and creating multiple
>> local copies of _mfn() and mfn_x(), etc.  Override this behaviour.
> Is special casing the typesafe helpers then the right approach? The
> fundamental idea after all is to let the compiler decide. I certainly
> agree that not inlining such trivial functions despite the inline
> keyword looks far from optimal, but if there's such a general issue
> with clang, shouldn't we make "inline" expand to "always_inline"
> uniformly?

Inline handing is a mess.

We currently define inline to __inline__.  Undoing this results in build
failures.

Linux currently defines inline to always_inline and they are desperately
trying to undo this (mis)behaviour.

There are a few uses of always_inline for safety purposes (the
speculative helpers).  Most uses of always_inline look to be workarounds
for the size-of-asm bug/(mis)feature.

In an ideal world, we wouldn't need it at all, but I definitely don't
think that taking the Linux approach is a clever move.  We definitely
have some static inlines which would better not being inline.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-10-01 21:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-30 19:16 [Xen-devel] [PATCH] xen/typesafe: Force helpers to be always_inline Andrew Cooper
2019-10-01  6:34 ` Jürgen Groß
2019-10-01  8:38 ` Jan Beulich
2019-10-01 20:59   ` Andrew Cooper [this message]
2019-10-02  8:11     ` Jan Beulich
2019-10-04 17:02       ` George Dunlap
2019-10-07  9:25         ` Jan Beulich
2019-10-21 11:10           ` George Dunlap
2019-10-23  7:27             ` Jan Beulich
2019-10-23  9:37               ` George Dunlap
2019-10-23 10:43                 ` Jan Beulich

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=41d5ccea-b58c-ed3b-5cc8-8966d2850125@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=ian.jackson@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=julien@xen.org \
    --cc=konrad.wilk@oracle.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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.