search for: put_page_testzero

Displaying 20 results from an estimated 25 matches for "put_page_testzero".

2007 Apr 18
0
[patch 7/9] Guest page hinting: minor fault optimization.
...nmapped again. On the unmap path each page that has been removed from the page table is freed with a call to page_cache_release. In general that causes an unnecessary page state transition from volatile to volatile. Not what we want. To get rid of these state transitions as well special variants of put_page_testzero/ page_cache_release are introduced that do not attempt to make the page volatile. page_cache_release_nocheck is then used in free_page_and_swap_cache and release_pages. This makes the unmap of ptes state transitions free. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> --- inclu...
2007 Apr 18
0
[patch 7/9] Guest page hinting: minor fault optimization.
...nmapped again. On the unmap path each page that has been removed from the page table is freed with a call to page_cache_release. In general that causes an unnecessary page state transition from volatile to volatile. Not what we want. To get rid of these state transitions as well special variants of put_page_testzero/ page_cache_release are introduced that do not attempt to make the page volatile. page_cache_release_nocheck is then used in free_page_and_swap_cache and release_pages. This makes the unmap of ptes state transitions free. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> --- inclu...
2020 Sep 25
0
[PATCH 2/2] mm: remove extra ZONE_DEVICE struct page refcount
...t transition from - * 2 to 1, when refcount reach one it means the page is free and we - * need to inform the device driver through callback. See - * include/linux/memremap.h and HMM for details. - */ - if (page_is_devmap_managed(page)) { - put_devmap_managed_page(page); - return; - } - if (put_page_testzero(page)) __put_page(page); } diff --git a/lib/test_hmm.c b/lib/test_hmm.c index e7dc3de355b7..1033b19c9c52 100644 --- a/lib/test_hmm.c +++ b/lib/test_hmm.c @@ -561,7 +561,7 @@ static struct page *dmirror_devmem_alloc_page(struct dmirror_device *mdevice) } dpage->zone_device_data = rpage;...
2020 Oct 01
0
[RFC PATCH v3 2/2] mm: remove extra ZONE_DEVICE struct page refcount
...t transition from - * 2 to 1, when refcount reach one it means the page is free and we - * need to inform the device driver through callback. See - * include/linux/memremap.h and HMM for details. - */ - if (page_is_devmap_managed(page)) { - put_devmap_managed_page(page); - return; - } - if (put_page_testzero(page)) __put_page(page); } diff --git a/lib/test_hmm.c b/lib/test_hmm.c index e151a7f10519..37a2dea5e805 100644 --- a/lib/test_hmm.c +++ b/lib/test_hmm.c @@ -561,7 +561,7 @@ static struct page *dmirror_devmem_alloc_page(struct dmirror_device *mdevice) } dpage->zone_device_data = rpage;...
2016 Apr 06
1
[PATCH v3 01/16] mm: use put_page to free page instead of putback_lru_page
On Tue, Apr 05, 2016 at 10:20:50AM +0200, Vlastimil Babka wrote: > On 04/05/2016 03:54 AM, Naoya Horiguchi wrote: > > On Mon, Apr 04, 2016 at 04:46:31PM +0200, Vlastimil Babka wrote: > >> On 04/04/2016 06:45 AM, Naoya Horiguchi wrote: > >>> On Mon, Apr 04, 2016 at 10:39:17AM +0900, Minchan Kim wrote: > > ... > >>>>> > >>>>>
2016 Apr 06
1
[PATCH v3 01/16] mm: use put_page to free page instead of putback_lru_page
On Tue, Apr 05, 2016 at 10:20:50AM +0200, Vlastimil Babka wrote: > On 04/05/2016 03:54 AM, Naoya Horiguchi wrote: > > On Mon, Apr 04, 2016 at 04:46:31PM +0200, Vlastimil Babka wrote: > >> On 04/04/2016 06:45 AM, Naoya Horiguchi wrote: > >>> On Mon, Apr 04, 2016 at 10:39:17AM +0900, Minchan Kim wrote: > > ... > >>>>> > >>>>>
2020 Sep 25
6
[RFC PATCH v2 0/2] mm: remove extra ZONE_DEVICE struct page refcount
Matthew Wilcox, Ira Weiny, and others have complained that ZONE_DEVICE struct page reference counting is ugly because they are "free" when the reference count is one instead of zero. This leads to explicit checks for ZONE_DEVICE pages in places like put_page(), GUP, THP splitting, and page migration which have to adjust the expected reference count when determining if the page is
2020 Sep 26
1
[PATCH 2/2] mm: remove extra ZONE_DEVICE struct page refcount
...reach one it means the page is free and we > - * need to inform the device driver through callback. See > - * include/linux/memremap.h and HMM for details. > - */ > - if (page_is_devmap_managed(page)) { > - put_devmap_managed_page(page); > - return; > - } > - > if (put_page_testzero(page)) > __put_page(page); > } > diff --git a/lib/test_hmm.c b/lib/test_hmm.c > index e7dc3de355b7..1033b19c9c52 100644 > --- a/lib/test_hmm.c > +++ b/lib/test_hmm.c > @@ -561,7 +561,7 @@ static struct page *dmirror_devmem_alloc_page(struct dmirror_device *mdevice) > }...
2020 Oct 01
8
[RFC PATCH v3 0/2] mm: remove extra ZONE_DEVICE struct page refcount
This is still an RFC because after looking at the pmem/dax code some more, I realized that the ZONE_DEVICE struct pages are being inserted into the process' page tables with vmf_insert_mixed() and a zero refcount on the ZONE_DEVICE struct page. This is sort of OK because insert_pfn() increments the reference count on the pgmap which is what prevents memunmap_pages() from freeing the struct
2020 Oct 12
2
[PATCH v2] mm/hmm: make device private reference counts zero based
...p); - /* * The page belongs to the device that created pgmap. Do * not return it to page allocator. */ + free_zone_device_page(page); return; } @@ -907,6 +906,9 @@ void release_pages(struct page **pages, int nr) put_devmap_managed_page(page); continue; } + if (put_page_testzero(page)) + __put_page(page); + continue; } if (!put_page_testzero(page)) -- 2.20.1
2020 Sep 14
5
[PATCH] mm: remove extra ZONE_DEVICE struct page refcount
...t transition from - * 2 to 1, when refcount reach one it means the page is free and we - * need to inform the device driver through callback. See - * include/linux/memremap.h and HMM for details. - */ - if (page_is_devmap_managed(page)) { - put_devmap_managed_page(page); - return; - } - if (put_page_testzero(page)) __put_page(page); } diff --git a/lib/test_hmm.c b/lib/test_hmm.c index c8133f50160b..5410f7328577 100644 --- a/lib/test_hmm.c +++ b/lib/test_hmm.c @@ -561,7 +561,6 @@ static struct page *dmirror_devmem_alloc_page(struct dmirror_device *mdevice) } dpage->zone_device_data = rpage;...
2020 Oct 08
2
[PATCH] mm: make device private reference counts zero based
...p); - /* * The page belongs to the device that created pgmap. Do * not return it to page allocator. */ + free_zone_device_page(page); return; } @@ -907,6 +906,9 @@ void release_pages(struct page **pages, int nr) put_devmap_managed_page(page); continue; } + if (put_page_testzero(page)) + __put_page(page); + continue; } if (!put_page_testzero(page)) -- 2.20.1
2018 Dec 10
1
[PATCH net 4/4] vhost: log dirty page correctly
...c Complexity 3 include/linux/overflow.h:__ab_c_size Cyclomatic Complexity 1 include/linux/page_ref.h:page_ref_dec_and_test Cyclomatic Complexity 1 include/linux/sched.h:task_thread_info Cyclomatic Complexity 1 include/linux/sched.h:need_resched Cyclomatic Complexity 1 include/linux/mm.h:put_page_testzero Cyclomatic Complexity 1 include/linux/mm.h:put_devmap_managed_page Cyclomatic Complexity 1 include/uapi/linux/virtio_ring.h:vring_need_event Cyclomatic Complexity 1 include/linux/virtio_byteorder.h:virtio_legacy_is_little_endian Cyclomatic Complexity 2 include/linux/uio.h:copy_to_iter...
2022 Jul 08
0
[PATCH v2 07/19] mm/migrate: Convert expected_page_refs() to folio_expected_refs()
...sly wrong, at least > for swapcache, and probably for some others. > > I say "dangerously" because it tells page migration a swapcache page > is safe for migration when it certainly is not. > > The fun that typically ensues is kernel BUG at include/linux/mm.h:750! > put_page_testzero() VM_BUG_ON_PAGE(page_ref_count(page) == 0, page), > if CONFIG_DEBUG_VM=y (bisecting for that is what brought me to this). > But I guess you might get silent data corruption too. > > I assumed at first that you'd changed the rules, and were now expecting > any subsystem that put...
2022 Jul 08
0
[PATCH v2 07/19] mm/migrate: Convert expected_page_refs() to folio_expected_refs()
...sly wrong, at least > for swapcache, and probably for some others. > > I say "dangerously" because it tells page migration a swapcache page > is safe for migration when it certainly is not. > > The fun that typically ensues is kernel BUG at include/linux/mm.h:750! > put_page_testzero() VM_BUG_ON_PAGE(page_ref_count(page) == 0, page), > if CONFIG_DEBUG_VM=y (bisecting for that is what brought me to this). > But I guess you might get silent data corruption too. > > I assumed at first that you'd changed the rules, and were now expecting > any subsystem that put...
2007 Apr 18
4
[patch 3/9] Guest page hinting: volatile page cache.
...o_wp_page, and by the early copy-on-write in do_no_page. To make enough pages discardable by the host an attempt to do the transition to volatile state is done when a page gets unlocked (unlock_page), when writeback has finished (test_clear_page_dirty), when the page reference counter is decreased (put_page_testzero), and when the page map counter is increased (page_add_file_rmap). All page references acquired with find_get_page and friends can be used to access the page frame content. A page reference grabbed from a page table cannot be used to access the page content. A page_make_stable needs to be done fir...
2007 Apr 18
4
[patch 3/9] Guest page hinting: volatile page cache.
...o_wp_page, and by the early copy-on-write in do_no_page. To make enough pages discardable by the host an attempt to do the transition to volatile state is done when a page gets unlocked (unlock_page), when writeback has finished (test_clear_page_dirty), when the page reference counter is decreased (put_page_testzero), and when the page map counter is increased (page_add_file_rmap). All page references acquired with find_get_page and friends can be used to access the page frame content. A page reference grabbed from a page table cannot be used to access the page content. A page_make_stable needs to be done fir...
2019 Jun 26
0
[PATCH 04/25] mm: remove MEMORY_DEVICE_PUBLIC support
...page can not be huge page */ - if (is_device_public_page(page)) { - if (locked_pgdat) { - spin_unlock_irqrestore(&locked_pgdat->lru_lock, - flags); - locked_pgdat = NULL; - } - put_devmap_managed_page(page); - continue; - } - page = compound_head(page); if (!put_page_testzero(page)) continue; -- 2.20.1
2007 Jun 28
6
[patch 0/6] resend: guest page hinting version 5.
Greetings, after Carsten pitched CMM2 on the kvm mini summit here is a repost of version 5 of the guest page hinting patches. The code is still the same but has been adapted to the latest git level. -- blue skies, Martin. "Reality continues to ruin my life." - Calvin.
2007 Jun 28
6
[patch 0/6] resend: guest page hinting version 5.
Greetings, after Carsten pitched CMM2 on the kvm mini summit here is a repost of version 5 of the guest page hinting patches. The code is still the same but has been adapted to the latest git level. -- blue skies, Martin. "Reality continues to ruin my life." - Calvin.