[Kernel] TRIM: Speeding up the Galaxy Note n7000

jogai

Senior Member
Nov 27, 2011
281
61
48
very sorry to hear that. you are the only person that reported a problem for any of the 4210 devices on trim kernel. corruption looks like an unrelated issue though.

the most important thing: do you have a bacup???

could you post your eMMC details?
Yeah, got a backup, but I'm trying all day to restore it... I only have acces to recovery..

Details:
VYL00M 0x19
 

Lanchon

Senior Member
Jun 19, 2011
2,703
4,455
0
Yeah, got a backup, but I'm trying all day to restore it... I only have acces to recovery..

Details:
VYL00M 0x19
thats the most common firmware and has been proved safe to trim.

im afraid if you want help you r going to need to post A LOT more detail about ur situation. what do you mean you only have access to recovery? you cant boot android? then how do you know your efs is corrupted? please describe ur complete software setup, including any hacks, repartitioning, etc., what works, what doesnt, and any observations and anything out of the ordinary. and what did you try and what were the outcomes.
 

jogai

Senior Member
Nov 27, 2011
281
61
48
thats the most common firmware and has been proved safe to trim.

im afraid if you want help you r going to need to post A LOT more detail about ur situation. what do you mean you only have access to recovery? you cant boot android? then how do you know your efs is corrupted? please describe ur complete software setup, including any hacks, repartitioning, etc., what works, what doesnt, and any observations and anything out of the ordinary. and what did you try and what were the outcomes.
Thanks for the questions. Sorry for the late reply, I was ill. As I think its unrelated to this kernel I posted my question in a separate thread: http://forum.xda-developers.com/galaxy-note/help/efs-partition-gone-t2971903
On top of that: No hacks, only the nightly & this kernel. No repartitioning. Recovery and Download mode works.
 

Lanchon

Senior Member
Jun 19, 2011
2,703
4,455
0
Thanks for the questions. Sorry for the late reply, I was ill. As I think its unrelated to this kernel I posted my question in a separate thread: http://forum.xda-developers.com/galaxy-note/help/efs-partition-gone-t2971903
On top of that: No hacks, only the nightly & this kernel. No repartitioning. Recovery and Download mode works.
ill answer there

TL;DR:
you seemed to have used a guide for a different phone model and you overwrote your bootloader with an unrelated partition image
 
Last edited:
  • Like
Reactions: jogai

jogai

Senior Member
Nov 27, 2011
281
61
48
ill answer there

TL;DR:
you seemed to have used a guide for a different phone model and you overwrote your bootloader with an unrelated partition image
Yup, and I should've checked my fstab first, because there I could find the right device, but you know it by heart probably ;)

Flashing your custom kernel now!
 
  • Like
Reactions: Lanchon

daedric

Senior Member
Dec 24, 2006
2,204
456
163
Porto
Trim will only happen when you use the Lagfree app which only uses /system, /data and /cache.
Uhhh no. From 4.3 fstrim should be executed by Android itself regularly, and it's output available on the logcat. http://www.anandtech.com/show/7185/android-43-update-brings-trim-to-all-nexus-devices

So, if our logcat isn't showing it, it can be one of two problems:

Android is not running fstrim.
Android is either running fstrim from a place it isn't available, or calling fitrim() directly and incorrectly.
 

Lanchon

Senior Member
Jun 19, 2011
2,703
4,455
0
Uhhh no. From 4.3 fstrim should be executed by Android itself regularly, and it's output available on the logcat. http://www.anandtech.com/show/7185/android-43-update-brings-trim-to-all-nexus-devices

So, if our logcat isn't showing it, it can be one of two problems:

Android is not running fstrim.
Android is either running fstrim from a place it isn't available, or calling fitrim() directly and incorrectly.
i dont think CM has disabled auto trim for this family. maybe CM has a general problem in that regard in some installations. someone should google... ;l
 

nokiamodeln91

Senior Member
Jun 6, 2012
7,393
2,637
0
Uhhh no. From 4.3 fstrim should be executed by Android itself regularly, and it's output available on the logcat. http://www.anandtech.com/show/7185/android-43-update-brings-trim-to-all-nexus-devices

So, if our logcat isn't showing it, it can be one of two problems:

Android is not running fstrim.
Android is either running fstrim from a place it isn't available, or calling fitrim() directly and incorrectly.
Yeh right but i was specifically mentioning our device builds affected by brickbug.
 

daedric

Senior Member
Dec 24, 2006
2,204
456
163
Porto
Maybe in our (official) CM builds it's disabled to prevent fstrim erros on logcat...

BTW Lanchon, how about a 5.0 version? :D
 
Last edited:

Lanchon

Senior Member
Jun 19, 2011
2,703
4,455
0
Agree, but the maintainer isn't right?

This made trim show up on logcat (from the i9000)



Uhm... maybe this? https://android.googlesource.com/platform/system/vold/+/b87937cdea689594a293979b30b13054e7455dee
i don't understand your question.

i dont have any 4210 device to test. the kernel trims for sure. if your android doesnt do a maintenance trim (other's do) you'll have to investigate; i can't do it. start by google the maintenance conditions. see in the log if maintenance is ever triggered, and if not why, and go from there.
 
  • Like
Reactions: illolatt and sulkie

sibere

Retired Recognized Developer
May 14, 2006
2,055
375
0
Paris
Fstrim or not?

Hi and first of all thanks for your kernel and all the hard work you're putting in it.

I have a N7000 running CM11 nightly. I have installed your kernel and tried to run fstrim manually on /cache to see the results.
I was very pleased that I had a positive result with a xxxxx number of bytes trimmed.

I have also a LG GPAD 8.3 running kitkat and I did the same on this device.
First attempt, I had the same kind of result with xxxxx bytes trimmed. Then I immediately did the same again and I had a return of 0 bytes trimmed, which is making sense because nothing was written on the partition (/cache) in the mean time.

So I tried this on my N7000. And to my very surprise, each time I'm running the fstrim -v /cache command, I'm getting a result with the same amount of bytes trimmed when it should be 0 on the second attempt and the following as nothing should have been written on the /cache partition.

I tend to think that even there is a return of xxxxx bytes trimmed (approx corresponding to the space left on the partition), nothing is actually trimmed.

Am I wrong?
 

Lanchon

Senior Member
Jun 19, 2011
2,703
4,455
0
Hi and first of all thanks for your kernel and all the hard work you're putting in it.

I have a N7000 running CM11 nightly. I have installed your kernel and tried to run fstrim manually on /cache to see the results.
I was very pleased that I had a positive result with a xxxxx number of bytes trimmed.

I have also a LG GPAD 8.3 running kitkat and I did the same on this device.
First attempt, I had the same kind of result with xxxxx bytes trimmed. Then I immediately did the same again and I had a return of 0 bytes trimmed, which is making sense because nothing was written on the partition (/cache) in the mean time.

So I tried this on my N7000. And to my very surprise, each time I'm running the fstrim -v /cache command, I'm getting a result with the same amount of bytes trimmed when it should be 0 on the second attempt and the following as nothing should have been written on the /cache partition.

I tend to think that even there is a return of xxxxx bytes trimmed (approx corresponding to the space left on the partition), nothing is actually trimmed.

Am I wrong?
don't worry, it does trim. the kernel remembering the what was trimmed only uses up scarce ram, it better not. makes sense if fs is mounted with DISCARD, but not otherwise.
 
  • Like
Reactions: sulkie and sibere

sibere

Retired Recognized Developer
May 14, 2006
2,055
375
0
Paris
I just checked the mount options and it is not mounted with discard.

Good news that it is trimming anyways.

I just repartition mmcblk0 to extend /data by a few Gb. I had 200mb left and I think that even with trim enabled, it was causing some lags. It's easily done with adb in recovery mode and parted :)
now that I have a lot of free space plus your trim kernel, my good ol' Note 1 flies again :)
 
  • Like
Reactions: Lanchon

Lanchon

Senior Member
Jun 19, 2011
2,703
4,455
0
I just checked the mount options and it is not mounted with discard.

Good news that it is trimming anyways.

I just repartition mmcblk0 to extend /data by a few Gb. I had 200mb left and I think that even with trim enabled, it was causing some lags. It's easily done with adb in recovery mode and parted :)
now that I have a lot of free space plus your trim kernel, my good ol' Note 1 flies again :)
check out my fpbug kernel :) building trim versions as i write
 
  • Like
Reactions: sulkie

julian67

Senior Member
Nov 8, 2013
136
63
28
Brighton
A working kernel for GT-N7000 - Lanchon you deserve a medal!

Just posting to express my appreciation to Lanchon for a kernel which really works. I bought my used (but unmarked screen) GT-N7000 in May 2014 on ebay.co.uk for a very good price with the expectation that I would soon be happily running CM or Omnirom. Unfortunately I quickly understood that the AOSP and CM and other ROMs had several severe problems, all deriving from one horrible bug, so I reverted to rooted Samsung TouchWiz JellyBean - not perfect, not kewl, not l33t, but it does actually work. I had felt pretty burned after reading about a zillion "works like a charm" type testimonials and then find finding the referenced ROMs were fundamentally broken. Meanwhile I 've also been running CM11 on a B+N Nook HD so I appreciate CM can be a really high quality experience and a true daily driver. So I checked into xda regularly more in hope than in expectation and to my delight and surprise in this last week I find Lanchon, through persistence, determination, expertise and probably a stubborn streak a mile wide, has fixed the killer bug. Holy ess aich aye tee!

It took me a couple of days to decide to again try CM on my Note. I knew I always risked bricking it. I remembered how tedious and unreliable the install process can be and how far the docs and collective wisdom and fanboi testimonials deviate from anything that might actually be real. But a working kernel???? OK, proceed:

On my Note with TouchWiz 4.1.2 rooted but no custom recovery I booted to regular recovery and installed a signed Philz cwm. Then I was able reboot, check everything still worked, back up and then reboot and install a recovery up to date enough to allow CM11 install. The I installed raw_kernel_r4_j43. Finally I was able to install a cm11 nightly, boot it and configure. Then I installed Lanchon's FP fixed kernel. It worked! Then I decided to try Lanchon's FP fixed TRIM enabled kernel. It worked! Finally I switched from Dalvik to ART. It took a good 15 minutes to switch runtime but it works!

It's actually now a very slick experience. It isn't perfect because my Samsung Desktop Dock is now consigned to paperweight duty which is a big shame (no more Line Out to amp), and despite it being desperately uncool and unkewl to say so, there are a few things about TouchWiz which Samsung got right (for example, I don't think any non-Samsung OS gets close to Samsung's power management/battery life). Some things are a huge improvement such as boot and shutdown times, and the utterly hideous noise gate bug is almost consigned to history - anyway it is usable enough that I can listen to Chopin's Nocturnes without the damn sound cutting out while notes decay. This constitutes success and major progress (what a crappy bug, Samsung deserved a lot more bad publicity for this).

Anyway I now have a Galaxy Note GT-N7000 with UPnP client, samba browsing, beautiful sound quality, VPN client, nice performance, great multimedia support, very responsive interface and the prospect of being able to continue happily using the same device for several years.

Thanks Lanchon. Nominate a cause and I will make a donation. If the cause is you personally that is fine with me.

p.s. even the camera works really well these days (it used to be truly awful on ROMs), thanks to the Focal app (I got it on F-Droid). Success!
 
Last edited:
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone