yashsingh1/xdaforums huggingface dataset:
[Samsung Galaxy Nexus] temporaryone:
Thanks for the assistance! but to clarify, i did follow ph4zrd's method completely including using script manager to install and run the script su as noted :) (100% stock image yakju doesnt support init.d ?) and it works.

What i was saying is that I did (before this) what most people would regard as a fix, which was a plain vanilla factory reset with no mods, and that only held for a few hours, just amping up the frustration levels- until i finally found this several weeks later (been travelling-with a dodgy phone). Utterly ridiculous that me as a user had to spend all that time fixing their faults.

Kittens are purring with these fixes still working !
[Samsung Galaxy Nexus] Jar3112:
Yes, I perfectly understand. I too was angry to find my brand new phone unusable!

We all hope for a fix, meanwhile this is a solution...

Sent from my Galaxy Nexus
[Samsung Galaxy Nexus] kuba144:
Many thanks for this thread!

I got the same situation. I unlocked phone, rooted and followed tutorial. Now it is buttery smooth as it was when i first turned it on.

Only one question. Is there any side effect using this solution? I have SSD in my notebook and i had to add "discard" to fstab to turn on TRIM. So why isn't it default option in Android? Do we have a special chip that requires TRIM or what?
[Samsung Galaxy Nexus] stocaprimo:
If you want to speed up the temporary file creation use adb when in recovery mode ( for the one with clockworkmod/twrp ). ;)

Anyway, this workaround solved only partially the issue: the random write speed is very slow ( 0.45mb/s ) and the phone still laggy. Both /data and /cache are mounted with "discard" option. Very frustrating. :\

/dev/block/platform/omap/omap_hsmmc.0/by-name/cache /cache ext4 rw,nosuid,nodev,noatime,errors=panic,user_xattr,acl,barrier=0,nomblk_io_submit,data=writeback,noauto_da_alloc,discard 0 0
/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata /data ext4 rw,nosuid,nodev,noatime,errors=panic,user_xattr,acl,barrier=1,nomblk_io_submit,data=writeback,noauto_da_alloc,discard 0 0
[Samsung Galaxy Nexus] DriftGT:
I have this problem to

Look at my bench:

Sequencial Read: 24.18

Sequencial Write: 0.38

Random Read: 8.86

Random Write: 0.05

This is really boring :(

I am using CM10.1 + Trinity kernel at the moment

My chip is a V3U00M 08/2012
[Samsung Galaxy Nexus] L00n:
you have like mine.

install rom toolbox and put the script to run on every boot.

this helped me a lot.
[Samsung Galaxy Nexus] Craxx:
You can also flash franco or ak kernel, they have the mount incl. ;)

Send from my Xoom with Jelly Bean 4.2.1 Mz601
[Samsung Galaxy Nexus] kissme99:
You mean that franco/ak kernel supports this script, or on their kernel this issue doesn't exist?
[Samsung Galaxy Nexus] Craxx:
... The issue is fixed with these kernels.

Craxx;)

Send from my Galaxy Nexus with Tapatalk :)
[Samsung Galaxy Nexus] kissme99:
Nope, it isn't fixed, because I am running franco kernel and I still have got this issue.

Anyway, anyone know if on the 4.1.x Android this problem exist?

What do you think, will Google fix it in next Android update?
[Samsung Galaxy Nexus] Craxx:
You can check if kernel fixed the problem by opening a terminal and the su and then mount then when it is fixed you see the discard option if not you didn't see.

For me at this time with purity 05 it is fixed. And when i remember right then it was also fixed on franco 348.

Craxx;)

Send from my Galaxy Nexus with Tapatalk :)
[Samsung Galaxy Nexus] kissme99:
I see the discard option i the terminal, but don't know why when I have got less than 3GB free my Nexus is getting slow, it's unusable.

When I flash any ROM with a lot of free memory then it runs ok.

So, any solution for my problem?
[Samsung Galaxy Nexus] Craxx:
Hmmm i have almost min 5gb free so i don't have the problem...

Craxx;)

Send from my Galaxy Nexus with Tapatalk :)
[Samsung Galaxy Nexus] wkwkwk:
Hi,

Is the discard option working if using full encryption?

Thanks.

-- update --

I've removed encryption by deleting everything and restoring to factory defaults. I've then restored from a TWRP backup.

SEQ write is still at 0.4MB/s.

I've tried remount,discard, filled /data with dd, rm, sync and AndroBench is still reporting ~0.4MB/s SEQ Write.

Any thoughts?

Thanks.

--- update ---

I've restored a factory image using fastboot and the writes are now at 11MB/sec. Restored afterwards the CM10 backup and the writes are now fine.

I'm not sure what to do with the encryption as I'd like to have it encrypted but I don't know what the impact will be on the performance.

--- another update --

After encryption the performance degraded immediately so it looks like that's a no go.
[Samsung Galaxy Nexus] ph4zrd:
FYI: Unpacked the images of both kernels today.

In purity kernel it indeed is added to fstab, in franco kernel that's not the case, also not added to any init script.

A similar workaround might be applied to encrypted devices, although it could be different.

As I have no idea how the encryption is done and how the file system structure looks like on an encrypted phone and don't have the time to try it out, I can't help you there.

Maybe the output of mount from an encrypted device could help figuring it out.
[Samsung Galaxy Nexus] standa75:
I am using encrypted Maguro without problems. Writes are about 10mbs with purity 7 kernel and xylon v14.

Hope this helped you.
[Samsung Galaxy Nexus] Jar3112:
Hi, I have a question.

I followed the instructions in this thread, finding them very useful, though I can't understand one thing.

After running the commands in adb to clean the "free" space, I put the script in init.d folder, adding the remount option to /data and /cache.

This way, every time I delete something from /data/media (sdcard) it shouldn't leave rubbish behind, slowing down write speed, at least this is what I understood.

But, after a while, performances decrease anyway.

Immediately after the adb cleaning my random writes, tested with Androbench, are around 0.5 Mbps, while after some days the average lowers down to 0.35/0.4 Mbps (remaining stable afterwards).

Is there something wrong or missing in the init.d script?

Here it is its content.

#!/system/bin/sh

mount -o remount,discard /data

mount -o remount,discard /cache

Thank you for your help.

Sent from my Galaxy Nexus
[Samsung Galaxy Nexus] ph4zrd:
This sounds a littele bit strange but as your minimal random write speed is still above that of a GNex with the "old" VYL00M chip (~0.2-0.3 MiB/s), I wouldn't care much about it.

Are your sequential write speeds also lower after some days of normal usage?

The init.d script is correct. You can check if the discard option is applied by typing mount in terminal or adb shell and looking at the line with userdata in it if it contains discard ;)
[Samsung Galaxy Nexus] Jar3112:
I suppose sequential lowers too, not much though.

Discard option is active, I don't really know why this happens. It's not a problem, the phone is smooth, but I was just curious about that...

I have 3.5 GB free by the way.

Sent from my Galaxy Nexus
[Samsung Galaxy Nexus] Jar3112:
I read about someone here using another version of the init.d script, adding no auto_da_alloc in addition to the discard option.

What would this change?

Sent from my Galaxy Nexus
[Samsung Galaxy Nexus] Jar3112:
I think I found out what the problem is!

I deleted some backups from cwm...

Since in cwm /data isn't mounted with discard option this should have brought to the slowdown...

Am I right?

Sent from my Galaxy Nexus
[Samsung Galaxy Nexus] ph4zrd:
This is a mount option some users recommend, especially for use with databases. Performance might be better when using it.

Don't know which side effects it brings, though.

Relevant section in ext4 Wikipedia article

Yes, you are right, didn't think about that.

As I don't know how CWM handles the mounting of filesystems, I have no idea how to apply the workaround there.
[Samsung Galaxy Nexus] Jar3112:
I'm making some experiments here and there, will report after I'm done

Sent from my Galaxy Nexus
[Samsung Galaxy Nexus] Jar3112:
Here are my results.

I tested on Androbench several times, after a write/delete cycle.

In every cycle I made a backup of my apps with Titanium backup, then deleted it, either using Titanium Backup's "Delete Backups" feature either deleting them manually in root explorer. The size of each pack of backups is about 800 MB.

So, after every 3 cycles I took 3 tests with Androbench and guess what? Speed is dropping more and more every time!

From what I've seen it goes down by 0.03 to 0.05 Mbps (in Random Write, which I used as a reference).

Discard option is active either in /data and /cache, I checked in terminal.

So... what's the story?

The adb shell commands work, so there MUST be something out there preventing data from being correctly deleted. I'm posting the output of mount | egrep '/data|/cache' command, in order to check if something's wrong.

I'm using v6 supercharger if that matters.

u0_a41@android:/ # mount | egrep '/data|/cache'

/dev/block/platform/omap/omap_hsmmc.0/by-name/cache /cache ext4 rw,relatime,errors=panic,user_xattr,acl,barrier=1,nomblk_io_submit,data=writeback,noauto_da_alloc,discard 0 0

/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata /data ext4 rw,relatime,errors=panic,user_xattr,acl,barrier=1,nomblk_io_submit,data=writeback,noauto_da_alloc,discard 0 0

Sent from my Galaxy Nexus
[Samsung Galaxy Nexus] bar_rodoy:
I don't have the problematic chip but sometimes my Nexus gets laggy. Does anyone else had this case?
[Samsung Galaxy Nexus] Jar3112:
Ok I have some other ideas to be discussed about.

In recovery, where the trick WORKS, the output of the command mount | egrep '/data' is:

/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata on /data type ext4 (rw,nodev,noatime,nodiratime,barrier=1,data=ordered)

Compared to the one I had found in booted system I see some differences. One or more of them are the key to solve my (and maybe someone other's) problem. I need someone to help me out finding which the correct mount options are, and how to put them in a boot script.

I suppose one must me "auto_da_alloc", and I'm thinking about "noatime", but I really need some other opinions.

Really, I want to get rid of this damn issue.

Thank you very much for your help.
[Samsung Galaxy Nexus] lesp4ul:
Even thou i feel no prob with my previous setup, it is no harm to test the script i think. I also tweak some kernel setting too. After some tries, finally i chose this setup:

i9250 yakju, V3U00M

Space about 5.2GB

Discard ON (init.d)

Paranoid Android 2.9b999 (4.2.1)

Modded Trinity Kernel by Dax

Stock freq, no UV, cfq/interactive, fsync ON, read ahead 896.

Small RW increase with 1024 read ahead buffer, but sacrifices some SW.

The result before applying script, buffer 1024 as kernel default.

Plase correct me if my setup is wrong :)
[Samsung Galaxy Nexus] Jar3112:
I'd like to change the mount option data=writeback to data=ordered, but I can't find how. Any help?

Edit: found this:

tune2fs -o journal_data_ordered

But I think I'm missing something, the command doesn't work

Sent from my Galaxy Nexus
[Samsung Galaxy Nexus] ph4zrd:
Android might not have this command.

As you're already using a remount script for the discard option, simply add the data=ordered option, although i have no idea what this would change...

Example:

#!/system/bin/sh
mount -o remount,discard[B],data=ordered[/B] /data
mount -o remount,discard[B],data=ordered[/B] /cache
[Samsung Galaxy Nexus] Jar3112:
Doesn't work, already tried in terminal and says

Mount invalid argument

I wrote

mount -o remount,discard,data=ordered

Is there something wrong?

Sent from my Galaxy Nexus
[Samsung Galaxy Nexus] ph4zrd:
The default Android mount command seems to have problems with this option.

If you have busybox installed, try busybox mount -o ...
[Samsung Galaxy Nexus] Jar3112:
Here is the output

mount: mounting /dev/block/platform/omap/omap_hsmmc.0/by-name/userdata on /data failed: Invalid argument

Sent from my Galaxy Nexus

---------- Post added at 12:44 PM ---------- Previous post was at 12:21 PM ----------

I'm posting the complete mount output.

u0_a41@android:/ $ mount

rootfs / rootfs ro,relatime 0 0

tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0

devpts /dev/pts devpts rw,relatime,mode=600 0 0

proc /proc proc rw,relatime 0 0

sysfs /sys sysfs rw,relatime 0 0

none /acct cgroup rw,relatime,cpuacct 0 0

tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0

tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0

none /dev/cpuctl cgroup rw,relatime,cpu 0 0

/dev/block/platform/omap/omap_hsmmc.0/by-name/system /system ext4 ro,relatime,user_xattr,acl,barrier=1,data=ordered 0 0

/dev/block/platform/omap/omap_hsmmc.0/by-name/efs /factory ext4 ro,relatime,user_xattr,acl,barrier=1,data=ordered 0 0

/dev/block/platform/omap/omap_hsmmc.0/by-name/cache /cache ext4 rw,relatime,errors=panic,user_xattr,acl,barrier=1,nomblk_io_submit,data=writeback,discard 0 0

/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata /data ext4 rw,relatime,errors=panic,user_xattr,acl,barrier=1,nomblk_io_submit,data=writeback,discard 0 0

/sys/kernel/debug /sys/kernel/debug debugfs rw,relatime 0 0

/dev/fuse /storage/sdcard0 fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0

/dev/block/dm-0 /mnt/asec/org.faked.gag9plus-1 ext4 ro,dirsync,nosuid,nodev,noatime,user_xattr,acl,barrier=1 0 0

/dev/block/dm-1 /mnt/asec/com.franco.kernel-2 ext4 ro,dirsync,nosuid,nodev,noatime,user_xattr,acl,barrier=1 0 0

/dev/block/dm-2 /mnt/asec/com.emulator.fpse-2 ext4 ro,dirsync,nosuid,nodev,noatime,user_xattr,acl,barrier=1 0 0

/dev/block/dm-3 /mnt/asec/com.pastagames.ro1mobile-2 ext4 ro,dirsync,nosuid,nodev,noatime,user_xattr,acl,barrier=1 0 0

/dev/block/dm-4 /mnt/asec/com.chillingo.drawrace2gplay.android.row-1 ext4 ro,dirsync,nosuid,nodev,noatime,user_xattr,acl,barrier=1 0 0

/dev/block/dm-5 /mnt/asec/com.keramidas.TitaniumBackupPro-1 ext4 ro,dirsync,nosuid,nodev,noatime,user_xattr,acl,barrier=1 0 0

This is giving me a headache...

/system seems to have data=ordered mount option, but I'm not able to make it stick to /data and /cache.

In addition, if I try

data -o remount,discard,data=writeback /data

this command is accepted, but data=ordered won't.

And,is it normal for /storage/sdcard0 not to have discard option?

Sent from my Galaxy Nexus
[Samsung Galaxy Nexus] ph4zrd:
Can't reproduce your problem using CM 10.1...

shell@android:/ # mount -o remount,data=ordered /data
shell@android:/ # mount
rootfs / rootfs ro,relatime 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
tmpfs /mnt/secure tmpfs rw,relatime,mode=700 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
/dev/block/platform/omap/omap_hsmmc.0/by-name/system /system ext4 ro,noatime,barrier=1,data=ordered,discard 0 0
/dev/block/platform/omap/omap_hsmmc.0/by-name/efs /factory ext4 ro,noatime,barrier=1,data=ordered,discard 0 0
/dev/block/platform/omap/omap_hsmmc.0/by-name/cache /cache ext4 rw,relatime,errors=panic,barrier=1,nomblk_io_submit,data=ordered,discard 0 0
/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata /data ext4 rw,relatime,errors=panic,barrier=1,nomblk_io_submit,data=ordered,discard 0 0
/sys/kernel/debug /sys/kernel/debug debugfs rw,relatime 0 0
/dev/fuse /mnt/shell/emulated fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
[Samsung Galaxy Nexus] Jar3112:
I'll try with adb shell.

What could this be about?

Shall I try installing another busybox version?

I'm on cm10

Sent from my Galaxy Nexus

---------- Post added at 04:34 PM ---------- Previous post was at 03:42 PM ----------

Wait, was your data partition already mounted with data=ordered? I ask because I see also cache has it enabled!

In this case, will you try adding instead writeback?

Sent from my Galaxy Nexus
[Samsung Galaxy Nexus] ph4zrd:
AW: Poor performance writing on /data

You are right, my fault. CM kernel has data=ordered as default and changing the data mode using remount is not supported by ext4, so you have to edit the fstab of your kernel.
[Samsung Galaxy Nexus] Jar3112:
R: Poor performance writing on /data

Oh jeez.

That may be a pain for me, I don't even know where to start.

I don't have a real need for it, but I'd really love to know if my thoughts were right and if discard option would work once enabled data=ordered option.

I'll make some research about it, would you mind giving me some hint?

Sent from my Galaxy Nexus
[Samsung Galaxy Nexus] kuba144:
Odp: Poor performance writing on /data

Are you sure that remount is not supported? What about an output from 'mount' command shell?

Wysyłane z mojego Galaxy Nexus za pomocą Tapatalk 2
[Samsung Galaxy Nexus] ph4zrd:
Maybe you can try a different kernel which has data=ordered as default.

Yup. Source ... You might find it somewhere in the ext4 documentation as well.
[Samsung Galaxy Nexus] sivaseraphim:
I suggest you try LagFix (fstrim) from the play store or from xda and see if it improves your performance. :o
[Samsung Galaxy Nexus] jackie_jagger:
Hey guys,

I'm not sure if this this the bug that's affecting my device. I have a 11/2011 chip (YVL00M) and lately I've been noticing slowdowns.

I'm attaching my androbench results - which clearly show something is wrong.

Please advise.
[Samsung Galaxy Nexus] kuba144:
Odp: Poor performance writing on /data

SW is quite low. I reached 10mbits

Wysyłane z mojego Galaxy Nexus za pomocą Tapatalk 2
[Samsung Galaxy Nexus] Jar3112:
R: Poor performance writing on /data

Yes, it seems like it's this bug

Sent from my Galaxy Nexus
[Samsung Galaxy Nexus] ph4zrd:
I don't think it's the eMMC slowdown bug.

Your random write speed is about normal and your chip doesn't fall in the category of affected chips. fstrim shouldn't help here.

You may try the Lag Fix (fstrim) app anyway, but at your own risk (maybe check for the brick bug first?)...
[Samsung Galaxy Nexus] Jar3112:
R: Poor performance writing on /data

SW speed though seems to be affected.. maybe he just need to clear up some space if the chip is ok

Sent from my Galaxy Nexus
[Samsung Galaxy Nexus] jackie_jagger:
I did try fstrim - it got SW up to about 5.28mbps. But it keeps fluctuating.

I should mention that I'm running CM10.1 M Build with franco kernel. I have about 3.92Gb free.
[Samsung Galaxy Nexus] Jar3112:
R: Poor performance writing on /data

Very strange.. did you use this app?

http://xdaforums.com/showthread.php?t=

Sent from my Galaxy Nexus
[Samsung Galaxy Nexus] jackie_jagger:
I think you miss typed the link. It doesn't have a thread id.
[Samsung Galaxy Nexus] Jar3112:
R: Poor performance writing on /data

Sorry, here it is on Google play

https://play.google.com/store/apps/details?id=com.grilledmonkey.lagfix

Sent from my Galaxy Nexus
[Samsung Galaxy Nexus] mfbgeo:
Hello,

I also have extreme performance issues with my Nexus (stock 4.2.1, rooted, encrypted):

I followed the 5 steps and the discard command seems to be running:

But neither the manual (old step 3) way nor the LagFix app have any influence on the performance.

The Lagfix app doesn't even seem to work properly:

so I'm pretty clueless right know...
[Samsung Galaxy Nexus] Jar3112:
R: Poor performance writing on /data

Did you try running the manual way while in recovery?

You might need to start adb as root via the sudo command in order to execute the commands while in recovery..

Sent from my Galaxy Nexus
[Samsung Galaxy Nexus] mfbgeo:
Just tried it after booting into TWRP:

Unfortunately it had no effect at all :/
[Samsung Galaxy Nexus] Jar3112:
R: Poor performance writing on /data

I really don't know man.. Sorry..

Sent from my Galaxy Nexus
[Samsung Galaxy Nexus] jackie_jagger:
Yes I tried it, didn't help much. Any idea what should I do?
[Samsung Galaxy Nexus] ph4zrd:
AW: Poor performance writing on /data

Seems like something blocks trimming of /data... Which ROM and kernel are you using? Did you try another kernel?
[Samsung Galaxy Nexus] mfbgeo:
@Jar3112

Don't mind - that was a valid idea so thanks :)

I'm actually using stock 4.2.1 and kernel.

€dit:

Tried it with franco nightly358

Still not working:
[Samsung Galaxy Nexus] kissme99:
Odp: Poor performance writing on /data

I had this issue on CM 10.1 Rom and on Stock Rom with franco.kernel. Last weekend I installed Stock Rom, locked bootloader and I put the same files (the same size) and my phone is still fast, I have no issue now. Don't know why.
[Samsung Galaxy Nexus] KaiZ51:
How much space do you have left right now?
[Samsung Galaxy Nexus] kissme99:
Odp: Poor performance writing on /data

I have about 2.8 GB free memory.
[Samsung Galaxy Nexus] kuba144:
Odp: Poor performance writing on /data

Check your stats with androbench

Wysyłane z mojego Galaxy Nexus za pomocą Tapatalk 2
[Samsung Galaxy Nexus] daniel_loft:
Guys, try this. I don't have the problem now as I recently fully wiped, but after some search I ended up at this program.

Now I'm writing from my phone, but later I'll come back with links to some details about the problem.
[Samsung Galaxy Nexus] KaiZ51:
Here are my stats with the discard script running at boot and after having used the Lagfix app and rebooted.

Are these normal scores? Shouldn't random write be higher?

I currently have 3.09GB of free space.
[Samsung Galaxy Nexus] kissme99:
Odp: Poor performance writing on /data

I think I don't need to check any stats to see, if my phone is laggy.
[Samsung Galaxy Nexus] Jar3112:
R: Poor performance writing on /data

http://xdaforums.com/showthread.php?p=37247263

If you guys want to get rid of this problem definitely just have a look here. Last 3 posts will surely be of your interest!

Sent from my Galaxy Nexus
[Samsung Galaxy Nexus] Jar3112:
R: Poor performance writing on /data

Some time ago I did have problems using the /discard script, now I found out what the issue was and I want to share.

In order for the trick to work you need to have DATA=ORDERED as a mount option for /data and cache.

If through the "mount" command you don't see this (you may see DATA=WRITEBACK instead) then setting the script won't work, even if the "discard" option is active.

So, if this is your case, you have 2 possibilities:

1) You may flash a ROM with this option (CM has it by default) or not sure about that flash a kernel that gives you the same, ONLY THEN putting the script in init.d folder will do the job.

2) You may, as an alternative method, try the "Lagfix" app, available on the market, or flash the .zip in my previous post.

This is not as resolutive as having DATA=ORDERED and DISCARD as mount options.

Hope this helps if someone has my same issues.

Sent from my Galaxy Nexus
[Samsung Galaxy Nexus] ginobili1:
Thanks. Does help a lot.
[Samsung Galaxy Nexus] borzowsky:
i have cyanogenmod 10.1, what should i do to have data=ordered?

thanks!!
[Samsung Galaxy Nexus] Jar3112:
Should be the cm default! Type "mount" in terminal and post the output!

Sent from my Galaxy Nexus