On Thu, 8 May 2008, Linus Torvalds wrote:Sometimes you can fix it. For example, this change: - if (pte_present(*pte) && page_to_pfn(page) == pte_pfn(*pte)) { + if (pte_present(*pte) && page == pfn_to_page(pte_pfn(*pte))) { can simplify things: instead of moving from a 'struct page' to a pfn, it moves from a pfn to a 'struct page', and that is generally cheaper (multiply rather than divide by size of struct page). It's not always the same thing to do, but I think in this case we can. For me, the code generation changes: - movabsq $7905747460161236407, %rdx #, tmp111 - movabsq $32985348833280, %rax #, tmp107 - leaq (%r12,%rax), %rax #, tmp106 - sarq $3, %rax #, tmp106 - imulq %rdx, %rax # tmp111, tmp106 - movabsq $70368744177663, %rdx #, tmp113 - andq %rdx, %rcx # tmp113, pte$pte - shrq $12, %rcx #, pte$pte - cmpq %rcx, %rax # pte$pte, tmp106 + movabsq $70368744177663, %rax #, tmp107 + andq %rax, %rdx # tmp107, pte$pte + shrq $12, %rdx #, pte$pte + imulq $56, %rdx, %rax #, pte$pte, tmp109 + movabsq $-32985348833280, %rdx #, tmp111 + addq %rdx, %rax # tmp111, tmp110 + cmpq %rax, %r13 # tmp110, page which isn't a *huge* deal, but it certainly looks better. One less big constant, and one less shift. It's not going to make a huge difference, though. That function is just called too much, and it would still be entirely data-dependent all the way through. Linus --
| Greg Kroah-Hartman | [PATCH 004/196] Chinese: add translation of SubmittingPatches |
| Rafael J. Wysocki | [Bug #11210] libata badness |
| Andrea Arcangeli | [PATCH 00 of 11] mmu notifier #v16 |
| Andrew Morton | Re: -mm merge plans for 2.6.23 -- sys_fallocate |
git: | |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Daniel Eischen | Re: error with thread |
| David Miller | Re: [GIT]: Networking |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
