lkml.org 
[lkml]   [2012]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [NEW]: Introducing shrink_all_memory from user space


>
> This is fundamentally flawed.
> You're assuming that only one program will use this interface.
> Linux is a multi/user-tasking system

Dear Richard, Thank you for your comments.
I am sorry but this is meant only for *root* user.
That is only root user can do this: "echo 512 > /dev/shrinkmem"
If other user try to write in it: it says permission denied as follows:
pintu@pintu-ubuntu:~$ echo 512 > /dev/shrinkmem
-bash: /dev/shrinkmem: Permission denied

Moreover, this is mainly meant for mobile phones where there is only *one* user.

>
> If we expose it to user space *every* program/user will try too free
> memory such that it
> can use more.
> Can you see the problem?
>
As indicated above, every program/user cannot use it, as it requires root privileges.
Ok, you mean to say, every driver can call "shrink_all_memory" simultaneously??
Well, we can implement locking for that.
Anyways, I wrote a simple script to do this (echo 512 > /dev/shrinkmem) in a loop for 20 times from 2 different terminal (as root) and it works.
I cannot see any problem.
Can you elaborate more please?


Thanks,
Pintu


\
 
 \ /
  Last update: 2012-04-15 13:49    [W:0.133 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site