Closed Bug 1050267 Opened 12 years ago Closed 12 years ago

[Flame] Add "fastboot oem maxcpus" to limit the number of cores.

Categories

(Firefox OS Graveyard :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(b2g-v2.1 fixed)

RESOLVED FIXED
2.1 S3 (29aug)
Tracking Status
b2g-v2.1 --- fixed

People

(Reporter: nbp, Assigned: nbp)

References

Details

Attachments

(1 external file)

Some of our bugs seems to be dependent on the number of cores that are used on the phone. Currently we are able to change the memory available but not the number of cores. This means that we still have to rely on phones which are not the reference devices to test for single core-related issues. I suggest to add a new fastboot command, such as: # downgrade to a single core-like cpu $ fastboot oem maxcpus 1 # restore the current default on the flame $ fastboot oem maxcpus 2 The idea being to use this to set the maxcpus command line argument, to disable CPUs from the start-up.
I managed to patch the aboot, such as it handles a new maxcpus variable. This works fine for the start-up but apparently when b2g is started it re-enable the second core, which is a shame because then Gecko is initialized thinking that it has multiple cores and not a single one. I'll continue to investigate how Gecko is starting the second core.
This pull request contains 2 patches, one for cleaning up the typo of "oem mem", and another one for adding "oem maxcpus" which is a clone of the code of "oem mem". The main difference between the 2 is that "oem maxcpus" does add 2 command line argument to the kernel. The first one is maxcpus=[1-256] which correspond to the maximum of "online" cpus when the phone is booting up. The second is "nr_cpus=[1-256]", which corresponds to the number of visible cpus.
Attachment #8470841 - Flags: review?(lissyx+mozillians)
No longer blocks: 1015113
Depends on: 1015113
Comment on attachment 8470841 [details] [review] Add "fastboot oem maxcpus" command to limit the number of cpus. Michael is more suited than me to review this. Besides, we can land it but the bootloader is not (yet, hopefully) built by default.
Attachment #8470841 - Flags: review?(lissyx+mozillians) → review?(mwu)
I don't think I'm particularly qualified to review this either, but I can try. I assume you haven't figured out how Gecko/Gonk is restarting the other cores? If we can figure that out, that might give us an easier way to control the number of cores.
(In reply to Michael Wu [:mwu] from comment #4) > I don't think I'm particularly qualified to review this either, but I can > try. > > I assume you haven't figured out how Gecko/Gonk is restarting the other > cores? If we can figure that out, that might give us an easier way to > control the number of cores. To be honest I don't know either what we detect when a core is offline. Restricting the number of core such as they cannot be enabled seems to be a better approach from my point of view.
Comment on attachment 8470841 [details] [review] Add "fastboot oem maxcpus" command to limit the number of cpus. Looks good, or at least mimics the pattern of the other code in here well enough.
Attachment #8470841 - Flags: review?(mwu) → review+
I've updated the patches and added r=mwu in both patches.
Keywords: checkin-needed
yay <3
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 2.1 S3 (29aug)
Looks like we would need to land it also on the kk bootloader branch. I cherry-picked both commit with success. Should we open a new bug?
Flags: needinfo?(nicolas.b.pierron)
Flags: needinfo?(mwu)
(In reply to Alexandre LISSY :gerard-majax from comment #10) > Looks like we would need to land it also on the kk bootloader branch. I > cherry-picked both commit with success. Should we open a new bug? Is the aboot version really different, would it be possible to just merge the two branches?
Flags: needinfo?(nicolas.b.pierron)
Up to you. You can just include uplifts as part of enabling the bootloader build for KK if you want.
Flags: needinfo?(mwu)
Christian, this may be interesting for you.
Flags: needinfo?(cheilmann)
Flags: needinfo?(cheilmann)
Hey I realize we don't have this on kk !
Could we get this on the foxfone-v1.4 branch? That does work well: - ./build.sh out/target/product/flame/bootloader - adb reboot bootloader - fastboot flash aboot out/target/product/flame/bootloader - fastboot reboot-bootloader - fastboot oem maxcpus 1 - fastboot reboot
Flags: needinfo?(ryanvm)
Flags: needinfo?(cbook)
Not sure why you're pinging us about it when it doesn't have approvals for uplift anywhere, which you certainly know is the first step.
Flags: needinfo?(ryanvm)
Flags: needinfo?(cbook)
Comment on attachment 8470841 [details] [review] Add "fastboot oem maxcpus" command to limit the number of cpus. NOTE: Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings. [Approval Request Comment] Bug caused by (feature/regressing bug #): none User impact if declined: developper cannot tune their flame to limit number of CPUs Testing completed: local on several devices Risk to taking this patch (and alternatives if risky): low, it only impacts bootloader String or UUID changes made by this patch: none
Attachment #8470841 - Flags: approval-mozilla-b2g30?
Comment on attachment 8470841 [details] [review] Add "fastboot oem maxcpus" command to limit the number of cpus. Sorry for the spam, we want this for all Flame running KK, so starting with 2.0. NOTE: Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings. [Approval Request Comment] Bug caused by (feature/regressing bug #): N/A User impact if declined: developper cannot tune their Flame to limit the number of CPUs used Testing completed: local testing: cherry-pick, building and flashing as documented above Risk to taking this patch (and alternatives if risky): low, only impacts bootloader code String or UUID changes made by this patch: none
Attachment #8470841 - Flags: approval-mozilla-b2g30? → approval-mozilla-b2g32?
Comment on attachment 8470841 [details] [review] Add "fastboot oem maxcpus" command to limit the number of cpus. Too late to land non-blocking changes on 2.0 at this point, so clearing the approval here.
Attachment #8470841 - Flags: approval-mozilla-b2g32? → approval-mozilla-b2g32-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: