linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: liqiong <liqiong@nfschina.com>, Yonghong Song <yhs@fb.com>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>,
	netdev@vger.kernel.org, bpf@vger.kernel.org,
	linux-kernel@vger.kernel.org, hukun@nfschina.com,
	qixu@nfschina.com, yuzhe@nfschina.com, renyu@nfschina.com
Subject: Re: [PATCH 1/2] kernel/bpf: change "char *" string form to "char []"
Date: Thu, 12 May 2022 22:59:31 +0200	[thread overview]
Message-ID: <92cc4844-5815-c3b0-63be-2e54dc36e1d9@iogearbox.net> (raw)
In-Reply-To: <223f19c0-70a7-3b1f-6166-22d494b62b6e@nfschina.com>

On 5/12/22 7:08 PM, liqiong wrote:
> 在 2022年05月12日 23:16, Yonghong Song 写道:
>>
>> On 5/12/22 7:28 AM, liqiong wrote:
>>> The string form of "char []" declares a single variable. It is better
>>> than "char *" which creates two variables.
>>
>> Could you explain in details about why it is better in generated codes?
>> It is not clear to me why your patch is better than the original code.
> 
> The  string form of "char *" creates two variables in the final assembly output,
> a static string, and a char pointer to the static string.  Use  "objdump -S -D  *.o",
> can find out the static string  occurring  at "Contents of section .rodata".

There are ~360 instances of this type in the tree from a quick grep, do you
plan to convert all them ?

Thanks,
Daniel

  reply	other threads:[~2022-05-12 20:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-12 14:28 [PATCH 1/2] kernel/bpf: change "char *" string form to "char []" liqiong
2022-05-12 15:16 ` Yonghong Song
2022-05-12 17:08   ` liqiong
2022-05-12 20:59     ` Daniel Borkmann [this message]
2022-05-13  2:04       ` liqiong
2022-05-13 11:14       ` David Laight

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=92cc4844-5815-c3b0-63be-2e54dc36e1d9@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=hukun@nfschina.com \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liqiong@nfschina.com \
    --cc=netdev@vger.kernel.org \
    --cc=qixu@nfschina.com \
    --cc=renyu@nfschina.com \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    --cc=yuzhe@nfschina.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).