Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
PS3 vram as swap init script
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
antonlacon
Apprentice
Apprentice


Joined: 27 Jun 2004
Posts: 255

PostPosted: Mon Feb 23, 2009 8:29 am    Post subject: PS3 vram as swap init script Reply with quote

ps3vram was rewritten to not use the memory block device layer. This simplifies the necessary script to set it up as a swap device, as well as improved read and write time. This hasn't been merged into mainline yet, but is due for the next RC.

Code:
#!/sbin/runscript
depend() {
   need localmount
}

start() {
      ebegin "Activating VRAM as swap"
      mkswap /dev/ps3vram 1> /dev/null
      swapon -p1 /dev/ps3vram
}

stop() {
   ebegin "Turning off VRAM swap"
   swapoff /dev/ps3vram
}

restart() {
   stop
   start
}


Gives me ~245MB of otherwise unused vram as additional swap. Seems to work faster than using the HDD for swap, but I haven't benchmarked.


Last edited by antonlacon on Sun Mar 08, 2009 8:12 am; edited 2 times in total
Back to top
View user's profile Send private message
slackline
Veteran
Veteran


Joined: 01 Apr 2005
Posts: 1423
Location: /uk/sheffield

PostPosted: Mon Feb 23, 2009 3:09 pm    Post subject: Reply with quote

This sounds very interesting and I'll likely try it out when I get things up and running on my PS3.

Are there any reasons why you wouldn't want to do this?

slack
_________________
"Science is what we understand well enough to explain to a computer.  Art is everything else we do." - Donald Knuth
Back to top
View user's profile Send private message
antonlacon
Apprentice
Apprentice


Joined: 27 Jun 2004
Posts: 255

PostPosted: Mon Feb 23, 2009 7:18 pm    Post subject: Reply with quote

No, the initial corruption problems when the patch was written (around 2.6.25) have been corrected. That's why it's now included in mainline.

There's probably a cleaner way to do this than parsing dmesg.
Back to top
View user's profile Send private message
antonlacon
Apprentice
Apprentice


Joined: 27 Jun 2004
Posts: 255

PostPosted: Sat May 16, 2009 8:43 pm    Post subject: Reply with quote

Sony's cell kernel devs put up some udev rules to use instead. There are two, one to unconditionally add it, and one to add it only if there's an entry in /etc/fstab for it. They're here:

http://www.kernel.org/pub/linux/kernel/people/geoff/cell/ps3-conf/ps3vram-swap.rules

There's a typo in the rule for the /etc/fstab parsing one. Need to add a period before the asterisk in the grep command.
Code:
/bin/grep -q ^/dev/ps3vram[[:space:]]*swap


should be

Code:
/bin/grep -q ^/dev/ps3vram[[:space:]].*swap
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum