Re: Calling sys_sysinfo from sched.c

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

 



Quick question; I know the token mechanism is deactivated by default but I
think it was activated in 2.6.9 when SWAP_TOKEN_TIMEOUT was HZ * 300. So
I assume that was what the comment in 2.6.10 and 2.6.11 refers to.  It that the
only thing I need to change to activate the tokening mechanism?

21 #define SWAP_TOKEN_CHECK_INTERVAL (HZ * 2)
22 #define SWAP_TOKEN_TIMEOUT      0
23 /*
24  * Currently disabled; Needs further code to work at HZ * 300.
25  */
26 unsigned long swap_token_default_timeout = SWAP_TOKEN_TIMEOUT;

The other thing is that I might need to increase the the resolution of the
swap rate tracker either by making it called more often or by multiplying the
swapCount variable by some number before updating the swapRate variable.  I've
only tried having the minimum and default time slices at double size when the
swapRate is above 10.  It seems to be working but the swapRate seems to fall
down to 0 too quickly so it probably doesn't have time for much of an effect. 
So that's why I need better resolution on the swap rate.
One think I was thinking of was having the swapRate check interval the same as
the  SWAP_TOKEN_CHECK_INTERVAL or even merging the functions completely.  And
for higher resolution an other Idea was something like this:

/*
 * Measure how much swapping is being done.  This function is called at a 
 * regular interval.  Swap count is the number of VM_FAULT_MAJORs
 * returned by do_swap_page since the last interval.  Swap rate is the current 
 * average.
 */
unsigned long getSwapRate(void) {

	swapRate = (swapRate + swapCount) >> 1;  // Old way
	// swapRate = (swapRate + 2*swapCount) / 3;  // New way

	printk(KERN_CRIT "Swap rate is: %lu\n", swapRate);
	if (swapRate >= 10) {
		// Activate swap token mechanism
	}
	else if (swapRate < 10) {
		// Dectivate swap token mechanism
	}
	swapCount = 0;
	return swapRate;
}

I'd like to get a few other peoples thoughts on what I've been doing and
whether
this way is any good but maybe the title of this thread is confusing people so
I
might re-post what I have so far in a thread with a more obvious title and put
it on that website you mentioned.


----------------------------------------------------------------
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