diff for duplicates of <20090818111125.GA20217@localhost> diff --git a/a/1.txt b/N1/1.txt index a37e080..6e78735 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -17,13 +17,13 @@ On Tue, Aug 18, 2009 at 07:00:48PM +0800, Minchan Kim wrote: > >> > > > > >> > Wu Fengguang wrote: > >> > > > > >> > > On Fri, Aug 07, 2009 at 05:09:55AM +0800, Jeff Dike wrote: > >> > > > > >> > >> Side question - -> >> > > > > >> > >> Is there a good reason for this to be in shrink_active_list() +> >> > > > > >> > >> A Is there a good reason for this to be in shrink_active_list() > >> > > > > >> > >> as opposed to __isolate_lru_page? > >> > > > > >> > >> -> >> > > > > >> > >> if (unlikely(!page_evictable(page, NULL))) { -> >> > > > > >> > >> putback_lru_page(page); -> >> > > > > >> > >> continue; -> >> > > > > >> > >> } +> >> > > > > >> > >> A A A A A if (unlikely(!page_evictable(page, NULL))) { +> >> > > > > >> > >> A A A A A A A A A putback_lru_page(page); +> >> > > > > >> > >> A A A A A A A A A continue; +> >> > > > > >> > >> A A A A A } > >> > > > > >> > >> > >> > > > > >> > >> Maybe we want to minimize the amount of code under the lru lock or > >> > > > > >> > >> avoid duplicate logic in the isolate_page functions. @@ -74,17 +74,17 @@ On Tue, Aug 18, 2009 at 07:00:48PM +0800, Minchan Kim wrote: > >> When the next time to scan, > >> > >> shrink_page_list -> > -> -> > referenced = page_referenced(page, 1, -> > sc->mem_cgroup, &vm_flags); -> > /* In active use or really unfreeable? Activate it. */ -> > if (sc->order <= PAGE_ALLOC_COSTLY_ORDER && -> > referenced && page_mapping_inuse(page)) -> > goto activate_locked; +> > A -> +> > A A A A A A A A referenced = page_referenced(page, 1, +> > A A A A A A A A A A A A A A A A A A A A A A A A sc->mem_cgroup, &vm_flags); +> > A A A A A A A A /* In active use or really unfreeable? A Activate it. */ +> > A A A A A A A A if (sc->order <= PAGE_ALLOC_COSTLY_ORDER && +> > A A A A A A A A A A A A A A A A A A A A referenced && page_mapping_inuse(page)) +> > A A A A A A A A A A A A goto activate_locked; > > > >> -> try_to_unmap -> > ~~~~~~~~~~~~ this line won't be reached if page is found to be -> > referenced in the above lines? +> > A A ~~~~~~~~~~~~ this line won't be reached if page is found to be +> > A A referenced in the above lines? > > Indeed! In fact, I was worry about that. > It looks after live lock problem. @@ -134,11 +134,11 @@ Fengguang > > Thanks, > > Fengguang > > -> >> -> try_to_unmap_xxx -> >> -> if (vma->vm_flags & VM_LOCKED) -> >> -> try_to_mlock_page -> >> -> TestSetPageMlocked -> >> -> putback_lru_page +> >> A A A -> try_to_unmap_xxx +> >> A A A A A A A -> if (vma->vm_flags & VM_LOCKED) +> >> A A A A A A A -> try_to_mlock_page +> >> A A A A A A A A A A A -> TestSetPageMlocked +> >> A A A A A A A A A A A -> putback_lru_page > >> > >> So at last, the page will be located in unevictable list. > >> @@ -150,23 +150,23 @@ Fengguang > >> > > ---- > >> > > > >> > > /* -> >> > > * called from munlock()/munmap() path with page supposedly on the LRU. -> >> > > * -> >> > > * Note: unlike mlock_vma_page(), we can't just clear the PageMlocked -> >> > > * [in try_to_munlock()] and then attempt to isolate the page. We must -> >> > > * isolate the page to keep others from messing with its unevictable -> >> > > * and mlocked state while trying to munlock. However, we pre-clear the -> >> > > * mlocked state anyway as we might lose the isolation race and we might -> >> > > * not get another chance to clear PageMlocked. If we successfully -> >> > > * isolate the page and try_to_munlock() detects other VM_LOCKED vmas -> >> > > * mapping the page, it will restore the PageMlocked state, unless the page -> >> > > * is mapped in a non-linear vma. So, we go ahead and SetPageMlocked(), -> >> > > * perhaps redundantly. -> >> > > * If we lose the isolation race, and the page is mapped by other VM_LOCKED -> >> > > * vmas, we'll detect this in vmscan--via try_to_munlock() or try_to_unmap() -> >> > > * either of which will restore the PageMlocked state by calling -> >> > > * mlock_vma_page() above, if it can grab the vma's mmap sem. -> >> > > */ +> >> > > A * called from munlock()/munmap() path with page supposedly on the LRU. +> >> > > A * +> >> > > A * Note: A unlike mlock_vma_page(), we can't just clear the PageMlocked +> >> > > A * [in try_to_munlock()] and then attempt to isolate the page. A We must +> >> > > A * isolate the page to keep others from messing with its unevictable +> >> > > A * and mlocked state while trying to munlock. A However, we pre-clear the +> >> > > A * mlocked state anyway as we might lose the isolation race and we might +> >> > > A * not get another chance to clear PageMlocked. A If we successfully +> >> > > A * isolate the page and try_to_munlock() detects other VM_LOCKED vmas +> >> > > A * mapping the page, it will restore the PageMlocked state, unless the page +> >> > > A * is mapped in a non-linear vma. A So, we go ahead and SetPageMlocked(), +> >> > > A * perhaps redundantly. +> >> > > A * If we lose the isolation race, and the page is mapped by other VM_LOCKED +> >> > > A * vmas, we'll detect this in vmscan--via try_to_munlock() or try_to_unmap() +> >> > > A * either of which will restore the PageMlocked state by calling +> >> > > A * mlock_vma_page() above, if it can grab the vma's mmap sem. +> >> > > A */ > >> > > static void munlock_vma_page(struct page *page) > >> > > { > >> > > ... @@ -186,3 +186,9 @@ Fengguang > -- > Kind regards, > Minchan Kim + +-- +To unsubscribe, send a message with 'unsubscribe linux-mm' in +the body to majordomo@kvack.org. For more info on Linux MM, +see: http://www.linux-mm.org/ . +Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> diff --git a/a/content_digest b/N1/content_digest index 2608b2e..e1aa44c 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -49,13 +49,13 @@ "> >> > > > > >> > Wu Fengguang wrote:\n" "> >> > > > > >> > > On Fri, Aug 07, 2009 at 05:09:55AM +0800, Jeff Dike wrote:\n" "> >> > > > > >> > >> Side question -\n" - "> >> > > > > >> > >> \302\240Is there a good reason for this to be in shrink_active_list()\n" + "> >> > > > > >> > >> A Is there a good reason for this to be in shrink_active_list()\n" "> >> > > > > >> > >> as opposed to __isolate_lru_page?\n" "> >> > > > > >> > >>\n" - "> >> > > > > >> > >> \302\240 \302\240 \302\240 \302\240 \302\240if (unlikely(!page_evictable(page, NULL))) {\n" - "> >> > > > > >> > >> \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240putback_lru_page(page);\n" - "> >> > > > > >> > >> \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240continue;\n" - "> >> > > > > >> > >> \302\240 \302\240 \302\240 \302\240 \302\240}\n" + "> >> > > > > >> > >> A A A A A if (unlikely(!page_evictable(page, NULL))) {\n" + "> >> > > > > >> > >> A A A A A A A A A putback_lru_page(page);\n" + "> >> > > > > >> > >> A A A A A A A A A continue;\n" + "> >> > > > > >> > >> A A A A A }\n" "> >> > > > > >> > >>\n" "> >> > > > > >> > >> Maybe we want to minimize the amount of code under the lru lock or\n" "> >> > > > > >> > >> avoid duplicate logic in the isolate_page functions.\n" @@ -106,17 +106,17 @@ "> >> When the next time to scan,\n" "> >>\n" "> >> shrink_page_list\n" - "> > \302\240->\n" - "> > \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240referenced = page_referenced(page, 1,\n" - "> > \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240sc->mem_cgroup, &vm_flags);\n" - "> > \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240/* In active use or really unfreeable? \302\240Activate it. */\n" - "> > \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240if (sc->order <= PAGE_ALLOC_COSTLY_ORDER &&\n" - "> > \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240referenced && page_mapping_inuse(page))\n" - "> > \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240goto activate_locked;\n" + "> > A ->\n" + "> > A A A A A A A A referenced = page_referenced(page, 1,\n" + "> > A A A A A A A A A A A A A A A A A A A A A A A A sc->mem_cgroup, &vm_flags);\n" + "> > A A A A A A A A /* In active use or really unfreeable? A Activate it. */\n" + "> > A A A A A A A A if (sc->order <= PAGE_ALLOC_COSTLY_ORDER &&\n" + "> > A A A A A A A A A A A A A A A A A A A A referenced && page_mapping_inuse(page))\n" + "> > A A A A A A A A A A A A goto activate_locked;\n" "> >\n" "> >> -> try_to_unmap\n" - "> > \302\240 \302\240 ~~~~~~~~~~~~ this line won't be reached if page is found to be\n" - "> > \302\240 \302\240 referenced in the above lines?\n" + "> > A A ~~~~~~~~~~~~ this line won't be reached if page is found to be\n" + "> > A A referenced in the above lines?\n" "> \n" "> Indeed! In fact, I was worry about that.\n" "> It looks after live lock problem.\n" @@ -166,11 +166,11 @@ "> > Thanks,\n" "> > Fengguang\n" "> >\n" - "> >> \302\240 \302\240 \302\240 -> try_to_unmap_xxx\n" - "> >> \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 -> if (vma->vm_flags & VM_LOCKED)\n" - "> >> \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 -> try_to_mlock_page\n" - "> >> \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 -> TestSetPageMlocked\n" - "> >> \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 -> putback_lru_page\n" + "> >> A A A -> try_to_unmap_xxx\n" + "> >> A A A A A A A -> if (vma->vm_flags & VM_LOCKED)\n" + "> >> A A A A A A A -> try_to_mlock_page\n" + "> >> A A A A A A A A A A A -> TestSetPageMlocked\n" + "> >> A A A A A A A A A A A -> putback_lru_page\n" "> >>\n" "> >> So at last, the page will be located in unevictable list.\n" "> >>\n" @@ -182,23 +182,23 @@ "> >> > > ----\n" "> >> > >\n" "> >> > > /*\n" - "> >> > > \302\240* called from munlock()/munmap() path with page supposedly on the LRU.\n" - "> >> > > \302\240*\n" - "> >> > > \302\240* Note: \302\240unlike mlock_vma_page(), we can't just clear the PageMlocked\n" - "> >> > > \302\240* [in try_to_munlock()] and then attempt to isolate the page. \302\240We must\n" - "> >> > > \302\240* isolate the page to keep others from messing with its unevictable\n" - "> >> > > \302\240* and mlocked state while trying to munlock. \302\240However, we pre-clear the\n" - "> >> > > \302\240* mlocked state anyway as we might lose the isolation race and we might\n" - "> >> > > \302\240* not get another chance to clear PageMlocked. \302\240If we successfully\n" - "> >> > > \302\240* isolate the page and try_to_munlock() detects other VM_LOCKED vmas\n" - "> >> > > \302\240* mapping the page, it will restore the PageMlocked state, unless the page\n" - "> >> > > \302\240* is mapped in a non-linear vma. \302\240So, we go ahead and SetPageMlocked(),\n" - "> >> > > \302\240* perhaps redundantly.\n" - "> >> > > \302\240* If we lose the isolation race, and the page is mapped by other VM_LOCKED\n" - "> >> > > \302\240* vmas, we'll detect this in vmscan--via try_to_munlock() or try_to_unmap()\n" - "> >> > > \302\240* either of which will restore the PageMlocked state by calling\n" - "> >> > > \302\240* mlock_vma_page() above, if it can grab the vma's mmap sem.\n" - "> >> > > \302\240*/\n" + "> >> > > A * called from munlock()/munmap() path with page supposedly on the LRU.\n" + "> >> > > A *\n" + "> >> > > A * Note: A unlike mlock_vma_page(), we can't just clear the PageMlocked\n" + "> >> > > A * [in try_to_munlock()] and then attempt to isolate the page. A We must\n" + "> >> > > A * isolate the page to keep others from messing with its unevictable\n" + "> >> > > A * and mlocked state while trying to munlock. A However, we pre-clear the\n" + "> >> > > A * mlocked state anyway as we might lose the isolation race and we might\n" + "> >> > > A * not get another chance to clear PageMlocked. A If we successfully\n" + "> >> > > A * isolate the page and try_to_munlock() detects other VM_LOCKED vmas\n" + "> >> > > A * mapping the page, it will restore the PageMlocked state, unless the page\n" + "> >> > > A * is mapped in a non-linear vma. A So, we go ahead and SetPageMlocked(),\n" + "> >> > > A * perhaps redundantly.\n" + "> >> > > A * If we lose the isolation race, and the page is mapped by other VM_LOCKED\n" + "> >> > > A * vmas, we'll detect this in vmscan--via try_to_munlock() or try_to_unmap()\n" + "> >> > > A * either of which will restore the PageMlocked state by calling\n" + "> >> > > A * mlock_vma_page() above, if it can grab the vma's mmap sem.\n" + "> >> > > A */\n" "> >> > > static void munlock_vma_page(struct page *page)\n" "> >> > > {\n" "> >> > > ...\n" @@ -217,6 +217,12 @@ "> \n" "> -- \n" "> Kind regards,\n" - > Minchan Kim + "> Minchan Kim\n" + "\n" + "--\n" + "To unsubscribe, send a message with 'unsubscribe linux-mm' in\n" + "the body to majordomo@kvack.org. For more info on Linux MM,\n" + "see: http://www.linux-mm.org/ .\n" + "Don't email: <a href=mailto:\"dont@kvack.org\"> email@kvack.org </a>" -10bc65a0db65faff8875dc72ba7742033d4837d19396857260aca2e99d5e9ca2 +aa31d55d6ccaf1972f94d667fb619a2cd2adcd39efcdeea08b0054619f0a151d
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.