Peter Teoh | 1 Sep 2008 02:31
Picon
Gravatar

Re: Question on swapping behavior of new kernels

sorry, just realize never complete my explanation....:-).

the reason is because if there exists a max RSS, then there may
already be swapout operation occuring in your process A running alone
by itself, as it can never allocate more than the max rss.   so
multiple process can have max rss reached at the same
time......hm.....sound quite reasonable in terms of resources
allocation right?

On Mon, Sep 1, 2008 at 8:27 AM, Peter Teoh <htmldeveloper <at> gmail.com> wrote:
> Not sure if I am right or not, but the answer to your question is
> something called "maximum RSS".   U can learn this through several
> experiments (my physical mem is 1G):
>
> a.   write a C program to malloc 1MB.   memset the space with
> something.   "ps aux" to see the total RSS for this process.   RSS is
> the physical pages memory that will be allocated for your C program.
> After malloc() u can see that the RSS is a very small nos.   But after
> memset() it immediately become a large number.   Alternatively, write
> a loop to update byte by byte, and then u can see the growth of RSS
> from small to large number,.
>
> b.   Change 1MB to 10MB, and u can see that the RSS is increased.
>
> c.   Change it to 90MB, and u can see that there is not much increased in RSS.
>
> "ps" give u the total RSS pages, but if u want to see the specific
> breakdown of the physical pages per segment of memory, use
> /proc/pid/smaps:
>
(Continue reading)

Peter Teoh | 1 Sep 2008 02:27
Picon
Gravatar

Re: Question on swapping behavior of new kernels

Not sure if I am right or not, but the answer to your question is
something called "maximum RSS".   U can learn this through several
experiments (my physical mem is 1G):

a.   write a C program to malloc 1MB.   memset the space with
something.   "ps aux" to see the total RSS for this process.   RSS is
the physical pages memory that will be allocated for your C program.
After malloc() u can see that the RSS is a very small nos.   But after
memset() it immediately become a large number.   Alternatively, write
a loop to update byte by byte, and then u can see the growth of RSS
from small to large number,.

b.   Change 1MB to 10MB, and u can see that the RSS is increased.

c.   Change it to 90MB, and u can see that there is not much increased in RSS.

"ps" give u the total RSS pages, but if u want to see the specific
breakdown of the physical pages per segment of memory, use
/proc/pid/smaps:

root     24470  0.0  1.0  93664 10568 pts/3    S    08:22   0:00
   \_ a.out

08049000-0804a000 rwxp 00000000 08:01 2184953    /root/a.out
Size:                 4 kB
Rss:                  4 kB
Shared_Clean:         0 kB
Shared_Dirty:         0 kB
Private_Clean:        0 kB
Private_Dirty:        4 kB
(Continue reading)

Mulyadi Santosa | 1 Sep 2008 03:48
Picon

Re: Spawning and managing userprocess from kernel module

Hi

On Fri, Aug 29, 2008 at 10:54 PM, DEGREMONT Aurelien
<aurelien.degremont <at> cea.fr> wrote:
> Hello all!
>
> I need to be able to start and manage several user-processes from a kernel
> module.
> By managing, i mean, read the process output, wait for its end, kill it
> sooner if needed.
> It looks like the mecanisms offered by call_usermodehelper() but, more
> sophisticated.
> I did some code, looking a lot to that what is done in call_usermodehelper()
> but I'm facing more and more issues.

What you're trying to do is whole lot easier and less complex if you
do it (mostly) in user space.Do fork(), then probably coordinate via
mutex, signal or simply do wait().

Please notice that I don't say you're wasting your time, I just think
it's not something that should be managed by kernel space.

So, I think you should go with (3). Good luck man!

regards,

Mulyadi.

--
To unsubscribe from this list: send an email with
(Continue reading)

Peter Teoh | 1 Sep 2008 04:14
Picon
Gravatar

Re: Spawning and managing userprocess from kernel module

On Mon, Sep 1, 2008 at 9:48 AM, Mulyadi Santosa
<mulyadi.santosa <at> gmail.com> wrote:
> Hi
> What you're trying to do is whole lot easier and less complex if you
> do it (mostly) in user space.Do fork(), then probably coordinate via
> mutex, signal or simply do wait().
>
> Please notice that I don't say you're wasting your time, I just think
> it's not something that should be managed by kernel space.
>
> So, I think you should go with (3). Good luck man!
>
> regards,
>
> Mulyadi.

yes....i think so too....anything in kernel always has to wory about
SMP race condition, scheduling of processes, not hogging the use of
resources etc etc....because u are controlling everything.   so it is
rather complex.   but userspace is so much simpler and easier.

well...life is short, go for the simplest solution....

--

-- 
Regards,
Peter Teoh

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis <at> nl.linux.org
(Continue reading)

Umashankar V.K. | 1 Sep 2008 07:44
Picon

Allocating a cacheable page

Hi,

       I  want to write a test to demonstrate  cache-thrashing.

a) In Linux, is it possible to request a malloc'd  page to be allocated as  non-cacheable ?

b) The cacheability attribute is a bit-field in the  PTE ( page table entry ) of the page-frame,  Right ?
There may be multiple PTEs ( synonyms ) which map to the same physical page.   What will happen if the synonyms have
different value for the cacheable field ?

c)  Do I have control to keep the  code of my program/process  in non-cacheable page ?

                         shankar


Thomas Petazzoni | 1 Sep 2008 10:09
Favicon
Gravatar

Re: Spawning and managing userprocess from kernel module

Hi Aurélien,

(Hope your Canada trip after OLS was nice !)

Le Fri, 29 Aug 2008 17:54:52 +0200,
DEGREMONT Aurelien <aurelien.degremont <at> cea.fr> a écrit :

>  3 - Is the only solution to code a userspace daemon for doing that,
> and just use a mechanism  to communicate between this daemon and the
> kernel? This will split my work in two parts, and I'm not very fond
> of this solution...

Yes, this is what you should. You are trying to do too much userspace
things in the kernel. Do all that stuff in userspace, and use one of
the many communication mechanisms to exchange informations with your
kernel module.

BTW, we could better help you if you described what you are trying to
do exactly.

Sincerly,

Thomas
--

-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis <at> nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ

Thomas Petazzoni | 1 Sep 2008 10:12
Favicon
Gravatar

Re: GPS Application on Linux

Le Fri, 29 Aug 2008 11:09:14 +0530 (IST),
mayank rana <mayank_rana_it <at> yahoo.co.in> a écrit :

> 1. Is there any Framework available in Linux to develop GPS
> Application

No specific framework for GPS application. You can use whatever
framework/library you want to develop your application.

> ? 2. Any standard GPS Framework ?

You should probably have a look at gpsd, http://gpsd.berlios.de/, which
contains a library called libgps (see
http://gpsd.berlios.de/libgps.html).

Sincerly,

Thomas
--

-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis <at> nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ

ZelluX | 1 Sep 2008 11:56
Picon
Gravatar

How to enter v86 and execute my program?

Hi, all

I want to enter v86 mode and switch to VGA Mode 13h to draw some pictures. Now i can enter v86 mode with IRET instruction setting VM flag in the eflags register.

But since v86 mode supports only 16-bit address, how can i let the cpu executes instructions beyond 0x100000 which includes setting VGA Mode 13h and drawing pictures?

Many thanks for your reply ;-)
Thomas Petazzoni | 1 Sep 2008 14:14
Favicon
Gravatar

Re: Spawning and managing userprocess from kernel module

Le Mon, 01 Sep 2008 10:40:01 +0200,
DEGREMONT Aurelien <aurelien.degremont <at> cea.fr> a écrit :

> Yes, yes, I know this will be a lot simpler in user-space, but, if i 
> trying to do this in kernel space, it is not because I'm masochist,
> but because I need it. If this is not possible or, it is really too 
> difficult I will try to do otherwise, but I want to be sure before 
> changing my plans. Say that i'm a heretic if I want to do that, or
> say it could be done this way or that way if you have some
> solutions :-)

You don't tell us what you are trying to achieve, so I don't see how we
could tell you how you should do it. And don't tell us that you wan't
to create and manage userspace processes, tell us why you want to do
that.

Sincerly,

Thomas
--

-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis <at> nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ

Thomas Petazzoni | 1 Sep 2008 14:16
Favicon
Gravatar

Re: How to enter v86 and execute my program?

Le Mon, 1 Sep 2008 17:56:13 +0800,
ZelluX <zellux <at> gmail.com> a écrit :

> I want to enter v86 mode and switch to VGA Mode 13h to draw some
> pictures. Now i can enter v86 mode with IRET instruction setting VM
> flag in the eflags register.
> 
> But since v86 mode supports only 16-bit address, how can i let the cpu
> executes instructions beyond 0x100000 which includes setting VGA Mode
> 13h and drawing pictures?

Why would you want to do that under Linux ? Linux exposes a generic
framebuffer API to userspace, using which you can draw anything on the
screen. However, most people are using a high-lever library like
DirectFB, which makes the use of the framebuffer much easier.

Sincerly,

Thomas
--

-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis <at> nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ


Gmane