All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Nicholas Piggin <npiggin@gmail.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	linux-arch <linux-arch@vger.kernel.org>,
	Michal Marek <mmarek@suse.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	kbuild test robot <fengguang.wu@intel.com>,
	Josh Triplett <josh@joshtriplett.org>,
	Nicolas Pitre <nicolas.pitre@linaro.org>
Subject: Re: [PATCH 1/5] kbuild: thin archives final link close --whole-archives option
Date: Fri, 23 Jun 2017 16:57:34 +0200	[thread overview]
Message-ID: <20170623145734.7pv3rdgucveg66s3@flea.lan> (raw)
In-Reply-To: <CAK7LNATbd5n2uMsTN_jaUN+QjpB5DN3AvS+6iqqt3w3kuwQS3A@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4359 bytes --]

On Fri, Jun 23, 2017 at 02:31:40PM +0900, Masahiro Yamada wrote:
> Hi Nicholas,
> 
> 2017-06-23 0:50 GMT+09:00 Nicholas Piggin <npiggin@gmail.com>:
> > On Thu, 22 Jun 2017 08:18:38 +0200
> > Maxime Ripard <maxime.ripard@free-electrons.com> wrote:
> >
> >> On Wed, Jun 21, 2017 at 10:55:06PM +0200, Arnd Bergmann wrote:
> >> > On Wed, Jun 21, 2017 at 8:08 PM, Nicholas Piggin <npiggin@gmail.com> wrote:
> >> > > On Wed, 21 Jun 2017 09:19:13 -0700
> >> > > Stephen Boyd <sboyd@codeaurora.org> wrote:
> >> > >> On 06/21, Arnd Bergmann wrote:
> >> > >>
> >> > >> Ok. Can you send a revert patch to the list with some information
> >> > >> on why we can't do the hack anymore and also Cc lkml/kbuild
> >> > >> lists? The commit is in linux-next now as commit 06e226c7fb23
> >> > >> (clk: sunxi-ng: Move all clock types to a library, 2017-06-02).
> >> > >>
> >> > >
> >> > > I grabbed this patch and applied it to the kbuid/thin-ac tree. I tested
> >> > > with thin archives enabled and disabled with arm defconfig which ends up
> >> > > setting CONFIG_SUNXI_CCU=y.
> >> > >
> >> > > The patch makes no difference to vmlinux size whether using traditional
> >> > > incremental link, or thin archives (there is a small difference between
> >> > > inclink and thinarc but that's unrelated).
> >> > >
> >> > > So this thin archives change does not break your patch, it's just that
> >> > > it doesn't really do the right thing. I like the general idea, but we
> >> > > need to work out how to make it properly supported by the build system.
> >> > >
> >> > > With the patch applied, this is what the build system currently does:
> >> > >
> >> > > arm-linux-gnueabihf-ld -EL    -r -o drivers/clk/sunxi-ng/built-in.o drivers/clk/sunxi-ng/ccu-sun5i.o drivers/clk/sunxi-ng/ccu-sun6i-a31.o drivers/clk/sunxi-ng/ccu-sun8i-a23.o drivers/clk/sunxi-ng/ccu-sun8i-a33.o drivers/clk/sunxi-ng/ccu-sun8i-h3.o drivers/clk/sunxi-ng/ccu-sun8i-v3s.o drivers/clk/sunxi-ng/ccu-sun8i-r.o drivers/clk/sunxi-ng/ccu-sun9i-a80.o drivers/clk/sunxi-ng/ccu-sun9i-a80-de.o drivers/clk/sunxi-ng/ccu-sun9i-a80-usb.o drivers/clk/sunxi-ng/lib.a drivers/clk/sunxi-ng/lib-ksyms.o
> >> > >
> >> > > This incremental link pulls in all your lib.a objects and links them
> >> > > into built-in.o. They can no longer be selectively linked.
> >> >
> >> > I think the ARM defconfig actually needs all those objects because it
> >> > enables all the high-level drivers. You could try disabling e.g. all except
> >> > CONFIG_SUN8I_DE2_CCU if you want the objects to actually becomes
> >> > unused.
> >>
> >> You can also disable MACH_SUN8I, it should disable a significant
> >> number of the clocks driver.
> >
> >    text    data     bss     dec     hex filename
> > 11655078        6018736  418944 18092758        11412d6 vmlinux.inclink
> > 11655078        6018736  418944 18092758        11412d6 vmlinux.inclink.clk
> > 11650534        6010288  418616 18079438        113dece vmlinux.thinarc
> > 11650534        6010288  418616 18079438        113dece vmlinux.thinarc.clk
> >
> > Same result for me when compiling defconfig minus MACH_SUN8I, comparing
> > +/- the clock patch and thin archives. No size savings. As I explained
> > already, I really can't see how there could be any saving if the lib.a is
> > incrementally linked into built-in.o.
> 
> I think defconfig minus MACH_SUN8I
> will give no difference to CONFIG_SUNXI_CCU*
> 
> As far as I tried,  minus MACH_SUN8I still enabled the following:
> CONFIG_SUNXI_CCU=y
> CONFIG_SUNXI_CCU_DIV=y
> CONFIG_SUNXI_CCU_FRAC=y
> CONFIG_SUNXI_CCU_GATE=y
> CONFIG_SUNXI_CCU_MUX=y
> CONFIG_SUNXI_CCU_MULT=y
> CONFIG_SUNXI_CCU_PHASE=y
> CONFIG_SUNXI_CCU_NK=y
> CONFIG_SUNXI_CCU_NKM=y
> CONFIG_SUNXI_CCU_NKMP=y
> CONFIG_SUNXI_CCU_NM=y
> CONFIG_SUNXI_CCU_MP=y
> 
> I think you need to disable some more MACH_SUN*I and
> perhaps disable some CONFIG_SUN*I_*_CCU explicitly,
> then you will see difference in the result.

Ah, right, it's all selected by the rest.

I guess to get a meaningful example you could disable all the
SUN*I_CCU (SUN5I, SUN8I, and the likes) options and while keeping
SUN8I_R_CCU.

Most of the clock types shouldn't be used but div and gates.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  reply	other threads:[~2017-06-23 14:57 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-09  5:24 [PATCH 0/5] move everyone over to thin archives Nicholas Piggin
2017-06-09  5:24 ` [PATCH 1/5] kbuild: thin archives final link close --whole-archives option Nicholas Piggin
2017-06-19  6:16   ` Masahiro Yamada
2017-06-19  6:51     ` Nicholas Piggin
2017-06-19  8:14       ` Masahiro Yamada
2017-06-19  8:27         ` Nicholas Piggin
2017-06-19  8:35           ` Masahiro Yamada
2017-06-19 15:52             ` Nicholas Piggin
2017-06-19 23:48               ` Josh Triplett
2017-06-21  1:17               ` Masahiro Yamada
2017-06-21  2:47                 ` Nicholas Piggin
2017-06-21  3:29                   ` Masahiro Yamada
2017-06-21  4:04                     ` Nicholas Piggin
2017-06-21  7:15                       ` Arnd Bergmann
2017-06-21  9:16                         ` Nicholas Piggin
2017-06-21 10:21                           ` Arnd Bergmann
2017-06-21 10:38                             ` Nicholas Piggin
2017-06-21 10:49                               ` Arnd Bergmann
2017-06-21 10:51                                 ` Arnd Bergmann
2017-06-21 11:10                                 ` Nicholas Piggin
2017-06-21 11:32                                   ` Arnd Bergmann
2017-06-21 12:02                                     ` Nicholas Piggin
2017-06-21 12:21                                       ` Arnd Bergmann
2017-06-21 16:19                                         ` Stephen Boyd
2017-06-21 18:08                                           ` Nicholas Piggin
2017-06-21 20:55                                             ` Arnd Bergmann
2017-06-22  6:18                                               ` Maxime Ripard
2017-06-22 15:50                                                 ` Nicholas Piggin
2017-06-23  5:31                                                   ` Masahiro Yamada
2017-06-23 14:57                                                     ` Maxime Ripard [this message]
2017-06-23 15:04                                                       ` Arnd Bergmann
2017-06-25  3:55                                                         ` Masahiro Yamada
2017-06-27 15:42                                                         ` Maxime Ripard
2017-06-21 20:52                                     ` Arnd Bergmann
2017-06-21 21:30                                       ` Nicholas Piggin
2017-06-21 21:44                                         ` Arnd Bergmann
2017-06-22 16:12                                 ` Nicholas Piggin
2017-06-09  5:24 ` [PATCH 2/5] kbuild: thin archives use P option to ar Nicholas Piggin
2017-06-19  6:17   ` Masahiro Yamada
2017-06-19  6:52     ` Nicholas Piggin
2017-06-09  5:24 ` [PATCH 3/5] sh: thin archives fix linking Nicholas Piggin
2017-06-09  5:24   ` Nicholas Piggin
2017-06-19  6:19   ` Masahiro Yamada
2017-06-19  6:19     ` Masahiro Yamada
2017-06-21 22:09     ` Rob Landley
2017-06-21 22:09       ` Rob Landley
2017-06-09  5:24 ` [PATCH 4/5] x86/um: thin archives build fix Nicholas Piggin
2017-06-19  6:21   ` Masahiro Yamada
2017-06-09  5:24 ` [PATCH 5/5] kbuild: thin archives make default for all archs Nicholas Piggin
2017-06-19  6:22   ` Masahiro Yamada
2017-06-19  6:55     ` Nicholas Piggin
2017-06-17 13:10 ` [PATCH 0/5] move everyone over to thin archives Nicholas Piggin
2017-06-19  6:30   ` Masahiro Yamada

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=20170623145734.7pv3rdgucveg66s3@flea.lan \
    --to=maxime.ripard@free-electrons.com \
    --cc=arnd@arndb.de \
    --cc=fengguang.wu@intel.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=mmarek@suse.com \
    --cc=nicolas.pitre@linaro.org \
    --cc=npiggin@gmail.com \
    --cc=sboyd@codeaurora.org \
    --cc=sfr@canb.auug.org.au \
    --cc=torvalds@linux-foundation.org \
    --cc=yamada.masahiro@socionext.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.