All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: yalin wang <yalin.wang2010@gmail.com>
Cc: Neil Horman <nhorman@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	David Kershner <david.kershner@unisys.com>,
	tj@kernel.org, laijs@cn.fujitsu.com, nacc@linux.vnet.ibm.com,
	mingo@redhat.com, open list <linux-kernel@vger.kernel.org>,
	sparmaintainer@unisys.com
Subject: Re: [PATCH v2] kthread: Export kthread functions
Date: Sun, 02 Aug 2015 22:42:27 -0400	[thread overview]
Message-ID: <wrfjwpxdf5yk.fsf@carbonite.lan.trained-monkey.org> (raw)
In-Reply-To: <D33E7A95-05FC-423E-94FE-012949566988@gmail.com> (yalin wang's message of "Mon, 3 Aug 2015 10:23:56 +0800")

yalin wang <yalin.wang2010@gmail.com> writes:
>> On Aug 1, 2015, at 21:32, Neil Horman <nhorman@redhat.com> wrote:
>>> strange,  this is my test result:
>>> 
>>> size   built-in.o*
>>>  text	   data	    bss	    dec	    hex	filename
>>> 743937 50786 56008 850731 cfb2b built-in.o // with the patch
>>> 744069 50786 56008 850863 cfbaf built-in.o_old // with out the
>>> patch
>>> 
>> So you're willing to expose the internals of kthread_park in exchange for the
>> hope of saving 132 bytes of text.
>> 
>> Thats just dumb.  I agree with tglx, this shouldn't change.
>> 
>> Neil
> not just size, mainly for performance,
> without inline:
>
> ffffffc0000d26b0: 97fff4aa bl ffffffc0000cf958 <kthread_should_park>
> ffffffc0000d26b4:       53001c00        uxtb    w0, w0
>
> if kthread_should_park() inline:
> ffffffc0000d1a44: f85c8020 ldr x0, [x1,#-56] // kthread_should_park
> line
> ffffffc0000d1a48: 36100300 tbz w0, #2, ffffffc0000d1aa8
> <smpboot_thread_fn+0xbc> // kthread_should_park line
>
> still use 2 instructions, but don’t need a function call,
> maybe can do more optimisation by gcc sometimes .
> Anyway, this is just a suggest,
> it is up to you apply it or not. :) 

kthread_park() isn't exactly a performance critical function call.
Saving two instructions does not outway the cost of exposing the
internals of the kthread API.

Jes

      reply	other threads:[~2015-08-03  2:42 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-24 22:45 [PATCH] kthread: Export kthread functions David Kershner
2015-07-24 23:14 ` Neil Horman
2015-07-25 12:05 ` Richard Weinberger
2015-07-26  0:50   ` Kershner, David A
2015-07-26  8:46   ` Thomas Gleixner
2015-07-27 15:45 ` Ingo Molnar
2015-07-27 15:49   ` Neil Horman
2015-07-27 16:01     ` Kershner, David A
2015-07-28 15:59 ` [PATCH v2] " David Kershner
2015-07-28 21:27   ` Andrew Morton
2015-07-29 10:34     ` Thomas Gleixner
2015-07-30  3:48       ` yalin wang
2015-07-30 12:02         ` Neil Horman
2015-07-31  4:16           ` yalin wang
2015-07-31  8:19             ` Thomas Gleixner
2015-07-31 14:14               ` Thomas Gleixner
2015-08-01  7:12                 ` yalin wang
2015-08-01  7:20                   ` Thomas Gleixner
2015-08-01 13:32                   ` Neil Horman
2015-08-03  2:23                     ` yalin wang
2015-08-03  2:42                       ` Jes Sorensen [this message]

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=wrfjwpxdf5yk.fsf@carbonite.lan.trained-monkey.org \
    --to=jes.sorensen@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=david.kershner@unisys.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=nacc@linux.vnet.ibm.com \
    --cc=nhorman@redhat.com \
    --cc=sparmaintainer@unisys.com \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=yalin.wang2010@gmail.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 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.