lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1b3e8e88-ed5c-7302-553f-4ddb3400d466@redhat.com>
Date:   Tue, 21 Feb 2023 11:08:38 +0100
From:   David Hildenbrand <david@...hat.com>
To:     Andrew Yang <andrew.yang@...iatek.com>,
        SeongJae Park <sj@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Matthias Brugger <matthias.bgg@...il.com>,
        AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>
Cc:     wsd_upstream@...iatek.com, casper.lin@...iatek.com,
        damon@...ts.linux.dev, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH] mm/damon/paddr: fix pin page problem

On 21.02.23 10:03, Andrew Yang wrote:
> From: "andrew.yang" <andrew.yang@...iatek.com>

Nit: I'd suggest a different subject

"mm/damon/paddr: fix missing put_page()"


Fixes: ?
Cc: stable ?


I think a patch from Willy is queued that converts this code into folios.

> 
> damon_get_page() would always increase page _refcount and
> isolate_lru_page() would increase page _refcount if the page's lru
> flag is set.
> 
> If a unevictable page isolated successfully, there will be two more
> _refcount. The one from isolate_lru_page() will be decreased in
> putback_lru_page(), but the other one from damon_get_page() will be
> left behind. This causes a pin page.
> 
> Whatever the case, the _refcount from damon_get_page() should be
> decreased.
> 
> Signed-off-by: andrew.yang <andrew.yang@...iatek.com>
> ---
>   mm/damon/paddr.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c
> index e1a4315c4be6..56d8abd08fb1 100644
> --- a/mm/damon/paddr.c
> +++ b/mm/damon/paddr.c
> @@ -223,8 +223,8 @@ static unsigned long damon_pa_pageout(struct damon_region *r)
>   			putback_lru_page(page);
>   		} else {
>   			list_add(&page->lru, &page_list);
> -			put_page(page);
>   		}
> +		put_page(page);
>   	}
>   	applied = reclaim_pages(&page_list);
>   	cond_resched();

-- 
Thanks,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ