Messages in this thread | | | Date | Thu, 14 Sep 2000 11:52:07 -0500 | From | Bill Wendling <> | Subject | Re: [PATCH 2.4.0-test8] mm/filemap.c |
| |
Also sprach David Mansfield: } Bill Wendling wrote: } > } > Hi Linus, } > } > Here's a small optimization for the mm/filemap.c file. } > } > - The `head = &mapping->pages;' statement is useless inside the } > repeat, since head isn't modified inside the loop. } > - The `curr = curr->next;' statement doesn't need to be executed } > if the repeat is taken. I changed the while() into a for() loop } > to accomodate this better. } > } } I spotted the curr = curr->next thing yesterday, too! I think you're } right on that one. But I'm not sure about the head = &mapping thing. } The reason we jump back here is that we've been outside the spinlock'ed } critical section. Is it possible for the &mapping->pages to change } during this period of time (when spinlock isn't held?), if not, your } patch is ok. If it could change, we need to re-initialize head because } it could have changed while we didn't have the lock locked. } Doh...Yeah. But...Shouldn't the `head = &mapping->pages;' thing be inside of a spinlock if &mapping->pages could change? Say it changed between the assignment and the function grabbing the lock?
Does anyone else know better on this?
-- || Bill Wendling wendling@ganymede.isdn.uiuc.edu - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/
| |