Re: Variables in task_struct:

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Just trying to joint this up to the other thread:

Guillaume wrote:
>A.M. Fradley wrote:
>
>>I'm trying to find out what the varibles in task_struct are.
>
>You can look on this web page. 
>http://elsa.sourceforge.net/cgi-bin/elsa-wiki.pl?TaskStruct
>
>
>HTH
>Guillaume

Then I wrote:

>Thanks for  the suggestions.   I meant to explain a bit more about what I
>wanted but i hadn't gotten to checking the replies.  I said or meant to say in
>my first post that I'm doing a project for my degree course that involves
>manipulating the page swapping for specific tasks.  I have been researching it
>but I'm struggling to find anything I can use. For example I'd been looking up
>task_struct and page swapping in linux and nothing like the site that
Guillaume >Thouvenin linked to in the last reply seemed to be showing up in the
google >searches I'd made and any library books on this sort of thing tend to
be
out of >date or too general.  Most of the what I found either was theoretical
and had >very little mention of the source code or just showed uncommented code
with no >explanations. The variables I found in the source that looked like
they
could >be what I needed were:
>
>unsigned long kernel_stack_page;
>
>/* mm fault and swap info: this can arguably be seen as either mm-specific or
>thread-specific */ unsigned long min_flt, maj_flt, nswap, cmin_flt, cmaj_flt,
>cnswap; int swappable:1; unsigned long swap_address;
>
>Pid seemed particularly mysterious but after using the same name for a
variable
>in a different program I'm writing I presume this must be proess ID.  (The
>program was a game trainer for windows so it's not much help for linux.)
>
>I'm trying to find a few different way of manipulating the page swapping.  I
>managed to find a site that mentioned a page fault handler.  I can't find the
>site right now but the one I looked at showed a list of funtions that would
>eventually be called as a result of a page fault but it didn't really explain
>how.  I'm want to try to lower the priority of pages as the handler swaps them
>out of memory (or raise it when they get swapped in) or to do the same from
the
>schedule function if I can.  It seems like my project is going to mostly
>involve getting the priority change as close the part where the page is
certain >to be swapped.
>
>(Sorry if I havn't been sure on what's been said already.  I can't connect to
>the main page to re-check what's already been posted.)  The site Guillaume
>refered me too seems very usefull, thanks.
>

It was supposed to be shown as a reply to the original message but it started a
new thread of instead.  I found the info usefull and it was also recomended
that I read the documentation by Josh Aas.  Also very useful.  I'd been
progressing a bit too slowly so I spoke to my project supervisor and he said I
should try to stick with the scheduler files and use the average load to effect
the tunables.  Then if I have time I can try to trace through to manipulate the
page swapping more directly like I intended to do.  I looked up what I think
the average load is but this is confusing me a bit:

"unsigned long cpu_load

The load of the CPU that the runqueue represents.  The load is recalculated
whenever rebalance_tick() is called, and is the avergage of the old load and
the old load and the current (nr_running * SCHED_LOAD_SCALE).  The latter macro
simply increases the resoluion of the load average.

Someone said that it looked like that variable was just the current load but
perhaps they were just wanting me to find out myself.  After thinking it
through while I was typing this, it looks like it is the average although it
tends towards the most recent value of the load, but that would probably be a
good thing anyway.  I've been looking at the schedulers and some the
documentation I've found and I can't seem to find where current is defined in
the 2.6.9 kernel even though it's still used as it was in one of the older
kernels.  Has it's definition has moved?  I'm also wondering if I'm working on
the wrong version of the kernel.  There seems to be lot of code involved with
multi processing whereas my project is to improve it for a desktop computer. 
However I want it to be compatible with the newer kernels do I'm not sure which
would be best.

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux