Skip to contentSkip to conversation

webkit-gtk: limit ld memory requirement

PATCH In review Joe Slater 8 participants 13 messages Sep 13, 2013 – Sep 24, 2013

lore
Share & tools
lore

Joe Slater

author
#0 lore raw

PATCH 1/1 webkit-gtk: limit ld memory requirement

Add --no-keep-memory to LDFLAGS.

---
 meta/recipes-sato/webkit/webkit-gtk_1.8.3.bb |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
meta/recipes-sato/webkit/webkit-gtk_1.8.3.bb +4 -0
index 5691d3f..9304243 100644
@@ -58,6 +58,10 @@ CPPFLAGS_append_powerpc = " -I${STAGING_INCDIR}/pango-1.0 \
                             -I${STAGING_LIBDIR}/glib-2.0/include \
                             -I${STAGING_INCDIR}/glib-2.0"
 
+# ld can run out of memory linking libwebkitgtk!
+#
+LDFLAGS += "-Wl,--no-keep-memory"
+
 EXTRA_AUTORECONF = " -I Source/autotools "
 
 
Signature · 1 line
1.7.3.4
#1 lore raw
Quoted 1 line · Joe Slater

Add --no-keep-memory to LDFLAGS.

It does not come with out a price. Have you measured how much performance degradation it brings in ?
We need that to assess the trade off and also describe the machine configuration where this option is helping

Quoted 31 lines
Signed-off-by Joe Slater <[email protected] <javascript:;>>
---
 meta/recipes-sato/webkit/webkit-gtk_1.8.3.bb |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

webkit-gtk_1.8.3.bb
index 5691d3f..9304243 100644

meta/recipes-sato/webkit/webkit-gtk_1.8.3.bb +4 -2
@@ -58,6 +58,10 @@ CPPFLAGS_append_powerpc = "
-I${STAGING_INCDIR}/pango-1.0 \
                             -I${STAGING_LIBDIR}/glib-2.0/include \
                             -I${STAGING_INCDIR}/glib-2.0"
 
+# ld can run out of memory linking libwebkitgtk!
+#
+LDFLAGS += "-Wl,--no-keep-memory"
+
 EXTRA_AUTORECONF = " -I Source/autotools "
 
 
--

1.7.3.4

_______________________________________________
Openembedded-core mailing list [email protected] <javascript:;>
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#2 lore raw
Quoted 4 lines · Khem Raj
Quoted 1 line · Joe Slater

Add --no-keep-memory to LDFLAGS.

I think it was discussed on this ML before and conclusion was that it's distro/builder policy and shouldn't be default in the recipe.

Quoted 42 lines

It does not come with out a price. Have you measured how much performance degradation it brings in ?
We need that to assess the trade off and also describe the machine configuration where this option is helping

Quoted 26 lines
Signed-off-by Joe Slater <[email protected] <javascript:;>>
---
 meta/recipes-sato/webkit/webkit-gtk_1.8.3.bb |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

webkit-gtk_1.8.3.bb
index 5691d3f..9304243 100644

meta/recipes-sato/webkit/webkit-gtk_1.8.3.bb +4 -2
@@ -58,6 +58,10 @@ CPPFLAGS_append_powerpc = "
-I${STAGING_INCDIR}/pango-1.0 \
                             -I${STAGING_LIBDIR}/glib-2.0/include \
                             -I${STAGING_INCDIR}/glib-2.0"
 
+# ld can run out of memory linking libwebkitgtk!
+#
+LDFLAGS += "-Wl,--no-keep-memory"
+
 EXTRA_AUTORECONF = " -I Source/autotools "
 
 
--

1.7.3.4

Quoted 5 lines

_______________________________________________
Openembedded-core mailing list [email protected] <javascript:;>
http://lists.openembedded.org/mailman/listinfo/openembedded-core

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#3 lore raw
In reply to Khem Raj
Quoted 4 lines · Khem Raj

It does not come with out a price. Have you measured how much performance degradation it brings in ?
We need that to assess the trade off and also describe the machine configuration where this option is helping

Agreed - there's a bug which is tracking this from Kai. As far as I'm aware the failure cases are 32-bit hosts (3GB limit per process) or 64-bit hosts with limited memory. I suggested that we benchmark with and without this - if the performance hit is measured in seconds then we can probably enable it for this recipe out of the box.

Ross

#4 lore raw
Quoted 6 lines · Ross
Quoted 4 lines · Khem Raj

It does not come with out a price. Have you measured how much performance degradation it brings in ?
We need that to assess the trade off and also describe the machine configuration where this option is helping

Quoted 6 lines

Agreed - there's a bug which is tracking this from Kai. As far as I'm aware the failure cases are 32-bit hosts (3GB limit per process) or 64-bit hosts with limited memory. I suggested that we benchmark with and without this - if the performance hit is measured in seconds then we can probably enable it for this recipe out of the box.

Joe / Kai:

Please test as Khem and Ross suggest and report back with the results, also please include the [YOCTO #5160].

Ross, I am going to assign this to Joe.

Sau!

Quoted 7 lines

Ross
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#5 lore raw
Quoted 13 lines · Saul Wold
Quoted 6 lines · Ross
Quoted 4 lines · Khem Raj

It does not come with out a price. Have you measured how much performance degradation it brings in ?
We need that to assess the trade off and also describe the machine configuration where this option is helping

Quoted 6 lines

Agreed - there's a bug which is tracking this from Kai. As far as I'm aware the failure cases are 32-bit hosts (3GB limit per process) or 64-bit hosts with limited memory. I suggested that we benchmark with and without this - if the performance hit is measured in seconds then we can probably enable it for this recipe out of the box.

Quoted 3 lines

Joe / Kai:

Please test as Khem and Ross suggest and report back with the results, also please include the [YOCTO #5160].

run command 'time bitbake webkit-gtk -c compile' on the host which failed:

without patch till compile fails:
real 49m2.496s
user 102m47.789s
sys 31m18.698s

with the patch:
real 44m9.000s
user 106m45.182s
sys 30m53.223s

On the host build doesn't fail:

Without patch:
real 76m1.646s
user 86m36.704s
sys 38m39.103s

With patch:
real 63m36.193s
user 86m9.274s
sys 37m48.431s

It seems the link option doesn't increase the compile time.

Regards,
Kai

Quoted 14 lines

Ross, I am going to assign this to Joe.

Sau!

Quoted 7 lines

Ross
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Signature · 2 lines
Regards,
Neil | Kai Kang
#6 lore raw
Quoted 11 lines · Kang Kai

Without patch:
real 76m1.646s
user 86m36.704s
sys 38m39.103s

With patch:
real 63m36.193s
user 86m9.274s
sys 37m48.431s

It seems the link option doesn't increase the compile time.

on the contrary its reducing the build time which is kind of interesting and seems a win-win. are you able to extract the failing link command and just run that with/without the linker option to discard memory ? and measure just the linking time on the host where it already builds without this option?

#7 lore raw
Quoted 11 lines · Khem Raj
Quoted 10 lines · Kang Kai

Without patch:
real 76m1.646s
user 86m36.704s
sys 38m39.103s

With patch:
real 63m36.193s
user 86m9.274s
sys 37m48.431s

Quoted 7 lines
Quoted 1 line

It seems the link option doesn't increase the compile time.

on the contrary its reducing the build time which is kind of interesting and seems a win-win. are you able to extract the failing link command and just run that with/without the linker option to discard memory ? and measure just the linking time on the host where it already builds without this option?

I think someone should measure it on machine with a lot of ram. If the test was executed on machine where it was linking mostly from swap, then it's not so surprising it was faster with the option enabled.

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#8 lore raw
Quoted 3 lines · Martin Jansa

I think someone should measure it on machine with a lot of ram. If the test was executed on machine where it was linking mostly from swap, then it's not so surprising it was faster with the option enabled.

My very rough test says no significant difference between the option being enabled or disabled (~23m +- 30s each way). i7 with 16GB RAM.

Anyone else want to add a data point?

Ross

#9 lore raw
Quoted 10 lines

-----Original Message-----
From: Burton, Ross [mailto:[email protected]]
Sent: Tuesday, September 17, 2013 3:53 AM
To: Martin Jansa
Cc: Khem Raj; Slater, Joseph; Patches and discussions about the oe-core layer
Subject: Re: [OE-core] [PATCH 1/1] webkit-gtk: limit ld memory requirement

On 17 September 2013 11:30, Martin Jansa <[email protected]> wrote:

Quoted 8 lines
Quoted 3 lines

I think someone should measure it on machine with a lot of ram. If the test was executed on machine where it was linking mostly from swap, then it's not so surprising it was faster with the option enabled.

My very rough test says no significant difference between the option being enabled or disabled (~23m +- 30s each way). i7 with 16GB RAM.

Anyone else want to add a data point?

I am the only user on the machine below. I compiled twice, each way --

model name	: Intel(R) Xeon(R) CPU           X5560  @ 2.80GHz
model name	: Intel(R) Xeon(R) CPU           X5560  @ 2.80GHz
model name	: Intel(R) Xeon(R) CPU           X5560  @ 2.80GHz
model name	: Intel(R) Xeon(R) CPU           X5560  @ 2.80GHz
model name	: Intel(R) Xeon(R) CPU           X5560  @ 2.80GHz
model name	: Intel(R) Xeon(R) CPU           X5560  @ 2.80GHz
model name	: Intel(R) Xeon(R) CPU           X5560  @ 2.80GHz
model name	: Intel(R) Xeon(R) CPU           X5560  @ 2.80GHz

MemTotal: 12326492 kB

build - present recipe
----------------------
real 48m26.620s
user 96m15.939s
sys 17m43.639s

compile - present recipe
------------------------
real 25m39.845s
user 85m31.102s
sys 10m17.016s

real 25m31.344s
user 85m35.210s
sys 9m46.309s

compile - new recipe
------------------------
real 25m28.338s
user 85m27.088s
sys 10m19.696s

real 25m22.355s
user 85m24.133s
sys 10m13.151s

Quoted 2 lines

Ross

#10 lore raw
Quoted 3 lines · Joseph
Quoted 1 line

Anyone else want to add a data point?

I am the only user on the machine below. I compiled twice, each way --

[snip]

Unless I'm reading that wrong, it looks like again its actually a small win to use -no-keep-memory. Sounds like we should just add it.

Ross

#11 lore raw
Quoted 9 lines · Ross
Quoted 3 lines · Joseph
Quoted 1 line

Anyone else want to add a data point?

I am the only user on the machine below. I compiled twice, each way --

[snip]

Unless I'm reading that wrong, it looks like again its actually a small win to use -no-keep-memory. Sounds like we should just add it.

Its in.

Cheers,

Richard

#12 lore raw
In reply to Burton, Ross
Quoted 10 lines · Ross
Quoted 3 lines · Joseph
Quoted 1 line

Anyone else want to add a data point?

I am the only user on the machine below. I compiled twice, each way --

[snip]

Unless I'm reading that wrong, it looks like again its actually a small win to use -no-keep-memory. Sounds like we should just add it.

yes indeed. Thanks all for chiming in.

Quoted 1 line

Ross