lkml.org 
[lkml]   [2009]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 10/10] ksm: change ksm nice level to be 5
* Izik Eidus <ieidus@redhat.com> [2009-07-20 14:48:04]:

> Balbir Singh wrote:
>> * Izik Eidus <ieidus@redhat.com> [2009-07-17 20:30:50]:
>>
>>
>>> From: Izik Eidus <ieidus@redhat.com>
>>>
>>> ksm should try not to disturb other tasks as much as possible.
>>>
>>> Signed-off-by: Izik Eidus <ieidus@redhat.com>
>>> ---
>>> mm/ksm.c | 2 +-
>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/mm/ksm.c b/mm/ksm.c
>>> index 75d7802..4afe345 100644
>>> --- a/mm/ksm.c
>>> +++ b/mm/ksm.c
>>> @@ -1270,7 +1270,7 @@ static void ksm_do_scan(unsigned int scan_npages)
>>>
>>> static int ksm_scan_thread(void *nothing)
>>> {
>>> - set_user_nice(current, 0);
>>> + set_user_nice(current, 5);
>>>
>>
>> Is the 5 arbitrary? Why not +19? What is the intention of this change
>> - to run when no other task is ready to run?
>>
>
> Hey Balbir,
>
> I thought about giving it the lowest priority of nice before I did this
> patch, but then I came into understanding that it isn't right,
> Although ksm should not distrub other tasks while they are running, it
> does need to run while they are running,
> most of the use cases for ksm is to find identical pages in real time
> while they are changing in the application, so giving it the lowest
> priority doesn't seems right to me,
>
> But my understanding of how the nice prioritys are working is just my
> intuition, so if you know better and think that for the use case i
> described above other nice priority is better fit, tell me and I wont
> have any problem to change.
>
>


I was just checking to see why 5? May be it might be a good idea to
document or at-least have rules on what priorities kernel threads can
take?

>>
>>> while (!kthread_should_stop()) {
>>> if (ksm_run & KSM_RUN_MERGE) {
>>>
>>
>>
>

--
Balbir


\
 
 \ /
  Last update: 2009-07-20 14:17    [W:0.038 / U:1.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site