Hubertus Franke <[EMAIL PROTECTED]> writes: >Try this ... this will guarantee that (p->counter) > (current->counter) >and it seems not as radical > p->counter = (current->counter + 1) >> 1; > current->counter = (current->counter - 1) >> 1; > if (!current->counter) > current->need_resched = 1; >instead of this >- p->counter = (current->counter + 1) >> 1; >- current->counter >>= 1; >- if (!current->counter) >- current->need_resched = 1; >+ p->counter = current->counter; >+ current->counter = 0; >+ current->need_resched = 1; No. I tried your change and also tried it with setting current->need_resched to 1 in all cases, and it still seems to run the parent first in at least half of the tries. Evidently, current->counter must be zero to make the currently running process give up the CPU immediately, which is the important thing (so that the parent does not touch its virtual memory for a while). Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104 [EMAIL PROTECTED] \ / San Jose, California 95129-1034 +1 408 261-6630 | g g d r a s i l United States of America fax +1 408 261-6631 "Free Software For The Rest Of Us." - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Re: PATCH(?): linux-2.4.4-pre2: fork should run child fir... Horst von Brand
- Re: PATCH(?): linux-2.4.4-pre2: fork should run chil... Éric Brunet
- Re: PATCH(?): linux-2.4.4-pre2: fork should run ... Jesse Pollard
- Re: PATCH(?): linux-2.4.4-pre2: fork should ... Éric Brunet
- Re: PATCH(?): linux-2.4.4-pre2: fork should run child fir... John Fremlin
- Re: PATCH(?): linux-2.4.4-pre2: fork should run child fir... Rik van Riel
- Re: PATCH(?): linux-2.4.4-pre2: fork should run chil... Linus Torvalds
- Re: PATCH(?): linux-2.4.4-pre2: fork should run ... Rik van Riel
- Re: PATCH(?): linux-2.4.4-pre2: fork should run child fir... Hubertus Franke
- Re: PATCH(?): linux-2.4.4-pre2: fork should run child fir... Adam J. Richter
- Re: PATCH(?): linux-2.4.4-pre2: fork should run child fir... Adam J. Richter
- Re: PATCH(?): linux-2.4.4-pre2: fork should run child fir... Hubertus Franke
- Re: PATCH(?): linux-2.4.4-pre2: fork should run child fir... Adam J. Richter
- Re: PATCH(?): linux-2.4.4-pre2: fork should run chil... John Fremlin
- Re: PATCH(?): linux-2.4.4-pre2: fork should run ... Linus Torvalds
- Re: PATCH(?): linux-2.4.4-pre2: fork should ... Alexander Viro
- Re: PATCH(?): linux-2.4.4-pre2: fork should ... Ulrich Drepper
- Re: PATCH(?): linux-2.4.4-pre2: fork should run child fir... Adam J. Richter
- Re: PATCH(?): linux-2.4.4-pre2: fork should run child fir... Adam J. Richter
- Re: PATCH(?): linux-2.4.4-pre2: fork should run chil... Michael O'Reilly
- Re: PATCH(?): linux-2.4.4-pre2: fork should run chil... Linus Torvalds