Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752711AbbHCCmb (ORCPT ); Sun, 2 Aug 2015 22:42:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56469 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752185AbbHCCm3 convert rfc822-to-8bit (ORCPT ); Sun, 2 Aug 2015 22:42:29 -0400 From: Jes Sorensen To: yalin wang Cc: Neil Horman , Thomas Gleixner , Andrew Morton , David Kershner , tj@kernel.org, laijs@cn.fujitsu.com, nacc@linux.vnet.ibm.com, mingo@redhat.com, open list , sparmaintainer@unisys.com Subject: Re: [PATCH v2] kthread: Export kthread functions References: <1437777920-31156-1-git-send-email-david.kershner@unisys.com> <1438099141-8614-1-git-send-email-david.kershner@unisys.com> <20150728142748.a756d7540ad5cdaf4c9efc9e@linux-foundation.org> <20150730120223.GA27430@hmsreliant.think-freely.org> <6440C9D8-37D8-4E30-89D7-04CB96BC8114@gmail.com> <20150801133221.GA6603@neilslaptop.think-freely.org> Date: Sun, 02 Aug 2015 22:42:27 -0400 In-Reply-To: (yalin wang's message of "Mon, 3 Aug 2015 10:23:56 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1594 Lines: 43 yalin wang writes: >> On Aug 1, 2015, at 21:32, Neil Horman 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 > 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 > // 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/