maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   Massive interactivity improvement under high I/O load! (https://talk.maemo.org/showthread.php?t=69973)

MyNokiaN900 2011-03-13 15:12

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by Alfred (Post 966838)
Hello everybody! Thanks for another great changable stuff. I'm noob right here, so could You provide me with the number for these new fields, which would make my beast faster? i don't really copy a lot of files, so just for the system and stuff...
Thanks in advance

Alfred, why don't you start reading this thread from page 1. All the answers are here as well as suggestions and the Swappolube application to try. It will make your life a lot easier if you are not comfortable with X-term scripts. ;)

AliasXZ 2011-04-01 12:15

Re: Massive interactivity improvement under high I/O load!
 
Just thought id add my 2 cents, even though this post is a little old...

I have just done a full backup of my rootfs using tar to my MMC and the phone stayed respsonsive for the whole process, before it would kill it.

I'm using the settings from page 1 :)

TiagoTiago 2011-04-01 15:04

Re: Massive interactivity improvement under high I/O load!
 
I must be doing somthing wrong, haven't noticed any improvements in the performance, much less a massive one :(

qole 2011-04-23 16:36

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by freemangordon (Post 965563)
The last thing to do was to play with swap - bingo, at the moment I swapoff EMMC swap, extracting speed raise to about 10 MB/s with no lagging at all. And the strange thing is that performance raise at the moment I did swapoff, even before swap was transferred to sdcard swap partition. Swap priorities do not matter - as long as EMMC swap is turned on, performance degrades severely.

I'm wondering if there is any way to disable swap on a specific process or partition? I would like to disable swapping during the file extraction phase, just on the lzma extraction process.

Another option would be to use the same trick they used on the old Maemo tablets; make a swap file on the SD card and make that the temporary swap during the extraction. That way, the user doesn't need to know how to repartition the SD card, and the N900 doesn't bog down and possibly reboot...

misiak 2011-04-23 17:22

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by qole (Post 994205)
I'm wondering if there is any way to disable swap on a specific process or partition? I would like to disable swapping during the file extraction phase, just on the lzma extraction process.

I don't know if it can help you, but by reading file "/proc/iomem" you can see what addresses of memory are mapped to which devices (I understand it like that (source) and it makes sense, because two last options, both named "System RAM" make 256 MB alltogether). In process (although it would look horribly ugly) you could allocate all space with malloc() (if you use C or C++) and check if returned pointer address is inside this area. But I have no idea if it would work properly and how to force system to alloc a memory from this area... Just wanted to point it. Your Linux and programming skills are much greater than mine (I suppose), maybe you even knew what I wrote, but even if this idea is stupid, could you explain why it can or cannot be done (if you know)? Thanks in advance.

PS. Simple code example of my idea how to check memory addres:
Code:

int *ptr = malloc(100);
if((int)(ptr)>=0x80000000 && (int)(ptr)<=0x8fffffff)
  printf("Yay! Address %x is in physical RAM :)\n", (int)(ptr));
else
  printf("Boo! Addres %x is not in physical RAM :(\n", (int)(ptr));


javispedro 2011-04-23 17:28

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by qole (Post 994205)
I'm wondering if there is any way to disable swap on a specific process or partition? I would like to disable swapping during the file extraction phase, just on the lzma extraction process.

Have a look at the madvise man page.

However, considering that you mentioned lzma, I believe that what you'd like is for it not to cache any files it access so that other cached files or processes' pages are not evicted from memory; in which case, I suggest you look at the fadvise man page.

qole 2011-04-23 20:41

Re: Massive interactivity improvement under high I/O load!
 
I was hoping for something from the command line...

misiak 2011-04-23 21:05

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by qole (Post 994278)
I was hoping for something from the command line...

I thought so... :P

Why not just:
Code:

# read current values
VAL01=`cat /proc/sys/vm/dirty_ratio`
VAL02=`cat /proc/sys/vm/dirty_background_ratio`
VAL03=`cat /proc/sys/vm/dirty_writeback_centisecs`
VAL04=`cat /proc/sys/vm/dirty_expire_centisecs`
VAL05=`cat /proc/sys/vm/min_free_kbytes`
VAL06=`cat /proc/sys/vm/swappiness`
VAL07=`cat /proc/sys/vm/vfs_cache_pressure`
VAL08=`cat /proc/sys/vm/page-cluster`
VAL09=`cat /sys/block/mmcblk0/queue/nr_requests`
VAL10=`cat /sys/block/mmcblk1/queue/nr_requests`
# use vaules from page 1 of this tread
echo 3 > /proc/sys/vm/dirty_ratio
echo 3 > /proc/sys/vm/dirty_background_ratio
echo 100 > /proc/sys/vm/dirty_writeback_centisecs
echo 100 > /proc/sys/vm/dirty_expire_centisecs
echo 4096 > /proc/sys/vm/min_free_kbytes
echo 50 > /proc/sys/vm/swappiness
echo 200 > /proc/sys/vm/vfs_cache_pressure
echo 8 > /proc/sys/vm/page-cluster
echo 4 > /sys/block/mmcblk0/queue/nr_requests
echo 4 > /sys/block/mmcblk1/queue/nr_requests
#
#DO SOME STUFF HERE, EG. RUN YOUR PROCESS
#
# set previous values
echo $VAL01 > /proc/sys/vm/dirty_ratio
echo $VAL02 > /proc/sys/vm/dirty_background_ratio
echo $VAL03 > /proc/sys/vm/dirty_writeback_centisecs
echo $VAL04 > /proc/sys/vm/dirty_expire_centisecs
echo $VAL05 > /proc/sys/vm/min_free_kbytes
echo $VAL06 > /proc/sys/vm/swappiness
echo $VAL07 > /proc/sys/vm/vfs_cache_pressure
echo $VAL08 > /proc/sys/vm/page-cluster
echo $VAL09 > /sys/block/mmcblk0/queue/nr_requests
echo $VAL10 > /sys/block/mmcblk1/queue/nr_requests

Well, it won't use these values for just one process, but for all processes during execution time of this process... But basically that could be sufficient for tasks like EasyDebian image extraction, am I right? ;)

EDIT: After reading more posts from this thread, maybe using values from first post isn't BEST option... but there are other settings posted ITT, so you can pick some other ones

misiak 2011-04-23 21:12

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by freemangordon (Post 965563)
They last thing to do was to play with swap - bingo, at the moment I swapoff EMMC swap, extracting speed raise to about 10 MB/s with no lagging at all. And the strange thing is that performance raise at the moment I did swapoff, even before swap was transferred to sdcard swap partition. Swap priorities do not matter - as long as EMMC swap is turned on, performance degrades severely.

Could that possibly be used also in new nicolai's camera-ui, so recorded videos won't lag (the lag somtimes because of slow i/o operations)?

qole 2011-04-24 01:03

Re: Massive interactivity improvement under high I/O load!
 
I tried making a swap file on the SD card, so I could get the benefit of an external swap file without the complexity of repartitioning the card.

Sadly, I ran across this bug: https://bugs.maemo.org/show_bug.cgi?id=7165

Maybe if it were fixed in Titan's power kernel, I could do it... but then that defeats my purpose of trying to find a way to get this working for people who don't want to futz with custom kernels etc.


All times are GMT. The time now is 20:05.

vBulletin® Version 3.8.8