Messages in this thread | | | Date | Thu, 14 Sep 2000 10:40:24 -0400 | From | David Mansfield <> | Subject | Re: [PATCH 2.4.0-test8] mm/filemap.c |
| |
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.
David Mansfield - 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/
| |