Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1198503
| From | Jes Sorensen <Jes.Sorensen@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2] kthread: Export kthread functions |
| Date | 2015-08-03 04:50 +0200 |
| Message-ID | <pTdZ7-6n8-3@gated-at.bofh.it> (permalink) |
| References | (7 earlier) <pSdRv-8qZ-1@gated-at.bofh.it> <pSjkf-8dP-37@gated-at.bofh.it> <pSzfk-66H-7@gated-at.bofh.it> <pSFb3-68V-5@gated-at.bofh.it> <pTdFL-60J-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH v2] kthread: Export kthread functions Andrew Morton <akpm@linux-foundation.org> - 2015-07-28 23:30 +0200
Re: [PATCH v2] kthread: Export kthread functions yalin wang <yalin.wang2010@gmail.com> - 2015-07-30 05:50 +0200
Re: [PATCH v2] kthread: Export kthread functions yalin wang <yalin.wang2010@gmail.com> - 2015-07-31 06:20 +0200
Re: [PATCH v2] kthread: Export kthread functions yalin wang <yalin.wang2010@gmail.com> - 2015-08-03 04:30 +0200
Re: [PATCH v2] kthread: Export kthread functions Jes Sorensen <Jes.Sorensen@redhat.com> - 2015-08-03 04:50 +0200
csiph-web